/* =========================================
   FUND COLLECTIVE — ASSESS DESIGN SYSTEM
   Shared across assess/index, processing, report
   ========================================= */

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

/* ─── Variables: Dark Mode (default) ───────────────────────────────────────── */
:root {
    --bg:       #0e1726;
    --bg2:      #142035;
    --surface:  rgba(18, 35, 64, 0.5);
    --border:   rgba(255,255,255,0.08);
    --text:     #ffffff;
    --text2:    rgba(255,255,255,0.7);
    --text-dim: rgba(255,255,255,0.45);
    --gold:     #c9a962;
    --blue:     #159ECE;
    --green:    #4CAF50;
    --red:      #E05252;
    --error:    #ef4444;
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body:    'Inter', -apple-system, sans-serif;
    --font-mono:    'JetBrains Mono', monospace;
}

/* ─── Variables: Light Mode ────────────────────────────────────────────────── */
[data-theme="light"] {
    --bg:       #faf9f6;
    --bg2:      #ffffff;
    --surface:  rgba(255,255,255,0.85);
    --border:   rgba(18,35,64,0.08);
    --text:     #122340;
    --text2:    #3a4f6a;
    --text-dim: #6b7a8d;
    --gold:     #a58035;
    --blue:     #0e7ba3;
    --green:    #2e7d32;
    --red:      #c0392b;
    --error:    #c02020;
}

/* ─── Base ─────────────────────────────────────────────────────────────────── */
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    transition: background 0.3s, color 0.3s;
}

/* ─── Nav ──────────────────────────────────────────────────────────────────── */
.nav {
    position: sticky; top: 0; z-index: 100;
    height: 64px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; background: var(--bg); border-bottom: 1px solid var(--border);
}
.nav__logo { height: 32px; width: auto; }
.nav__right { display: flex; align-items: center; gap: 12px; }
.nav__link {
    color: var(--text-dim); text-decoration: none; font-size: 0.82rem; font-weight: 500;
    padding: 6px 12px; border-radius: 6px; transition: all 0.2s;
}
.nav__link:hover { color: var(--blue); background: rgba(255,255,255,0.04); }
.nav__link.active { color: var(--blue); background: rgba(255,255,255,0.06); font-weight: 600; }
[data-theme="light"] .nav__link:hover { background: rgba(0,0,0,0.03); }
[data-theme="light"] .nav__link.active { background: rgba(0,0,0,0.04); }
.nav__cta {
    background: var(--gold); color: #000; padding: 8px 20px; border-radius: 50px;
    text-decoration: none; font-size: 0.85rem; font-weight: 600;
}
[data-theme="light"] .nav__cta { background: #122340; color: #faf9f6; }

/* Logo swap */
.logo-dark { display: block; }
.logo-light { display: none; }
[data-theme="light"] .logo-dark { display: none; }
[data-theme="light"] .logo-light { display: block; }

/* ─── Theme Toggle ─────────────────────────────────────────────────────────── */
.theme-btn {
    background: #1a2940; border: 1px solid rgba(255,255,255,0.15); border-radius: 8px;
    color: #c9a962; cursor: pointer; padding: 8px 12px; display: flex; align-items: center;
    transition: all 0.3s; line-height: 0;
}
.theme-btn:hover { border-color: #c9a962; }
[data-theme="light"] .theme-btn {
    background: #ffffff; border-color: rgba(18,35,64,0.15); color: #122340;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
[data-theme="light"] .theme-btn:hover { border-color: #a58035; color: #a58035; }
.icon-moon, .icon-sun { width: 18px; height: 18px; display: block; }
.icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: block; }

/* ─── Page Layout ──────────────────────────────────────────────────────────── */
.page {
    display: flex; flex-direction: column; align-items: center;
    padding: 48px 20px 64px; min-height: calc(100vh - 64px);
}
.container { max-width: 820px; margin: 0 auto; padding: 0 20px; }

/* ─── Animations ───────────────────────────────────────────────────────────── */
.fade-up { animation: fadeUp 0.6s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Card (shared between upload + processing) ───────────────────────────── */
.card {
    width: 100%; max-width: 580px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
    padding: 40px 36px; backdrop-filter: blur(20px);
    animation: fadeUp 0.6s ease both;
}
.card__eyebrow {
    display: block; text-align: center; font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.15em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px;
}
.card__title { font-family: var(--font-display); font-size: 2rem; text-align: center; margin-bottom: 8px; }
.card__title em { color: var(--gold); font-style: normal; }
.card__subtitle {
    text-align: center; color: var(--text-dim); font-size: 0.95rem; font-weight: 300;
    margin-bottom: 32px; max-width: 420px; margin-left: auto; margin-right: auto;
}

/* ─── Buttons ──────────────────────────────────────────────────────────────── */
.btn-gold {
    display: inline-block; padding: 14px 28px; background: var(--gold); color: #000;
    border-radius: 50px; text-decoration: none; font-size: 0.95rem; font-weight: 600;
    transition: all 0.3s; box-shadow: 0 6px 20px rgba(201,169,98,0.25); border: none; cursor: pointer;
}
.btn-gold:hover { transform: scale(1.02); box-shadow: 0 10px 30px rgba(201,169,98,0.35); }
[data-theme="light"] .btn-gold { background: #122340; color: #faf9f6; box-shadow: 0 6px 20px rgba(18,35,64,0.15); }

.btn-outline {
    display: inline-block; padding: 10px 20px; border: 1px solid var(--border); border-radius: 50px;
    color: var(--text-dim); text-decoration: none; font-size: 0.82rem; transition: all 0.2s; white-space: nowrap;
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

/* ─── Error Banner ─────────────────────────────────────────────────────────── */
.error-banner {
    background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); border-radius: 10px;
    padding: 12px 16px; margin-bottom: 20px; color: var(--error); font-size: 0.875rem; line-height: 1.5;
}

/* ─── Forms (upload page) ──────────────────────────────────────────────────── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; }
.form-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin-bottom: 6px; }
.form-label .req { color: var(--gold); }
.form-input, .form-select {
    width: 100%; padding: 14px 16px; font-size: 0.95rem; font-family: var(--font-body);
    background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 12px;
    color: var(--text); outline: none; transition: border-color 0.3s, box-shadow 0.3s;
}
.form-input:focus, .form-select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,169,98,0.1); }
.form-input::placeholder { color: var(--text-dim); opacity: 0.6; }
[data-theme="light"] .form-input, [data-theme="light"] .form-select { background: #ffffff; border-color: rgba(0,0,0,0.1); }
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
.form-select option { background: #0e1726; color: #ffffff; }
[data-theme="light"] .form-select option { background: #ffffff; color: #122340; }
}
.form-hint { font-size: 0.72rem; color: var(--text-dim); margin-top: 4px; }

/* ─── File Input ───────────────────────────────────────────────────────────── */
.file-area {
    border: 2px dashed var(--border); border-radius: 14px; padding: 28px 20px;
    text-align: center; cursor: pointer; transition: border-color 0.3s, background 0.3s;
    margin-bottom: 16px; position: relative;
}
.file-area:hover { border-color: var(--gold); background: rgba(201,169,98,0.03); }
.file-area input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-area__label { font-size: 0.9rem; font-weight: 500; color: var(--text); }
.file-area__label span { color: var(--gold); font-weight: 600; }
.file-area__hint { font-size: 0.75rem; color: var(--text-dim); margin-top: 4px; }
.file-area__name { display: none; font-size: 0.85rem; font-weight: 500; color: var(--gold); margin-top: 8px; }
.file-area__name.show { display: block; }

/* ─── Footer ───────────────────────────────────────────────────────────────── */
.footer { padding: 24px; border-top: 1px solid var(--border); text-align: center; margin-top: auto; }
.footer a, .footer span { font-size: 0.75rem; color: var(--text-dim); text-decoration: none; }

/* ─── Score colors (shared) ────────────────────────────────────────────────── */
.score-delta { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 1rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; margin-top: 6px; }
.score-delta.up { color: var(--green); background: rgba(76,175,80,0.1); }
.score-delta.down { color: var(--red); background: rgba(224,82,82,0.1); }
.score-delta.same { color: var(--text-dim); background: var(--border); }
.cat-delta { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; margin-left: 6px; }
.cat-delta.up { color: var(--green); }
.cat-delta.down { color: var(--red); }

/* ─── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
    .card { padding: 28px 20px; border-radius: 16px; }
    .nav { padding: 0 16px; }
    .nav__link { display: none; }
}
