/* ═══════════════════════════════════════════════════════════
   ROAD TRIAGE — Main Stylesheet
   ═══════════════════════════════════════════════════════════ */

:root {
    --navy: #0a1628;
    --navy-light: #0f1f38;
    --navy-mid: #132847;
    --blue: #00a8ff;
    --blue-dark: #0077cc;
    --cyan: #00d4ff;
    --green: #00c853;
    --amber: #ffa000;
    --red: #ff1744;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --shadow-glow: 0 0 30px rgba(0,168,255,0.15);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--white);
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ─── Typography ────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

.text-gradient {
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Container ─────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container--wide {
    max-width: 1400px;
}

/* ─── Section ───────────────────────────────────────────── */
.section {
    padding: 100px 0;
    position: relative;
}
.section--dark {
    background: var(--navy);
    color: var(--white);
}
.section--dark-alt {
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-light) 100%);
    color: var(--white);
}
.section--light {
    background: var(--gray-50);
}
.section__header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px;
}
.section__label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--blue);
    margin-bottom: 16px;
    padding: 6px 16px;
    background: rgba(0,168,255,0.1);
    border-radius: 100px;
}
.section--dark .section__label {
    background: rgba(0,168,255,0.15);
}
.section__title {
    margin-bottom: 20px;
}
.section__subtitle {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--gray-800);
}
.section--dark .section__subtitle {
    color: var(--gray-400);
}

/* ─── Navigation ────────────────────────────────────────── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: var(--transition);
    background: transparent;
}
.nav--scrolled {
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 10px 0;
    box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}
.nav__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav__logo {
    display: flex;
    align-items: center;
    z-index: 1001;
}
.nav__logo-img {
    height: 54px;
    width: auto;
}
.nav__links {
    display: flex;
    align-items: center;
    gap: 32px;
}
.nav__link {
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}
.nav__link:hover, .nav__link--active {
    color: var(--white);
}
/* Dropdown */
.nav__dropdown {
    position: relative;
}
.nav__dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 22, 40, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0,168,255,0.15);
    border-radius: var(--radius-md);
    padding: 8px 0;
    padding-top: 16px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
    z-index: 1002;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
/* Invisible bridge between link and menu so mouse doesn't lose hover */
.nav__dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 16px;
}
.nav__dropdown:hover .nav__dropdown-menu {
    opacity: 1;
    visibility: visible;
}
.nav__dropdown-item {
    display: block;
    padding: 10px 20px;
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.nav__dropdown-item:hover {
    background: rgba(0,168,255,0.1);
    color: var(--white);
}
.nav__link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--blue);
    transition: var(--transition);
}
.nav__link:hover::after, .nav__link--active::after {
    width: 100%;
}
.nav__link--cta {
    background: var(--blue);
    color: var(--white) !important;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
}
.nav__link--cta::after { display: none; }
.nav__link--cta:hover {
    background: var(--blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,168,255,0.4);
}
.nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
}
.nav__toggle span {
    width: 24px;
    height: 2px;
    background: var(--white);
    transition: var(--transition);
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
    border: none;
    text-decoration: none;
    line-height: 1.4;
}
.btn--primary {
    background: var(--blue);
    color: var(--white);
}
.btn--primary:hover {
    background: var(--blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,168,255,0.4);
}
.btn--secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255,255,255,0.3);
}
.btn--secondary:hover {
    border-color: var(--white);
    background: rgba(255,255,255,0.1);
}
.btn--outline {
    background: transparent;
    color: var(--blue);
    border: 2px solid var(--blue);
}
.btn--outline:hover {
    background: var(--blue);
    color: var(--white);
}
.btn--large {
    padding: 18px 40px;
    font-size: 1.1rem;
}
.btn--glow {
    box-shadow: 0 0 20px rgba(0,168,255,0.3);
}
.btn--glow:hover {
    box-shadow: 0 0 40px rgba(0,168,255,0.5);
}

/* ─── Cards ─────────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}
.card--glass {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
}
.card--glass:hover {
    border-color: rgba(0,168,255,0.3);
    box-shadow: var(--shadow-glow);
}

/* ─── Footer ────────────────────────────────────────────── */
.footer {
    background: var(--navy);
    color: var(--gray-400);
    padding: 80px 0 40px;
}
.footer__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 60px;
}
.footer__brand {}
.footer__logo {
    margin-bottom: 16px;
}
.footer__logo-img {
    height: 60px;
    width: auto;
}
.footer__tagline {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}
.footer__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.footer__badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    background: rgba(0,168,255,0.1);
    color: var(--blue);
    border-radius: 4px;
    border: 1px solid rgba(0,168,255,0.2);
}
.footer__col h4 {
    color: var(--white);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
}
.footer__col a {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 12px;
    transition: var(--transition);
}
.footer__col a:hover { color: var(--blue); }
.footer__cta-link {
    color: var(--blue) !important;
    font-weight: 600;
}
.footer__contact-info {
    font-size: 0.85rem;
    line-height: 1.8;
    margin-top: 16px;
}
.footer__contact-info a {
    display: inline !important;
    margin-bottom: 0 !important;
}
.footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.8rem;
}
.footer__disclaimer {
    max-width: 600px;
    opacity: 0.6;
    font-size: 0.75rem;
}

/* ─── Back to Top ───────────────────────────────────────── */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.back-to-top--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,168,255,0.4);
}

/* ─── Bug Reporter ──────────────────────────────────────── */
.bug-reporter__trigger {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 52px;
    height: 52px;
    background: #c00;
    color: #fff;
    border: 2px solid #900;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(192,0,0,0.5);
    z-index: 999;
    cursor: pointer;
    transition: var(--transition);
}
.bug-reporter__trigger:hover {
    background: #e00;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(192,0,0,0.7);
}

/* Bug Modal */
.bug-modal { position: fixed; inset: 0; z-index: 10000; display: none; }
.bug-modal.open { display: block; }
.bug-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.35); }
.bug-modal__panel {
    position: absolute; top: 80px; left: 50%; transform: translateX(-50%);
    width: 520px; min-width: 340px; min-height: 340px;
    max-width: 95vw; max-height: 90vh;
    background: #fff; color: #000;
    border: 2px solid #000; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    display: flex; flex-direction: column;
    resize: both; overflow: hidden;
}
.bug-modal__header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 20px; border-bottom: 2px solid #000; background: #c00; color: #fff;
    border-radius: 8px 8px 0 0; cursor: move; user-select: none; flex-shrink: 0;
}
.bug-modal__header h3 { margin: 0; color: #fff; font-size: 1.15rem; }
.bug-modal__close {
    background: transparent; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer; line-height: 1; padding: 0 4px;
}
.bug-modal__close:hover { color: #ffd; }
.bug-modal__body { padding: 20px; flex: 1 1 auto; overflow-y: auto; }
.bug-field { margin-bottom: 14px; }
.bug-field label { display: block; font-weight: 600; color: #000; margin-bottom: 6px; font-size: 0.9rem; }
.bug-types { display:flex; flex-wrap:wrap; gap:10px 18px; }
.bug-types label { display:inline-flex; align-items:center; gap:6px; font-weight:500 !important; color:#000; cursor:pointer; font-size:0.9rem; margin-bottom:0 !important; }
.bug-types input[type="checkbox"] { width:auto !important; margin:0; cursor:pointer; }
.bug-field input, .bug-field textarea, .bug-field select {
    width: 100%; padding: 8px 10px; border: 1px solid #000; border-radius: 4px;
    color: #000; background: #fff; font-family: inherit; font-size: 0.95rem;
}
.bug-field textarea { resize: vertical; }
.bug-modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.bug-btn {
    padding: 9px 18px; border-radius: 5px; font-weight: 600; cursor: pointer; font-size: 0.9rem;
    border: 1px solid #000;
}
.bug-btn--primary { background: #c00; color: #fff; border-color: #900; }
.bug-btn--primary:hover:not(:disabled) { background: #e00; }
.bug-btn--primary:disabled { opacity: 0.6; cursor: not-allowed; }
.bug-btn--ghost { background: #fff; color: #000; }
.bug-btn--ghost:hover { background: #f0f0f0; }
.bug-modal__msg { margin-top: 12px; font-size: 0.9rem; color: #000; min-height: 1.2em; }
.bug-modal__msg--ok { color: #060; font-weight: 600; }
.bug-modal__msg--err { color: #c00; font-weight: 600; }

/* Admin nav link */
.nav__link--admin { background: #c00; color: #fff !important; padding: 6px 14px; border-radius: 4px; font-weight: 600; }
.nav__link--admin:hover { background: #e00; }

/* ─── Mobile ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .footer__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav__toggle { display: flex; }
    .nav__links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 360px;
        height: 100vh;
        background: var(--navy);
        flex-direction: column;
        padding: 100px 40px 40px;
        gap: 24px;
        transition: var(--transition);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }
    .nav__links--open { right: 0; }
    .nav__link { font-size: 1.1rem; }
    .nav__link--cta { width: 100%; text-align: center; }
    .nav__dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: none;
        box-shadow: none;
        padding: 0 0 0 16px;
        min-width: 0;
    }
    .nav__dropdown-item {
        padding: 6px 0;
        font-size: 0.95rem;
    }
    .nav__toggle--open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .nav__toggle--open span:nth-child(2) { opacity: 0; }
    .nav__toggle--open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

    .section { padding: 60px 0; }
    .section__header { margin-bottom: 40px; }

    .footer__grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .footer__bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    .container { padding: 0 16px; }
    .btn { padding: 12px 24px; font-size: 0.95rem; }
    .btn--large { padding: 14px 28px; font-size: 1rem; }
}
