/* ============================================================
   Runrated — Design System
   Font: Cormorant Garamond (heading) + DM Sans (body/UI)
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-primary:    #0F0D0B;
    --bg-surface:    #1C1713;
    --bg-card:       #231E19;
    --border:        #3A302A;
    --accent:        #C9A96E;
    --accent-hover:  #E8C98A;
    --text-primary:  #F0EAE0;
    --text-secondary:#8C7B6E;
    --text-muted:    #5A4F47;
    --success:       #5A8A6A;
    --error:         #C0614A;
    --warning:       #C9933A;
    --radius-sm:     4px;
    --radius-md:     6px;
    --radius-lg:     8px;
    --sidebar-w:     220px;
    --transition:    0.2s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

img { display: block; max-width: 100%; }

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    line-height: 1.2;
    color: var(--text-primary);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
    display: inline-block;
    background: var(--accent);
    color: #1A1410;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    text-align: center;
    white-space: nowrap;
}
.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(201,169,110,0.25);
    color: #1A1410;
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    display: inline-block;
    background: transparent;
    color: var(--accent);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    text-align: center;
    white-space: nowrap;
}
.btn-secondary:hover {
    background: rgba(201,169,110,0.08);
    transform: translateY(-1px);
    color: var(--accent-hover);
}

.btn-danger {
    display: inline-block;
    background: var(--error);
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: opacity var(--transition), transform var(--transition);
}
.btn-danger:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-block { width: 100%; display: block; }
.btn-lg { padding: 0.85rem 2rem; font-size: 0.82rem; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
}
.label-link {
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--accent);
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    padding: 0.65rem 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    appearance: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(201,169,110,0.12);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
textarea { resize: vertical; min-height: 120px; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238C7B6E' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.9rem center; padding-right: 2.5rem; }

.char-counter { text-align: right; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; }

/* input + toggle show/hide (settings) */
.input-toggle { position: relative; display: flex; align-items: center; }
.input-toggle input { padding-right: 2.8rem; }
.toggle-eye {
    position: absolute; right: 0.75rem;
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 1rem; padding: 0; line-height: 1;
}
.toggle-eye:hover { color: var(--accent); }

/* ── Alerts ───────────────────────────────────────────────── */
.alert-error {
    background: #2E1A18;
    border: 1px solid var(--error);
    border-radius: var(--radius-md);
    color: var(--error);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}
.alert-success {
    background: #1A2E20;
    border: 1px solid var(--success);
    border-radius: var(--radius-md);
    color: var(--success);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}
.alert-warning {
    background: #3A2E10;
    border: 1px solid var(--warning);
    border-radius: var(--radius-md);
    color: var(--warning);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.card-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 0.35rem;
}
.card-desc { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 1.25rem; }
.link-accent { font-size: 0.8rem; color: var(--accent); }

/* ── Badge ────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.25rem 0.65rem;
    border-radius: 100px;
}
.badge-processing { background: #3A2E10; color: var(--warning); }
.badge-done       { background: #1A2E20; color: var(--success); }
.badge-failed     { background: #2E1A18; color: var(--error); }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th {
    text-align: left;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(58,48,42,0.5);
    color: var(--text-secondary);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(201,169,110,0.03); }
.table-empty { text-align: center; color: var(--text-muted); padding: 2rem !important; }
.table-actions { display: flex; gap: 0.75rem; align-items: center; }
.action-link { font-size: 0.8rem; color: var(--accent); cursor: pointer; background: none; border: none; font-family: inherit; }
.action-link:hover { color: var(--accent-hover); }
.action-delete { color: var(--error) !important; }
.action-disabled { color: var(--text-muted); font-size: 0.8rem; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination { display: flex; gap: 0.4rem; justify-content: center; padding-top: 1.25rem; flex-wrap: wrap; }
.page-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.page-link:hover, .page-link.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #1A1410;
}

/* ── Spinner ──────────────────────────────────────────────── */
.loading-spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: min(400px, 90vw);
}
.modal-title { font-size: 1.3rem; margin-bottom: 0.5rem; }
.modal-text { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 1.5rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* ============================================================
   LANDING PAGE
   ============================================================ */

/* Navbar */
.navbar {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 100;
    transition: background var(--transition), border-bottom var(--transition), backdrop-filter var(--transition);
    padding: 0 1.5rem;
}
.navbar.scrolled {
    background: rgba(15,13,11,0.95);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}
.nav-container {
    max-width: 1100px; margin: 0 auto;
    height: 64px;
    display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    color: var(--text-primary);
    letter-spacing: 0.04em;
}
.nav-logo:hover { color: var(--accent); }
.nav-menu { list-style: none; display: flex; align-items: center; gap: 2rem; }
.nav-link { color: var(--text-secondary); font-size: 0.85rem; transition: color var(--transition); }
.nav-link:hover { color: var(--text-primary); }
.nav-cta { padding: 0.5rem 1.1rem; }
.nav-hamburger {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-hamburger span {
    display: block; width: 22px; height: 1.5px;
    background: var(--text-primary);
    transition: all var(--transition);
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    position: relative;
    padding: 6rem 1.5rem 4rem;
    overflow: hidden;
}
.hero-bg {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 50% 40%, rgba(201,169,110,0.06) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 20% 80%, rgba(201,169,110,0.03) 0%, transparent 60%);
    pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 720px; }
.hero-label {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.25rem;
}
.hero-heading {
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    font-weight: 300;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}
.hero-heading em { font-style: italic; color: var(--accent); }
.hero-sub {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}
.hero-scroll-hint {
    position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
    color: var(--text-muted); font-size: 1.1rem;
    animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(6px); } }

/* How it works */
/* BUG FIX #14: scroll-margin-top agar section tidak tertutup navbar sticky 64px */
.how-it-works { padding: 6rem 1.5rem; scroll-margin-top: 72px; }
.container { max-width: 1100px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-label {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}
.section-heading { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 300; }

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}
.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    transition: border-color var(--transition), transform var(--transition);
}
.step-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.step-number {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--accent);
    opacity: 0.5;
    line-height: 1;
    margin-bottom: 1rem;
}
.step-title { font-size: 1.15rem; margin-bottom: 0.6rem; }
.step-desc { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.65; }
.cta-center { text-align: center; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 2.5rem 1.5rem; }
.footer-inner {
    max-width: 1100px; margin: 0 auto;
    display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: 1.5rem;
    padding-bottom: 1.5rem;
}
.footer-logo { font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; margin-bottom: 0.35rem; }
.footer-tagline { font-size: 0.82rem; color: var(--text-muted); }
.footer-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-nav a { font-size: 0.82rem; color: var(--text-secondary); }
.footer-nav a:hover { color: var(--accent); }
.footer-copy { max-width: 1100px; margin: 0 auto; font-size: 0.75rem; color: var(--text-muted); }

/* ============================================================
   AUTH PAGES (login, register)
   ============================================================ */
.auth-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 50% 60% at 50% 10%, rgba(201,169,110,0.05) 0%, transparent 60%),
        var(--bg-primary);
    padding: 2rem 1rem;
}
.auth-container {
    width: 100%; max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}
.auth-logo {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 1.75rem;
}
.auth-logo:hover { color: var(--accent); }
.auth-heading {
    font-size: 1.75rem;
    font-weight: 300;
    text-align: center;
    margin-bottom: 0.35rem;
}
.auth-sub { text-align: center; color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 1.75rem; }
.auth-form { display: flex; flex-direction: column; gap: 0; }
.auth-footer-text { text-align: center; font-size: 0.83rem; color: var(--text-secondary); margin-top: 1.25rem; }
.auth-footer-text a { color: var(--accent); }

/* ============================================================
   APP LAYOUT (sidebar + main)
   ============================================================ */
.app-page { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 1.5rem 1rem;
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 50;
    overflow-y: auto;
}
.sidebar-logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    color: var(--text-primary);
    display: block;
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
}
.sidebar-logo:hover { color: var(--accent); }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.sidebar-link {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.sidebar-link:hover { background: rgba(201,169,110,0.07); color: var(--text-primary); }
.sidebar-link.active { background: rgba(201,169,110,0.12); color: var(--accent); }
.sidebar-link svg { flex-shrink: 0; opacity: 0.7; }
.sidebar-link.active svg { opacity: 1; }
.sidebar-logout {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 0.6rem 0.75rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    transition: color var(--transition);
}
.sidebar-logout:hover { color: var(--error); }

.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 2rem 2.5rem;
    max-width: calc(100% - var(--sidebar-w));
}

/* Page header */
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    margin-bottom: 2rem;
}
.page-title { font-size: 2rem; font-weight: 300; margin-bottom: 0.2rem; }
.page-sub { font-size: 0.85rem; color: var(--text-secondary); }

/* Metrics */
.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }
.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}
.metric-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.5rem; }
.metric-value { font-family: 'Cormorant Garamond', serif; font-size: 2.5rem; font-weight: 300; line-height: 1; color: var(--text-primary); }
.metric-done   .metric-value { color: var(--success); }
.metric-failed .metric-value { color: var(--error); }

/* Settings */
.settings-notice {
    background: rgba(201,169,110,0.07);
    border: 1px solid rgba(201,169,110,0.2);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.83rem;
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
}
.settings-form { display: flex; flex-direction: column; gap: 0; max-width: 560px; }
.btn-test {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: none; border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-test:hover { border-color: var(--accent); color: var(--accent); }
.test-status { margin-left: 0.5rem; font-size: 0.78rem; }

/* ============================================================
   WIZARD (create.php)
   ============================================================ */
.wizard-progress {
    display: flex; align-items: center;
    gap: 0; margin-bottom: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
}
.wizard-step { display: flex; align-items: center; gap: 0.5rem; flex: 1; }
.step-dot {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 500;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all var(--transition);
}
.step-label { font-size: 0.8rem; color: var(--text-muted); transition: color var(--transition); white-space: nowrap; }
.wizard-connector { flex: 1; height: 1px; background: var(--border); margin: 0 0.5rem; }
.wizard-step.active   .step-dot   { background: var(--accent); border-color: var(--accent); color: #1A1410; }
.wizard-step.active   .step-label { color: var(--accent); }
.wizard-step.done     .step-dot   { background: var(--success); border-color: var(--success); color: #fff; }
.wizard-step.done     .step-label { color: var(--success); }

.wizard-body .step {
    animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.wizard-actions {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 1.5rem; padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    gap: 1rem;
}

/* Upload area */
.upload-area {
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    margin-bottom: 1rem;
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--accent);
    background: rgba(201,169,110,0.04);
}
.upload-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.upload-text { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 0.35rem; }
.upload-browse { color: var(--accent); }
.upload-hint { font-size: 0.75rem; color: var(--text-muted); }
.upload-preview { margin-bottom: 1rem; }
.upload-preview img {
    max-height: 200px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin: 0 auto;
    object-fit: cover;
}

/* Recorder */
.recorder-controls { display: flex; align-items: center; gap: 1rem; margin: 1rem 0; }
.btn-record {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--error);
    background: transparent;
    color: var(--error);
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.04em;
}
.btn-record.recording { background: var(--error); color: #fff; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.7; } }
.record-timer { font-family: 'DM Sans', sans-serif; font-size: 1rem; color: var(--text-secondary); min-width: 45px; }

/* Tabs */
.tabs { display: flex; gap: 0; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.tab-btn {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    padding: 0.6rem 1.1rem;
    border: none; background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition);
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-btn:hover  { color: var(--text-primary); }

/* Collapsible */
.collapsible { border: 1px solid var(--border); border-radius: var(--radius-md); margin: 1rem 0; overflow: hidden; }
.collapsible-trigger {
    width: 100%; text-align: left;
    background: var(--bg-surface);
    border: none; color: var(--text-secondary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
    transition: color var(--transition);
}
.collapsible-trigger:hover { color: var(--text-primary); }
.collapsible-arrow { font-size: 0.75rem; transition: transform var(--transition); }
.collapsible-trigger.open .collapsible-arrow { transform: rotate(180deg); }
.collapsible-body { padding: 1rem; background: rgba(0,0,0,0.15); }

/* Review grid */
.review-grid {
    display: grid; grid-template-columns: auto 1fr; gap: 1.5rem;
    align-items: start;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.review-photo { width: 100px; height: 100px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--border); }
.review-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-top: 0.75rem; margin-bottom: 0.15rem; }
.review-label:first-child { margin-top: 0; }
.review-value { font-size: 0.88rem; color: var(--text-secondary); }

/* Progress steps (generate) */
.progress-steps { display: flex; flex-direction: column; gap: 0.6rem; margin: 1.5rem 0; }
.progress-step {
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: all 0.3s ease;
}
.progress-step::before { content: '○'; flex-shrink: 0; }
.progress-step.loading {
    color: var(--warning); border-color: rgba(201,147,58,0.2);
    background: rgba(201,147,58,0.05);
}
.progress-step.loading::before { content: ''; display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--warning); border-radius: 50%; animation: spin 0.7s linear infinite; }
.progress-step.done { color: var(--success); border-color: rgba(90,138,106,0.2); background: rgba(90,138,106,0.05); }
.progress-step.done::before { content: '✓'; color: var(--success); }
.progress-step.error { color: var(--error); border-color: rgba(192,97,74,0.2); }
.progress-step.error::before { content: '✕'; color: var(--error); }

/* ============================================================
   FADE-IN (IntersectionObserver)
   ============================================================ */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
    /* Navbar mobile */
    .nav-hamburger { display: flex; }
    .nav-menu {
        display: none;
        position: fixed; inset: 0; top: 64px;
        background: var(--bg-primary);
        flex-direction: column; align-items: center; justify-content: center;
        gap: 2rem;
    }
    .nav-menu.open { display: flex; }
    .nav-menu li { list-style: none; }
    .nav-link { font-size: 1.1rem; }
    .nav-cta { font-size: 1rem; padding: 0.75rem 2rem; }

    /* Auth */
    .auth-container { padding: 2rem 1.25rem; }

    /* App layout */
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; max-width: 100%; padding: 1.25rem 1rem; }

    /* Dashboard */
    .metrics-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; gap: 0.75rem; }

    /* Wizard */
    .wizard-progress { padding: 1rem; gap: 0; overflow-x: auto; }
    .step-label { display: none; }
    .wizard-actions { flex-direction: column-reverse; }
    .wizard-actions .btn-primary,
    .wizard-actions .btn-secondary { width: 100%; justify-content: center; }

    /* Review */
    .review-grid { grid-template-columns: 1fr; }
    .review-photo { width: 80px; height: 80px; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .main-content { padding: 1.5rem; }
    .metrics-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
    .sidebar { width: var(--sidebar-w); }
}
