:root {
    --primary: #2563eb;
    --secondary: #7c3aed;
    --accent: #d4af37;
    --danger: #dc2626;
    --success: #10b981;
    --bg-dark: #050a18;
    --bg-card: #0b1329;
    --text-muted: #94a3b8;
    --radius: 14px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    color: #0f172a;
    line-height: 1.6;
    background: #fff;
}
a { color: var(--primary); }
.hidden { display: none !important; }
.muted { color: var(--text-muted); font-size: 0.85rem; }
.error { color: var(--danger); }
.success { color: var(--success); }
.notice { background: #fef3c7; padding: 12px; border-radius: 8px; margin: 12px 0; }

.ec-btn, .ec-btn-sm, .ec-btn-outline, .ec-btn-login {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 24px; border-radius: 50px; font-weight: 700;
    text-decoration: none; border: none; cursor: pointer; font-size: 0.9rem;
}
.ec-btn {
    background: linear-gradient(135deg, #1e40af, #7c3aed);
    color: #fff;
}
.ec-btn-sm { padding: 8px 18px; font-size: 0.82rem; background: var(--primary); color: #fff; }
.ec-btn-outline { background: transparent; border: 1px solid rgba(255,255,255,0.3); color: #fff; }
.ec-btn-login { background: transparent; border: 1px solid rgba(255,255,255,0.25); color: #fff; }

.ec-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(5,10,24,0.92); backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.08); padding: 14px 20px;
}
.ec-header-container, .ec-container {
    max-width: 1100px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.ec-container { display: block; padding: 0 20px; }
.ec-logo { color: #fff; font-weight: 800; font-size: 1.3rem; text-decoration: none; }
.ec-logo span { color: #60a5fa; }
.ec-nav { display: flex; gap: 20px; }
.ec-nav a { color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 0.88rem; }
.header-actions { display: flex; gap: 10px; }

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 16px; background: var(--bg-dark); }
.auth-card {
    background: #fff; border-radius: 20px; padding: 36px; width: 100%; max-width: 420px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.auth-card--wide { max-width: 640px; }
.auth-card h1 { margin-top: 0; }
.auth-card label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 0.85rem; }
.auth-card input, .auth-card select, .input-dark, .motif5-form input, .motif5-form select {
    width: 100%; padding: 12px; margin-top: 6px; border: 2px solid #e2e8f0; border-radius: var(--radius);
}
.checkout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0; }
.dev-sim { margin-top: 20px; padding-top: 20px; border-top: 1px dashed #ccc; }
.price-highlight { font-size: 1.4rem; font-weight: 800; color: var(--success); }
.price-highlight-sub { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.premium-upgrade-notice {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 0.9rem;
    color: #1e3a8a;
}
.premium-join-lead { margin: 8px 0 0; font-size: 0.9rem; }
.premium-badge {
    display: inline-block;
    background: linear-gradient(135deg, #1e40af, #7c3aed);
    color: #fff;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 12px;
}
.premium-form label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 0.85rem; }
.premium-perks { text-align: left; margin: 20px 0; padding: 0; list-style: none; }
.premium-perks li { padding: 6px 0; font-size: 0.9rem; line-height: 1.45; }
.payment-methods { border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; margin: 16px 0; }
.pay-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 10px;
    margin: 0 -10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.92rem;
    line-height: 1.35;
}
.pay-option:has(input:checked) { background: #eff6ff; }
.ec-btn--full { width: 100%; margin-top: 8px; min-height: 48px; }
.center { text-align: center; }
.success { color: var(--success); font-weight: 600; margin: 12px 0; }

.sidebar {
    background: var(--bg-card); color: #fff; padding: 24px 16px;
    display: flex; flex-direction: column; gap: 8px;
}
.sidebar a:not(.nav-link):not(.sidebar-brand):not(.sidebar-upgrade-btn):not(.sidebar-logout) {
    color: var(--text-muted); text-decoration: none; padding: 10px 14px; border-radius: 10px; font-weight: 600; font-size: 0.85rem;
}
.sidebar a.active:not(.nav-link), .sidebar a:hover:not(.nav-link):not(.sidebar-brand) { background: rgba(37,99,235,0.15); color: #60a5fa; }
.sidebar a.locked { opacity: 0.6; }
.sidebar-brand { font-weight: 800; margin-bottom: 16px; }
.dashboard-main { padding: 32px; background: #f8fafc; position: relative; min-width: 0; }
.dashboard-blur { filter: blur(4px); pointer-events: none; user-select: none; }
.upgrade-banner {
    position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 16px; background: rgba(255,255,255,0.7);
    pointer-events: auto;
}
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.dash-section { margin-bottom: 32px; }
.dash-section h2 { font-size: 1.1rem; margin-bottom: 16px; }
.upgrade-banner-inline {
    background: linear-gradient(135deg, #1e40af, #7c3aed); color: #fff; padding: 16px 20px;
    border-radius: 14px; margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.upgrade-banner-inline .ec-btn-sm {
    flex-shrink: 0;
}
.dash-card { background: #fff; padding: 20px; border-radius: var(--radius); border: 1px solid #e2e8f0; }
.history-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.history-section-head h2 { margin: 0; }
.history-more-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--primary, #2563eb);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.history-more-btn:hover { color: #1d4ed8; }
.history-more-btn[hidden] { display: none; }
.history-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li { padding: 12px 0; border-bottom: 1px solid #e2e8f0; }
.history-empty { color: #64748b; }

.module-wrap { max-width: 900px; margin: 0 auto; padding: 32px 20px; }
.module-header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 24px; }
.credits-badge { margin-left: auto; font-size: 0.8rem; font-weight: 700; color: var(--primary); }
.audio-banner { background: #ecfdf5; padding: 12px; border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; }
.status-panel { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 20px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #94a3b8; display: inline-block; }
.status-dot[data-phase="candidate_speaking"] { background: var(--success); }
.message { padding: 16px; border-radius: var(--radius); margin-bottom: 12px; }
.message--examiner { background: #f1f5f9; }
.message--candidate { background: #eff6ff; }
.controls { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.timer-bar { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; width: 120px; }
.timer-bar div { height: 100%; background: var(--primary); transition: width 0.3s; }
.wizard-progress .bar { height: 6px; background: #e2e8f0; border-radius: 3px; margin: 10px 0 20px; }
.wizard-progress .bar div { height: 100%; background: var(--primary); transition: width 0.3s; }
.wizard-actions { display: flex; justify-content: space-between; margin-top: 16px; }
#project-output { width: 100%; padding: 14px; border-radius: var(--radius); border: 1px solid #cbd5e1; font-family: inherit; }
.audit-result { margin-top: 20px; padding: 20px; border-radius: var(--radius); border-left: 4px solid var(--primary); }
.audit-result.ok { background: #ecfdf5; border-color: var(--success); }
.audit-result.risk { background: #fef2f2; border-color: var(--danger); }
.motif5-form label { display: block; margin-bottom: 14px; font-weight: 600; }

@media (max-width: 768px) {
    .sidebar:not(.workspace-sidebar) { flex-direction: row; overflow-x: auto; }
    .dash-grid, .checkout-grid { grid-template-columns: 1fr; }
    .ec-nav { display: none; }
    .auth-wrap { padding: 24px 12px; align-items: flex-start; }
    .auth-card { padding: 24px 18px; border-radius: 16px; }
    .auth-card--wide { max-width: 100%; }
    .auth-card h1 { font-size: 1.35rem; }
    .price-highlight { font-size: 1.2rem; }
    .premium-perks li { font-size: 0.85rem; }
    .upgrade-banner-inline {
        flex-direction: column;
        align-items: flex-start;
    }
    .upgrade-banner-inline .ec-btn-sm {
        width: 100%;
        text-align: center;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}
