/* ═══════════════════════════════════════════════════════════════════════
   Design System — Income Predictor
   Dark theme · Glassmorphism · Gradient accents · Micro-animations
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Custom Properties ────────────────────────────────────────────────── */
:root {
    --clr-bg:           #0a0a1a;
    --clr-bg-alt:       #0e0e2c;
    --clr-surface:      rgba(255, 255, 255, 0.04);
    --clr-surface-hover:rgba(255, 255, 255, 0.08);
    --clr-border:       rgba(255, 255, 255, 0.08);
    --clr-text:         #e8e8f0;
    --clr-text-muted:   #9090b0;
    --clr-accent1:      #7c3aed;   /* violet */
    --clr-accent2:      #3b82f6;   /* blue   */
    --clr-accent3:      #06b6d4;   /* cyan   */
    --clr-success:      #10b981;
    --clr-error:        #ef4444;

    --grad-main:        linear-gradient(135deg, var(--clr-accent1), var(--clr-accent2));
    --grad-warm:        linear-gradient(135deg, var(--clr-accent2), var(--clr-accent3));

    --radius-sm:        8px;
    --radius-md:        16px;
    --radius-lg:        24px;
    --radius-full:      9999px;

    --shadow-card:      0 8px 32px rgba(0,0,0,.45);
    --shadow-glow:      0 0 60px rgba(124,58,237,.15);

    --font:             'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition:       .3s cubic-bezier(.4,0,.2,1);
}

/* ── Reset & Base ─────────────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
    font-size: 16px;
}
body {
    font-family: var(--font);
    background: var(--clr-bg);
    color: var(--clr-text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}
a {
    color: inherit;
    text-decoration: none;
}

/* ── Animated Background Orbs ─────────────────────────────────────────── */
.bg-orbs {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: .35;
}
.orb-1 {
    width: 500px; height: 500px;
    background: var(--clr-accent1);
    top: -15%; left: -10%;
    animation: float 18s ease-in-out infinite alternate;
}
.orb-2 {
    width: 400px; height: 400px;
    background: var(--clr-accent2);
    bottom: -10%; right: -5%;
    animation: float 22s ease-in-out infinite alternate-reverse;
}
.orb-3 {
    width: 300px; height: 300px;
    background: var(--clr-accent3);
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    animation: float 15s ease-in-out infinite alternate;
}
@keyframes float {
    0%   { transform: translate(0, 0)  scale(1); }
    50%  { transform: translate(30px, -40px) scale(1.1); }
    100% { transform: translate(-20px, 20px) scale(.95); }
}

/* ── Navbar ───────────────────────────────────────────────────────────── */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 64px;
    background: rgba(10,10,26,.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--clr-border);
}
.nav-brand {
    display: flex; align-items: center; gap: .6rem;
    font-weight: 700; font-size: 1.15rem;
}
.nav-icon { font-size: 1.4rem; }
.nav-links { display: flex; gap: 1.8rem; }
.nav-link {
    font-size: .9rem;
    font-weight: 500;
    color: var(--clr-text-muted);
    transition: color var(--transition);
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    left: 0; bottom: -4px;
    width: 0; height: 2px;
    background: var(--grad-main);
    border-radius: 1px;
    transition: width var(--transition);
}
.nav-link:hover { color: var(--clr-text); }
.nav-link:hover::after { width: 100%; }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem 4rem;
}
.hero-content { max-width: 720px; }
.hero-badge {
    display: inline-block;
    padding: .35rem 1rem;
    border-radius: var(--radius-full);
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    font-size: .78rem;
    font-weight: 500;
    letter-spacing: .5px;
    color: var(--clr-text-muted);
    margin-bottom: 1.5rem;
    animation: fadeInDown .8s ease;
}
.hero-title {
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -1.5px;
    margin-bottom: 1.2rem;
    animation: fadeInDown 1s ease;
}
.gradient-text {
    background: var(--grad-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: var(--clr-text-muted);
    max-width: 540px;
    margin: 0 auto 2rem;
    animation: fadeInDown 1.2s ease;
}
.hero-cta {
    display: inline-block;
    padding: .85rem 2.2rem;
    border-radius: var(--radius-full);
    background: var(--grad-main);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    transition: transform var(--transition), box-shadow var(--transition);
    animation: fadeInDown 1.4s ease;
}
.hero-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(124,58,237,.35);
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Section ──────────────────────────────────────────────────────────── */
.section {
    padding: 5rem 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}
.section-dark {
    background: var(--clr-bg-alt);
    max-width: 100%;
    padding-left: max(1.5rem, calc((100% - 1100px) / 2));
    padding-right: max(1.5rem, calc((100% - 1100px) / 2));
}
.section-heading {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
    text-align: center;
    margin-bottom: .5rem;
}
.section-sub {
    text-align: center;
    color: var(--clr-text-muted);
    margin-bottom: 2.5rem;
    font-size: .95rem;
}

/* ── Glass Card ───────────────────────────────────────────────────────── */
.glass-card {
    background: var(--clr-surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 2rem;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow), var(--shadow-card);
    border-color: rgba(124,58,237,.25);
}

/* ── Prediction Grid ──────────────────────────────────────────────────── */
.predict-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}
@media (max-width: 768px) {
    .predict-grid { grid-template-columns: 1fr; }
}

/* ── Form ─────────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: .4rem;
}
.form-group input {
    width: 100%;
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--clr-border);
    background: rgba(255,255,255,.05);
    color: var(--clr-text);
    font-family: var(--font);
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus {
    border-color: var(--clr-accent1);
    box-shadow: 0 0 0 3px rgba(124,58,237,.2);
}
.hint {
    display: block;
    font-size: .75rem;
    color: var(--clr-text-muted);
    margin-top: .3rem;
}

/* ── Predict Button ───────────────────────────────────────────────────── */
.btn-predict {
    width: 100%;
    padding: .9rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--grad-main);
    color: #fff;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.btn-predict:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(124,58,237,.3);
}
.btn-predict:active {
    transform: translateY(0);
}
.spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result Card ──────────────────────────────────────────────────────── */
.result-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
}
.result-placeholder {
    color: var(--clr-text-muted);
    font-size: .95rem;
}
.placeholder-icon { font-size: 2.5rem; margin-bottom: .6rem; }
.result-label {
    font-size: .85rem;
    font-weight: 500;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: .5rem;
}
.result-value {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -1px;
    background: var(--grad-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: .8rem;
    animation: popIn .4s ease;
}
.result-inputs {
    font-size: .85rem;
    color: var(--clr-text-muted);
    margin-bottom: 1.2rem;
}
.result-bar-wrap {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,.06);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: .4rem;
}
.result-bar {
    height: 100%;
    width: 0%;
    background: var(--grad-main);
    border-radius: 4px;
    transition: width 1s cubic-bezier(.4,0,.2,1);
}
.result-range {
    display: flex; justify-content: space-between;
    font-size: .7rem; color: var(--clr-text-muted);
}

@keyframes popIn {
    0%   { transform: scale(.5); opacity: 0; }
    70%  { transform: scale(1.08); }
    100% { transform: scale(1); opacity: 1; }
}

/* ── Stats Grid ───────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
    text-align: center;
    padding: 1.8rem 1.2rem;
}
.stat-icon { font-size: 2rem; margin-bottom: .6rem; }
.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -.5px;
    margin-bottom: .2rem;
    color: var(--clr-text);
}
.stat-label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--clr-text-muted);
    margin-bottom: .2rem;
}
.stat-desc {
    font-size: .73rem;
    color: rgba(144,144,176,.7);
}

/* ── About Grid ───────────────────────────────────────────────────────── */
.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }

.about-card h3 {
    font-size: 1.1rem;
    margin-bottom: .8rem;
}
.about-card p {
    font-size: .9rem;
    color: var(--clr-text-muted);
    margin-bottom: .7rem;
    line-height: 1.6;
}
.equation-box {
    background: rgba(124,58,237,.1);
    border: 1px solid rgba(124,58,237,.25);
    border-radius: var(--radius-sm);
    padding: .8rem 1rem;
    font-family: 'Courier New', monospace;
    font-size: .9rem;
    color: #c4b5fd;
    text-align: center;
    margin: .8rem 0;
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 2.5rem 1.5rem;
    font-size: .85rem;
    color: var(--clr-text-muted);
    border-top: 1px solid var(--clr-border);
}
.footer-small {
    font-size: .72rem;
    margin-top: .4rem;
    opacity: .6;
}

/* ── Error Toast ──────────────────────────────────────────────────────── */
.error-toast {
    position: fixed;
    top: 80px; left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(239,68,68,.15);
    border: 1px solid var(--clr-error);
    color: var(--clr-error);
    padding: .7rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 500;
    backdrop-filter: blur(12px);
    z-index: 200;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    pointer-events: none;
}
.error-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
