/* ═══════════════════════════════════════════════
   EcoRouter AI — Design System v3
   Professional startup aesthetic
   ═══════════════════════════════════════════════ */

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

:root {
    /* Backgrounds */
    --bg: #08080c;
    --bg-subtle: #0e0e14;
    --bg-card: rgba(255,255,255,0.033);
    --bg-card-hover: rgba(255,255,255,0.058);
    --bg-input: rgba(255,255,255,0.03);

    /* Borders */
    --border: rgba(255,255,255,0.072);
    --border-hover: rgba(255,255,255,0.14);
    --border-accent: rgba(16,185,129,0.28);
    --border-red: rgba(248,113,113,0.22);

    /* Text */
    --text: #ebebec;
    --text-2: #8c8ca0;
    --text-3: #4e4e62;

    /* Brand / Accent — Emerald */
    --accent: #10b981;
    --accent-soft: rgba(16,185,129,0.09);
    --accent-glow: rgba(16,185,129,0.2);
    --accent-border: rgba(16,185,129,0.22);

    /* Semantic */
    --red: #f87171;
    --red-soft: rgba(248,113,113,0.08);
    --gold: #fbbf24;
    --blue: #60a5fa;

    /* Radius */
    --r: 10px;
    --r-sm: 8px;
    --r-xs: 6px;

    /* Motion */
    --ease: cubic-bezier(.4, 0, .2, 1);
    --dur: 0.18s;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── PAGE FADE-IN ── */
body { animation: pageIn 0.4s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

/* ── NAVBAR ── */
.nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; height: 52px;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    background: rgba(8,8,12,0.88);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.nav-logo {
    display: flex; align-items: center; gap: 9px;
    font-weight: 700; font-size: 14px; text-decoration: none; color: var(--text);
    letter-spacing: -0.015em; flex-shrink: 0;
}
.nav-logo-icon {
    width: 26px; height: 26px; border-radius: 7px;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: #000; font-weight: 800; flex-shrink: 0;
}
.nav-center { display: flex; gap: 2px; margin: 0 auto; }
.nav-link {
    padding: 5px 11px; border-radius: var(--r-xs); font-size: 13px; font-weight: 400;
    color: var(--text-2); text-decoration: none;
    transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav-link:hover { color: var(--text); background: var(--bg-card-hover); }
.nav-link.active { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-btn {
    padding: 6px 13px; border-radius: var(--r-sm); font-size: 13px; font-weight: 500;
    text-decoration: none; border: 1px solid var(--border);
    color: var(--text-2); background: transparent;
    transition: all var(--dur) var(--ease); cursor: pointer; display: inline-block;
}
.nav-btn:hover { color: var(--text); border-color: var(--border-hover); background: var(--bg-card); }
.nav-btn-primary {
    padding: 6px 14px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600;
    text-decoration: none; border: none;
    color: #000; background: var(--accent);
    transition: all var(--dur) var(--ease); cursor: pointer; display: inline-block;
}
.nav-btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* ── SECTION / PAGE ── */
.page { max-width: 1100px; margin: 0 auto; padding: 64px 24px 100px; }
.page-sm { max-width: 460px; margin: 0 auto; }
.page-md { max-width: 620px; margin: 0 auto; }

/* ── TYPOGRAPHY ── */
.section-label {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: var(--r-xs); font-size: 11px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    background: var(--accent-soft); color: var(--accent);
    border: 1px solid var(--accent-border);
    margin-bottom: 16px;
}
.section-label.red { background: var(--red-soft); color: var(--red); border-color: var(--border-red); }
.page-title {
    font-size: 38px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.12;
    color: var(--text); margin-bottom: 12px;
}
.page-title .hl {
    background: linear-gradient(135deg, #10b981 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.page-desc { font-size: 15px; color: var(--text-2); line-height: 1.65; max-width: 480px; }
.page-desc.center { margin: 0 auto; }
.hero-center { text-align: center; margin-bottom: 52px; animation: fadeSlide 0.38s var(--ease) both; }

/* ── CARD ── */
.card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r);
    padding: 24px; transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card:hover { border-color: var(--border-hover); }
.card-lift:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0,0,0,0.3); }
.card-title { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 16px; }

/* ── INPUTS ── */
.input, textarea.input, select.input {
    width: 100%; padding: 9px 12px;
    background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--r-sm);
    color: var(--text); font-family: inherit; font-size: 13px;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); outline: none;
}
.input:focus, textarea.input:focus, select.input:focus {
    border-color: var(--border-accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder { color: var(--text-3); }
select.input { cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%234e4e62' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
select.input option { background: #0e0e14; color: var(--text); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: 0.01em; }
.field-label .req { color: var(--red); margin-left: 2px; }

/* ── BUTTONS ── */
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 20px; border-radius: var(--r-sm); border: none; cursor: pointer;
    font-size: 13px; font-weight: 600; font-family: inherit;
    background: var(--accent); color: #000;
    transition: all var(--dur) var(--ease);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 22px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); box-shadow: none; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }
.btn-primary.full { width: 100%; }
.btn-primary.red { background: var(--red); }
.btn-primary.red:hover { box-shadow: 0 6px 20px rgba(248,113,113,0.2); }

.btn-outline {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 20px; border-radius: var(--r-sm); cursor: pointer;
    font-size: 13px; font-weight: 500; font-family: inherit;
    background: transparent; color: var(--text-2);
    border: 1px solid var(--border); text-decoration: none;
    transition: all var(--dur) var(--ease);
}
.btn-outline:hover { color: var(--text); border-color: var(--border-hover); background: var(--bg-card); }

/* ── TOGGLE ── */
.toggle-row {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 6px 14px; border-radius: var(--r-sm);
    background: var(--bg-card); border: 1px solid var(--border);
    cursor: pointer; transition: border-color var(--dur) var(--ease); font-size: 13px;
}
.toggle-row:hover { border-color: var(--border-hover); }
.toggle-track {
    width: 30px; height: 16px; border-radius: 8px; position: relative;
    background: var(--text-3); transition: background var(--dur) var(--ease);
}
.toggle-track.on { background: var(--accent); }
.toggle-dot {
    position: absolute; top: 2px; left: 2px; width: 12px; height: 12px;
    border-radius: 50%; background: #fff; transition: transform var(--dur) var(--ease);
}
.toggle-track.on .toggle-dot { transform: translateX(14px); }
.toggle-label { color: var(--text-3); }
.toggle-val { font-weight: 600; color: var(--text-3); }
.toggle-val.on { color: var(--accent); }

/* ── CHIPS ── */
.chip {
    display: inline-block; padding: 3px 10px; border-radius: 6px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
.chip-simple { background: var(--accent-soft); color: var(--accent); }
.chip-medium { background: rgba(96,165,250,0.1); color: var(--blue); }
.chip-complex { background: rgba(251,191,36,0.1); color: var(--gold); }

/* ── ALERTS ── */
.alert-error {
    background: var(--red-soft); border: 1px solid var(--border-red);
    border-radius: var(--r-sm); padding: 10px 14px; font-size: 13px; color: var(--red);
    display: none; margin-top: 12px;
    animation: fadeSlide 0.22s var(--ease) both;
}
.alert-success {
    background: var(--accent-soft); border: 1px solid var(--accent-border);
    border-radius: var(--r-sm); padding: 20px; text-align: center; display: none;
    animation: fadeSlide 0.3s var(--ease) both;
}

/* ── ANIMATIONS ── */
@keyframes fadeSlide { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeSlide 0.35s var(--ease) both; }
.fade-in-d1 { animation-delay: 0.06s; }
.fade-in-d2 { animation-delay: 0.12s; }
.fade-in-d3 { animation-delay: 0.18s; }
.fade-in-d4 { animation-delay: 0.24s; }

/* ── CTA BOX ── */
.cta-box {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r);
    padding: 52px 40px; text-align: center;
    transition: border-color var(--dur) var(--ease);
}
.cta-box:hover { border-color: var(--border-hover); }
.cta-title { font-size: 26px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.025em; }
.cta-desc { font-size: 14px; color: var(--text-2); margin-bottom: 26px; line-height: 1.65; }
.cta-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── FORM SECTIONS ── */
.form-section {
    font-size: 10px; font-weight: 700; color: var(--text-3); text-transform: uppercase;
    letter-spacing: 0.08em; margin-bottom: 14px; margin-top: 22px;
    padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.form-section:first-child { margin-top: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-row.single { grid-template-columns: 1fr; }
.form-footer { text-align: center; margin-top: 14px; font-size: 11px; color: var(--text-3); line-height: 1.65; }
.form-footer a { color: var(--text-2); text-decoration: underline; }
.form-link { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-3); }
.form-link a { color: var(--accent); text-decoration: none; font-weight: 600; }
.form-link a:hover { text-decoration: underline; }

/* ── SITE FOOTER ── */
.site-footer {
    margin-top: 80px; padding: 24px 0;
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; color: var(--text-3);
}
.site-footer a { color: var(--text-3); text-decoration: none; transition: color var(--dur) var(--ease); }
.site-footer a:hover { color: var(--text-2); }
.site-footer-links { display: flex; gap: 18px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .nav-center { display: none; }
    .page-title { font-size: 28px; }
    .form-row { grid-template-columns: 1fr; }
    .cta-box { padding: 32px 20px; }
}
@media (max-width: 500px) {
    .nav { padding: 0 16px; }
    .page { padding: 32px 16px 64px; }
    .site-footer { flex-direction: column; gap: 10px; text-align: center; }
    .site-footer-links { flex-wrap: wrap; justify-content: center; gap: 12px; }
}
