/* ================================================================
   MotoReg EU Dashboard - Dark Theme (extends Quantix design system)
   Preserves all original CSS variables and extends for dashboard
   ================================================================ */

/* ---- CSS Variables (preserved from original) ---- */
:root {
    --deep-space: #1E1E24;
    --surface-1: #26262D;
    --surface-2: #2E2E36;
    --surface-3: #36363F;
    --accent: #FF6B6B;
    --accent-light: #FF9B9B;
    --accent-glow: rgba(255, 107, 107, 0.35);
    --accent-soft: rgba(255, 107, 107, 0.08);
    --accent-border: rgba(255, 107, 107, 0.25);
    --text-primary: #EEEEF0;
    --text-secondary: #8A8B9E;
    --text-muted: #55566A;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --green: #22C55E;
    --amber: #F59E0B;
    --rose: #F43F5E;
    --radius: 20px;
    --radius-sm: 12px;
    --radius-pill: 999px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    background: var(--deep-space);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 600px 400px at 80% 20%, rgba(255,107,107,0.03), transparent),
                radial-gradient(ellipse 500px 300px at 20% 60%, rgba(255,107,107,0.02), transparent);
    pointer-events: none;
    z-index: 0;
}

/* ---- Container ---- */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ---- Navbar ---- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: background 0.3s, backdrop-filter 0.3s, box-shadow 0.3s;
}

.navbar.scrolled {
    background: rgba(30, 30, 36, 0.85);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.03em;
}

.brand-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 16px;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover { color: var(--text-primary); }

.nav-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 22px; height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ---- Section Base ---- */
.section {
    padding: 120px 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.section-label::before {
    content: '';
    width: 24px; height: 1px;
    background: var(--accent);
    opacity: 0.5;
}

.section-title {
    font-size: clamp(30px, 4vw, 46px);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 16px;
    line-height: 1.15;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 15px;
    max-width: 480px;
    margin: 0 auto;
}

.gradient-text {
    background: linear-gradient(135deg, #FFD4D4, #FF6B6B, #FF9B9B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Hero Section ---- */
.hero-section {
    padding-top: 180px;
    padding-bottom: 80px;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -200px; right: -100px;
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.15;
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-pill);
    padding: 6px 16px;
    font-size: 12px;
    color: var(--accent-light);
    margin-bottom: 24px;
}

.badge-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 0;
}

.hero-mockup {
    display: flex;
    justify-content: center;
}

.mockup-window {
    width: 100%;
    max-width: 480px;
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.5);
    transform: perspective(1200px) rotateY(-4deg) rotateX(2deg);
    transition: transform 0.5s;
}

.mockup-window:hover {
    transform: perspective(1200px) rotateY(0) rotateX(0);
}

.mockup-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.mockup-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
}

.mockup-dot:nth-child(1) { background: var(--rose); }
.mockup-dot:nth-child(2) { background: var(--amber); }
.mockup-dot:nth-child(3) { background: var(--green); }

.mockup-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.mockup-metric {
    background: var(--surface-2);
    border-radius: 10px;
    padding: 14px 12px;
    text-align: center;
}

.mm-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.mm-value {
    font-size: 18px;
    font-weight: 800;
}

.mm-change {
    font-size: 10px;
    color: var(--green);
    margin-top: 2px;
}

.mockup-minimap {
    background: var(--surface-2);
    border-radius: 10px;
    padding: 12px;
}

.minimap-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.minimap-eu {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.mini-country {
    aspect-ratio: 1;
    border-radius: 4px;
    background: var(--surface-3);
    transition: all 0.3s;
}

.mini-country.active {
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* ---- Section 1: Identity ---- */
#section-identity {
    border-top: 1px solid var(--border-subtle);
}

.identity-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 32px;
    max-width: 900px;
    margin: 0 auto;
}

.auth-card, .status-card {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 36px 32px;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.5;
}

.card-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin-bottom: 20px;
}

.auth-card h3, .status-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.card-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent-border);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--accent);
    width: 14px; height: 14px;
}

.forgot-link {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.25s;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    width: 100%;
    padding: 13px;
    font-size: 14px;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
    box-shadow: 0 6px 24px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-ghost {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

.social-divider {
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
    margin: 20px 0;
    position: relative;
}

.social-divider::before, .social-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: var(--border-subtle);
}

.social-divider::before { left: 0; }
.social-divider::after { right: 0; }

.social-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.social-btn {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.social-btn:hover {
    background: var(--surface-3);
    border-color: var(--accent-border);
    color: var(--accent);
}

.status-card .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--green);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    margin-bottom: 16px;
}

.status-info {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
}

.status-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}

.status-stat {
    text-align: center;
}

.stat-num {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
}

.stat-lbl {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 4px;
}

.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--surface-1);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-pill);
    padding: 12px 24px;
    color: var(--text-primary);
    font-size: 13px;
    z-index: 2000;
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(34,197,94,0.3); }

/* ---- Section 2: Map ---- */
#section-map {
    border-top: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, transparent, rgba(255,107,107,0.015), transparent);
}

.map-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 32px;
    align-items: start;
}

.map-card, .detail-card {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    overflow: hidden;
}

.map-card {
    padding: 20px;
    position: relative;
}

.map-container {
    width: 100%;
    aspect-ratio: 1.1 / 1;
}

.map-container svg {
    width: 100%;
    height: 100%;
}

.country-path {
    fill: var(--surface-2);
    stroke: var(--surface-3);
    stroke-width: 0.5;
    cursor: pointer;
    transition: fill 0.3s ease, filter 0.3s ease, stroke 0.3s ease;
}

.country-path.has-data {
    fill: rgba(255, 107, 107, 0.12);
    stroke: rgba(255, 107, 107, 0.2);
}

.country-path:hover {
    fill: rgba(255, 107, 107, 0.45);
    stroke: rgba(255, 107, 107, 0.6);
    stroke-width: 0.8;
}

.country-path.selected {
    fill: #FF6B6B;
    filter: url(#glow-dark);
    stroke: var(--accent-light);
    stroke-width: 1.2;
}

.map-tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--surface-1);
    border: 1px solid var(--accent-border);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    opacity: 0;
    transform: translate(-50%, -120%);
    transition: opacity 0.15s;
    z-index: 10;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    white-space: nowrap;
}

.map-tooltip.visible { opacity: 1; }

.map-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 12px 0 0;
    font-size: 11px;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 8px; height: 8px;
    border-radius: 3px;
}

.legend-dot.data { background: rgba(255,107,107,0.12); border: 1px solid rgba(255,107,107,0.2); }
.legend-dot.nodata { background: var(--surface-2); border: 1px solid var(--surface-3); }

/* Detail Panel */
.detail-card {
    padding: 28px;
}

.detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 300px;
    color: var(--text-muted);
}

.detail-empty svg {
    margin-bottom: 16px;
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.detail-flag {
    font-size: 36px;
    line-height: 1;
}

.detail-name {
    font-size: 22px;
    font-weight: 800;
}

.detail-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.detail-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.detail-stat {
    background: var(--surface-2);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}

.ds-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 6px;
}

.ds-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
}

.year-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.year-btn {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-2);
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.year-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 2px 8px var(--accent-glow);
}

.year-btn:hover:not(.active) {
    border-color: var(--accent-border);
    color: var(--text-primary);
}

.chart-wrapper {
    position: relative;
    height: 280px;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ---- Section 3: Coming Soon ---- */
#section-coming-soon {
    border-top: 1px solid var(--border-subtle);
}

.coming-soon-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.future-card {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 36px 28px;
    text-align: center;
    transition: border-color 0.3s, transform 0.3s;
    position: relative;
    overflow: hidden;
}

.future-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    border: 1px solid var(--accent-glow);
    opacity: 0;
    transition: opacity 0.3s;
}

.future-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-border);
}

.future-card:hover::after {
    opacity: 1;
    animation: cardGlow 2s ease-in-out infinite;
}

@keyframes cardGlow {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.5; }
}

.future-icon {
    width: 56px; height: 56px;
    border-radius: 16px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--accent);
}

.future-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
}

.future-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.future-eta {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--accent);
    padding: 4px 12px;
    background: var(--accent-soft);
    border-radius: var(--radius-pill);
}

/* ---- Footer ---- */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.footer-links a:hover { color: var(--text-primary); }

.footer-copy {
    color: var(--text-muted);
    font-size: 12px;
}

/* ---- Animation: fade-up ---- */
.fade-up {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Loading spinner ---- */
.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260px;
}

.spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr; gap: 40px; }
    .hero-mockup { max-width: 400px; margin: 0 auto; }
    .identity-grid { grid-template-columns: 1fr; max-width: 480px; }
    .map-layout { grid-template-columns: 1fr; }
    .map-container { aspect-ratio: 1.3 / 1; }
    .detail-card { min-height: auto; }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0; right: -280px;
        width: 280px;
        height: 100vh;
        flex-direction: column;
        background: var(--surface-1);
        padding: 100px 32px 32px;
        gap: 24px;
        transition: right 0.35s ease;
        border-left: 1px solid var(--border-subtle);
    }
    .nav-links.open { right: 0; }
    .nav-toggle { display: flex; }
    .nav-actions { display: none; }
    .coming-soon-grid { grid-template-columns: 1fr; }
    .section { padding: 80px 0; }
    .hero-section { padding-top: 140px; }
    .section-title { font-size: 28px; }
    .mockup-metrics { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .auth-card, .status-card { padding: 28px 20px; }
    .detail-stats { grid-template-columns: 1fr; }
    .status-stats { grid-template-columns: repeat(3, 1fr); }
    .map-card { padding: 12px; }
}
