/* ============================================================================
   components.css — 재사용 가능한 UI 컴포넌트
   .ro-* 네임스페이스. 신규 페이지·기능은 이쪽 클래스 사용 권장.
   ============================================================================ */

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.ro-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    font-size: var(--ro-text-sm);
    font-weight: var(--ro-weight-bold);
    line-height: 1.2;
    border: 1.5px solid transparent;
    border-radius: var(--ro-radius-pill);
    background: var(--ro-surface);
    color: var(--ro-text);
    cursor: pointer;
    transition: transform var(--ro-dur-fast) var(--ro-ease),
                background var(--ro-dur-fast) var(--ro-ease),
                box-shadow var(--ro-dur-fast) var(--ro-ease),
                border-color var(--ro-dur-fast) var(--ro-ease);
    text-decoration: none;
    white-space: nowrap;
}
.ro-btn:active { transform: translateY(1px); }

.ro-btn--primary {
    background: var(--ro-primary-500);
    color: var(--ro-text-on-primary);
    border-color: var(--ro-primary-500);
    box-shadow: var(--ro-shadow-primary);
}
.ro-btn--primary:hover { background: var(--ro-primary-600); border-color: var(--ro-primary-600); transform: translateY(-1px); }

.ro-btn--accent {
    background: var(--ro-accent-500);
    color: #fff;
    border-color: var(--ro-accent-500);
    box-shadow: var(--ro-shadow-accent);
}
.ro-btn--accent:hover { background: var(--ro-accent-600); border-color: var(--ro-accent-600); transform: translateY(-1px); }

.ro-btn--outline {
    background: transparent;
    color: var(--ro-text);
    border-color: var(--ro-border);
}
.ro-btn--outline:hover { background: var(--ro-surface-alt); border-color: var(--ro-primary-500); color: var(--ro-primary-600); }

.ro-btn--ghost {
    background: transparent;
    color: var(--ro-text-sub);
    border-color: transparent;
}
.ro-btn--ghost:hover { background: var(--ro-surface-alt); color: var(--ro-text); }

.ro-btn--lg { padding: 14px 28px; font-size: var(--ro-text-base); }
.ro-btn--sm { padding: 8px 14px; font-size: var(--ro-text-xs); }
.ro-btn--block { width: 100%; }

/* ── Card ────────────────────────────────────────────────────────────────── */
.ro-card {
    background: var(--ro-surface);
    border: 1px solid var(--ro-border-soft);
    border-radius: var(--ro-radius-xl);
    padding: clamp(16px, 3vw, 28px);
    box-shadow: var(--ro-shadow-sm);
    transition: transform var(--ro-dur-base) var(--ro-ease),
                box-shadow var(--ro-dur-base) var(--ro-ease);
}
.ro-card--hover:hover { transform: translateY(-3px); box-shadow: var(--ro-shadow-lg); }
.ro-card--flat { box-shadow: none; }
.ro-card--accent { border-color: var(--ro-accent-200); background: linear-gradient(180deg, var(--ro-accent-50), var(--ro-surface)); }

/* ── Chip / Badge ────────────────────────────────────────────────────────── */
.ro-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: var(--ro-text-xs);
    font-weight: var(--ro-weight-semibold);
    background: var(--ro-surface-alt);
    color: var(--ro-text-sub);
    border-radius: var(--ro-radius-pill);
    border: 1px solid var(--ro-border-soft);
}
.ro-chip--primary { background: var(--ro-primary-50); color: var(--ro-primary-700); border-color: var(--ro-primary-100); }
.ro-chip--accent  { background: var(--ro-accent-50); color: var(--ro-accent-700); border-color: var(--ro-accent-100); }
.ro-chip--success { background: rgba(16, 185, 129, 0.10); color: #047857; border-color: rgba(16, 185, 129, 0.20); }
.ro-chip--warn    { background: rgba(245, 158, 11, 0.10); color: #B45309; border-color: rgba(245, 158, 11, 0.20); }
.ro-chip--live::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--ro-danger-500);
    animation: ro-pulse 1.6s var(--ro-ease) infinite;
}
@keyframes ro-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.55; transform: scale(1.25); }
}

.ro-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: var(--ro-text-xs);
    font-weight: var(--ro-weight-bold);
    border-radius: var(--ro-radius-sm);
    background: var(--ro-primary-500);
    color: #fff;
}

/* ── Section Header ──────────────────────────────────────────────────────── */
.ro-section { padding-block: var(--ro-section-y); }
.ro-section-header {
    max-width: 720px;
    margin: 0 auto var(--ro-space-8);
    text-align: center;
}
.ro-section-header__kicker {
    display: inline-block;
    font-size: var(--ro-text-xs);
    font-weight: var(--ro-weight-bold);
    color: var(--ro-primary-600);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: var(--ro-space-3);
}
.ro-section-header__title  { font-size: var(--ro-text-3xl); margin-bottom: var(--ro-space-3); }
.ro-section-header__desc   { font-size: var(--ro-text-base); color: var(--ro-text-sub); }

/* ── Form ────────────────────────────────────────────────────────────────── */
.ro-input {
    width: 100%;
    padding: 12px 16px;
    font-size: var(--ro-text-base);
    font-family: inherit;
    color: var(--ro-text);
    background: var(--ro-surface);
    border: 1.5px solid var(--ro-border);
    border-radius: var(--ro-radius-lg);
    transition: border-color var(--ro-dur-fast), box-shadow var(--ro-dur-fast);
}
.ro-input:focus {
    outline: none;
    border-color: var(--ro-primary-500);
    box-shadow: 0 0 0 4px rgba(78, 143, 255, 0.16);
}

/* ── Grid / Cluster helpers (Auto-fit responsive) ────────────────────────── */
.ro-grid { display: grid; gap: var(--ro-space-4); }
.ro-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.ro-grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.ro-grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }

/* ── Live Hero Stat Widget (홈 히어로 신규) ──────────────────────────────── */
.ro-live-hero {
    position: relative;
    background: var(--ro-surface);
    border: 1px solid var(--ro-border-soft);
    border-radius: var(--ro-radius-2xl);
    padding: clamp(20px, 3vw, 32px);
    box-shadow: var(--ro-shadow-lg);
    overflow: hidden;
}
.ro-live-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    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%);
    pointer-events: none;
    z-index: 0;
}
.ro-live-hero > * { position: relative; z-index: 1; }

.ro-live-hero__head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: var(--ro-space-5);
}
.ro-live-hero__title { font-size: var(--ro-text-lg); font-weight: var(--ro-weight-bold); margin: 0; }
.ro-live-hero__metric {
    display: flex;
    align-items: baseline;
    gap: var(--ro-space-2);
    margin: var(--ro-space-2) 0;
}
.ro-live-hero__metric-num {
    font-size: var(--ro-text-5xl);
    font-weight: var(--ro-weight-black);
    letter-spacing: var(--ro-tracking-tight);
    color: var(--ro-primary-600);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    line-height: 1;
}
.ro-live-hero__metric-unit { font-size: var(--ro-text-lg); font-weight: var(--ro-weight-bold); color: var(--ro-text-sub); }

.ro-live-hero__sparkline { width: 100%; height: 64px; display: block; }
.ro-live-hero__sparkline path.fill   { fill: rgba(78, 143, 255, 0.15); }
.ro-live-hero__sparkline path.stroke { fill: none; stroke: var(--ro-primary-500); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.ro-live-hero__feed {
    display: flex; flex-direction: column;
    gap: var(--ro-space-2);
    margin-top: var(--ro-space-4);
    padding-top: var(--ro-space-4);
    border-top: 1px dashed var(--ro-border);
}
.ro-live-hero__feed-item {
    display: flex; align-items: center; gap: var(--ro-space-3);
    font-size: var(--ro-text-sm);
    color: var(--ro-text-sub);
}
.ro-live-hero__feed-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ro-primary-50);
    color: var(--ro-primary-700);
    font-weight: var(--ro-weight-bold);
    font-size: var(--ro-text-xs);
}

/* ── Hero Intro Card (홈 히어로 우측 정적 인트로) ───────────────────────── */
.ro-hero-intro {
    position: relative;
    background: var(--ro-surface);
    border: 1px solid var(--ro-border-soft);
    border-radius: var(--ro-radius-2xl);
    padding: clamp(24px, 3.6vw, 36px);
    box-shadow: var(--ro-shadow-lg);
    overflow: hidden;
}
.ro-hero-intro::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(140% 60% at 100% 0%, rgba(78, 143, 255, 0.10), transparent 60%),
        radial-gradient(100% 60% at 0% 100%, rgba(255, 107, 74, 0.06), transparent 60%);
    pointer-events: none;
    z-index: 0;
}
.ro-hero-intro > * { position: relative; z-index: 1; }

/* 인사 칩 */
.ro-hero-intro__greet {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    margin-bottom: var(--ro-space-4);
    background: var(--ro-primary-50);
    border: 1px solid var(--ro-primary-100);
    border-radius: var(--ro-radius-pill);
    font-size: var(--ro-text-sm);
    font-weight: var(--ro-weight-bold);
    color: var(--ro-primary-700);
}
[data-theme="dark"] .ro-hero-intro__greet {
    background: rgba(78, 143, 255, 0.14);
    border-color: rgba(78, 143, 255, 0.24);
    color: var(--ro-primary-300);
}
.ro-hero-intro__greet-emoji {
    font-size: var(--ro-text-base);
    line-height: 1;
}

/* 타이틀 */
.ro-hero-intro__title {
    margin: 0 0 var(--ro-space-4);
    font-size: clamp(var(--ro-text-2xl), 3vw, var(--ro-text-3xl));
    font-weight: var(--ro-weight-black);
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--ro-text);
}
.ro-hero-intro__accent {
    background: linear-gradient(135deg, var(--ro-primary-500), var(--ro-accent-500));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.ro-hero-intro__lede {
    margin: 0 0 var(--ro-space-5);
    color: var(--ro-text-sub);
    font-size: var(--ro-text-base);
    line-height: 1.7;
}

/* 핵심 가치 3개 체크 리스트 */
.ro-hero-intro__points {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--ro-space-5);
    display: flex;
    flex-direction: column;
    gap: var(--ro-space-3);
}
.ro-hero-intro__points li {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: baseline;
}
.ro-hero-intro__check {
    grid-row: 1 / 3;
    align-self: start;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--ro-primary-500);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(78, 143, 255, 0.25);
    flex-shrink: 0;
    margin-top: 2px;
}
.ro-hero-intro__points li strong {
    font-size: var(--ro-text-base);
    font-weight: var(--ro-weight-bold);
    color: var(--ro-text);
    line-height: 1.4;
}
.ro-hero-intro__points li > span:last-child {
    font-size: var(--ro-text-sm);
    color: var(--ro-text-sub);
    line-height: 1.5;
}

.ro-hero-intro__ctas {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: var(--ro-space-4);
    border-top: 1px dashed var(--ro-border);
}

/* ── 반응형 유틸리티 (sm/md/lg/xl/tv) ───────────────────────────────────── */
.ro-hide-xs { display: initial; }
@media (max-width: 479px)  { .ro-hide-xs { display: none !important; } }
@media (max-width: 767px)  { .ro-hide-sm { display: none !important; } }
@media (max-width: 1023px) { .ro-hide-md { display: none !important; } }
@media (min-width: 1024px) { .ro-show-lg { display: initial; } .ro-hide-lg { display: none !important; } }
@media (min-width: 1920px) { .ro-show-tv { display: initial; } }
