/* ============================================================================
   account.css — 로그인 / 프로필 페이지 전용
   "Performance Calm" 디자인 토큰 (tokens.css) 사용 — 다크/라이트/시스템 자동 대응
   반응형 4단(xs/sm/md/lg) + TV(xl) 모두 지원
   ============================================================================ */

/* ── 공통 wrapper (헤더·푸터 사이를 채우는 중앙 정렬) ─────────────────── */
.ro-auth-wrap {
    min-height: 100vh;
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(78, 143, 255, 0.10), transparent 60%),
        radial-gradient(80% 80% at 0% 100%, rgba(255, 107, 74, 0.06), transparent 60%),
        var(--ro-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(80px, 14vh, 140px) 16px clamp(40px, 8vh, 80px);
}

/* ── 로그인 카드 ──────────────────────────────────────────────────────── */
.ro-login-card {
    width: 100%;
    max-width: 440px;
    background: var(--ro-surface);
    border: 1px solid var(--ro-border-soft);
    border-radius: var(--ro-radius-2xl);
    box-shadow: var(--ro-shadow-xl);
    padding: clamp(28px, 5vw, 44px) clamp(24px, 4vw, 36px);
    color: var(--ro-text);
}
.ro-login-card__logo {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: var(--ro-space-6);
}
.ro-login-card__logo img {
    height: 32px; width: auto;
}
.ro-login-card__brand {
    font-weight: var(--ro-weight-black);
    font-size: var(--ro-text-lg);
    letter-spacing: var(--ro-tracking-tight);
}
.ro-login-card__title {
    font-size: var(--ro-text-2xl);
    font-weight: var(--ro-weight-bold);
    margin: 0 0 6px;
}
.ro-login-card__lede {
    color: var(--ro-text-sub);
    font-size: var(--ro-text-sm);
    margin: 0 0 var(--ro-space-6);
}

.ro-field {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: var(--ro-space-4);
}
.ro-field__label {
    font-size: var(--ro-text-sm);
    font-weight: var(--ro-weight-semibold);
    color: var(--ro-text-sub);
}
.ro-field__input {
    width: 100%;
    padding: 12px 14px;
    font-family: inherit;
    font-size: var(--ro-text-base);
    color: var(--ro-text);
    background: var(--ro-surface);
    border: 1.5px solid var(--ro-border);
    border-radius: var(--ro-radius-md);
    transition: border-color var(--ro-dur-fast), box-shadow var(--ro-dur-fast);
    appearance: none;
}
.ro-field__input:focus {
    outline: none;
    border-color: var(--ro-primary-500);
    box-shadow: 0 0 0 4px rgba(78, 143, 255, 0.16);
}
.ro-field__input::placeholder { color: var(--ro-text-muted); }
.ro-field__error {
    font-size: var(--ro-text-xs);
    color: var(--ro-danger-500);
    margin-top: 2px;
}

.ro-checkbox {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: var(--ro-text-sm);
    color: var(--ro-text-sub);
    cursor: pointer;
    user-select: none;
}
.ro-checkbox input { width: 16px; height: 16px; accent-color: var(--ro-primary-500); }

.ro-login-card__error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.20);
    border-radius: var(--ro-radius-md);
    padding: 10px 14px;
    color: var(--ro-danger-500);
    font-size: var(--ro-text-sm);
    margin-bottom: var(--ro-space-4);
}

.ro-login-card__hint {
    margin-top: var(--ro-space-6);
    padding-top: var(--ro-space-4);
    border-top: 1px solid var(--ro-border);
    font-size: var(--ro-text-xs);
    color: var(--ro-text-muted);
    line-height: 1.6;
}
.ro-login-card__hint a { color: var(--ro-primary-600); font-weight: 600; }
.ro-login-card__hint a:hover { text-decoration: underline; }

/* ── 프로필 페이지 ──────────────────────────────────────────────────── */
.ro-profile {
    padding: clamp(80px, 12vh, 120px) 16px clamp(60px, 10vh, 96px);
    max-width: var(--ro-container-lg);
    margin-inline: auto;
    color: var(--ro-text);
}

.ro-profile-hero {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: clamp(16px, 3vw, 28px);
    align-items: center;
    background: var(--ro-surface);
    border: 1px solid var(--ro-border-soft);
    border-radius: var(--ro-radius-2xl);
    padding: clamp(20px, 4vw, 32px);
    box-shadow: var(--ro-shadow-lg);
    margin-bottom: var(--ro-space-6);
}
.ro-profile-hero__avatar {
    width: clamp(64px, 12vw, 96px);
    height: clamp(64px, 12vw, 96px);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ro-primary-500), var(--ro-accent-500));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: clamp(24px, 4vw, 36px);
    font-weight: var(--ro-weight-black);
    overflow: hidden;
}
.ro-profile-hero__avatar img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.ro-profile-hero__id { min-width: 0; }
.ro-profile-hero__nick {
    font-size: clamp(var(--ro-text-xl), 4vw, var(--ro-text-3xl));
    font-weight: var(--ro-weight-black);
    line-height: 1.2;
    margin: 0;
    overflow-wrap: anywhere;
}
.ro-profile-hero__email {
    color: var(--ro-text-sub);
    font-size: var(--ro-text-sm);
    margin-top: 6px;
    overflow-wrap: anywhere;
}
.ro-profile-hero__plan {
    margin-top: 10px;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    background: var(--ro-primary-50);
    color: var(--ro-primary-700);
    border-radius: var(--ro-radius-pill);
    font-size: var(--ro-text-xs);
    font-weight: var(--ro-weight-bold);
    border: 1px solid var(--ro-primary-100);
}

@media (max-width: 639px) {
    .ro-profile-hero {
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "avatar id"
            "logout logout";
    }
    .ro-profile-hero__avatar { grid-area: avatar; }
    .ro-profile-hero__id     { grid-area: id; }
    .ro-profile-hero__logout { grid-area: logout; justify-self: stretch; }
    .ro-profile-hero__logout button { width: 100%; }
}

/* 스탯 그리드 (반응형 auto-fit) — 정보 카드들과 시각 톤·간격 통일 */
.ro-profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: var(--ro-space-3);
    margin-bottom: var(--ro-space-4);  /* 24px → 16px : 정보 섹션과 동일 리듬 */
}
.ro-profile-stat {
    background: var(--ro-surface);
    border: 1px solid var(--ro-border-soft);
    border-radius: var(--ro-radius-lg);
    padding: clamp(16px, 2.4vw, 22px) clamp(16px, 2.5vw, 22px);
    box-shadow: var(--ro-shadow-xs);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ro-profile-stat__label {
    font-size: var(--ro-text-xs);
    font-weight: var(--ro-weight-bold);
    color: var(--ro-text-sub);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0;
}
.ro-profile-stat__num {
    /* 카드 높이 균형 위해 4xl → 3xl 로 한 단계 줄임 (큰 0이 카드를 늘리는 문제 해소) */
    font-size: clamp(var(--ro-text-2xl), 3.4vw, var(--ro-text-3xl));
    font-weight: var(--ro-weight-black);
    color: var(--ro-primary-600);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    margin-top: 4px;
}
.ro-profile-stat__num--empty {
    color: var(--ro-text-muted);
}
.ro-profile-stat__unit {
    font-size: var(--ro-text-sm);
    color: var(--ro-text-sub);
    font-weight: var(--ro-weight-medium);
    margin-left: 4px;
}
.ro-profile-stat__hint {
    font-size: var(--ro-text-xs);
    color: var(--ro-text-muted);
    margin-top: auto;
}

/* 활동 없음 안내 (stats 0일 때) */
.ro-empty-runs {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 18px);
    padding: clamp(14px, 2.5vw, 20px) clamp(16px, 3vw, 24px);
    background: linear-gradient(135deg, var(--ro-primary-50), var(--ro-surface));
    border: 1px solid var(--ro-primary-100);
    border-radius: var(--ro-radius-xl);
    margin-bottom: var(--ro-space-4);
    box-shadow: var(--ro-shadow-xs);
    flex-wrap: wrap;
}
[data-theme="dark"] .ro-empty-runs {
    background: linear-gradient(135deg, rgba(78,143,255,0.10), var(--ro-surface));
    border-color: rgba(78,143,255,0.20);
}
.ro-empty-runs__emoji {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}
.ro-empty-runs > div {
    flex: 1 1 220px;
    min-width: 0;
}
.ro-empty-runs strong {
    display: block;
    font-size: var(--ro-text-base);
    font-weight: var(--ro-weight-bold);
    color: var(--ro-text);
    margin-bottom: 4px;
}
.ro-empty-runs p {
    margin: 0;
    color: var(--ro-text-sub);
    font-size: var(--ro-text-sm);
    line-height: 1.6;
}

/* 정보 섹션 — stats와 동일 간격 */
.ro-profile-section {
    background: var(--ro-surface);
    border: 1px solid var(--ro-border-soft);
    border-radius: var(--ro-radius-xl);
    padding: clamp(18px, 3vw, 28px);
    margin-bottom: var(--ro-space-4);
    box-shadow: var(--ro-shadow-xs);
}
.ro-profile-section__head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    margin-bottom: var(--ro-space-4);
    flex-wrap: wrap;
}
.ro-profile-section__title {
    font-size: var(--ro-text-lg);
    font-weight: var(--ro-weight-bold);
    margin: 0;
}
.ro-profile-section__hint {
    font-size: var(--ro-text-xs);
    color: var(--ro-text-muted);
}

.ro-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: var(--ro-space-4);
}
.ro-info-cell {
    display: flex; flex-direction: column; gap: 4px;
    min-width: 0;
}
.ro-info-cell__label {
    font-size: var(--ro-text-xs);
    color: var(--ro-text-sub);
    font-weight: var(--ro-weight-semibold);
}
.ro-info-cell__value {
    font-size: var(--ro-text-base);
    color: var(--ro-text);
    font-weight: var(--ro-weight-medium);
    overflow-wrap: anywhere;
}
.ro-info-cell__value--muted { color: var(--ro-text-muted); font-style: italic; }

/* 읽기 전용 안내 배너 */
.ro-readonly-note {
    background: var(--ro-surface-alt);
    border-left: 4px solid var(--ro-primary-500);
    border-radius: var(--ro-radius-md);
    padding: 12px 16px;
    font-size: var(--ro-text-sm);
    color: var(--ro-text-sub);
    margin-bottom: var(--ro-space-5);
    display: flex; align-items: flex-start; gap: 10px;
}
.ro-readonly-note__icon {
    flex-shrink: 0;
    color: var(--ro-primary-600);
    margin-top: 2px;
}

/* 가시성 칩 */
.ro-vis-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: var(--ro-radius-pill);
    font-size: var(--ro-text-xs);
    font-weight: var(--ro-weight-bold);
    border: 1px solid var(--ro-border);
    background: var(--ro-surface);
}
.ro-vis-chip--private { color: var(--ro-text-sub); }
.ro-vis-chip--friends { color: var(--ro-primary-700); background: var(--ro-primary-50); border-color: var(--ro-primary-100); }
.ro-vis-chip--public  { color: var(--ro-accent-700); background: var(--ro-accent-50);  border-color: var(--ro-accent-100); }

/* TV (1920+) — 컨테이너 폭만 확대, 카드 폭은 유지해 정보 밀도 보호 */
@media (min-width: 1920px) {
    .ro-profile { max-width: var(--ro-container-2xl); }
}

/* 접근성: 모션 감소 */
@media (prefers-reduced-motion: reduce) {
    .ro-profile-hero, .ro-profile-stat, .ro-profile-section, .ro-login-card {
        transition: none !important;
    }
}
