/* === DelPhish Design System — Dark Cybersecurity Theme === */
:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #38bdf8;
    --secondary: #e2e8f0;
    --accent: #22d3ee;
    --bg: #050a15;
    --bg-card: #0c1425;
    --bg-elevated: #111d35;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #1e3050;
    --glow: rgba(14,165,233,0.15);
    --glow-strong: rgba(14,165,233,0.25);
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --critical: #ef4444;
    --radius: 12px;
    --shadow: 0 2px 6px rgba(0,0,0,0.25), 0 1px 3px rgba(0,0,0,0.15);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.45), 0 4px 12px rgba(0,0,0,0.25);
    --shadow-glow: 0 0 20px var(--glow), 0 0 40px rgba(14,165,233,0.06);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Dark Mode (explicit attribute) === */
[data-theme="dark"] {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #38bdf8;
    --secondary: #e2e8f0;
    --accent: #22d3ee;
    --bg: #050a15;
    --bg-card: #0c1425;
    --bg-elevated: #111d35;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #1e3050;
    --glow: rgba(14,165,233,0.15);
    --glow-strong: rgba(14,165,233,0.25);
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --critical: #ef4444;
    --shadow: 0 2px 6px rgba(0,0,0,0.25), 0 1px 3px rgba(0,0,0,0.15);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.45), 0 4px 12px rgba(0,0,0,0.25);
    --shadow-glow: 0 0 20px var(--glow), 0 0 40px rgba(14,165,233,0.06);
}

/* === Light Mode Override === */
[data-theme="light"] {
    --primary: #1a56db;
    --primary-dark: #1240a8;
    --primary-light: #3b82f6;
    --secondary: #0f172a;
    --accent: #06b6d4;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-elevated: #f1f5f9;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --glow: rgba(26,86,219,0.1);
    --glow-strong: rgba(26,86,219,0.18);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --critical: #dc2626;
    --shadow: 0 1px 4px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.05);
    --shadow-lg: 0 12px 28px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.06);
    --shadow-glow: 0 0 20px var(--glow), 0 0 40px rgba(26,86,219,0.04);
}

/* === Light mode specific overrides === */
[data-theme="light"] .header {
    background: linear-gradient(135deg, rgba(15,23,42,0.95) 0%, rgba(30,58,95,0.97) 100%);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

[data-theme="light"] .header::after {
    background: linear-gradient(90deg, transparent, rgba(59,130,246,0.3) 20%, rgba(6,182,212,0.4) 50%, rgba(59,130,246,0.3) 80%, transparent);
}

[data-theme="light"] .hero h1 {
    color: #0f172a;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

[data-theme="light"] .loading-box { background: white; color: #1e293b; }

[data-theme="light"] .risk-seguro { background: #d1fae5; color: #065f46; }
[data-theme="light"] .risk-bajo { background: #fef3c7; color: #92400e; }
[data-theme="light"] .risk-medio { background: #fed7aa; color: #9a3412; }
[data-theme="light"] .risk-alto { background: #fecaca; color: #991b1b; }
[data-theme="light"] .risk-critico { background: #fee2e2; color: #7f1d1d; border: 2px solid var(--critical); }

[data-theme="light"] .classification-badge.cl-phishing { background: #fee2e2; color: #991b1b; border: 2px solid #ef4444; }
[data-theme="light"] .classification-badge.cl-spam { background: #fff7ed; color: #9a3412; border: 2px solid #f97316; }
[data-theme="light"] .classification-badge.cl-legitimate { background: #d1fae5; color: #065f46; border: 2px solid #10b981; }
[data-theme="light"] .classification-badge.cl-suspicious { background: #fef3c7; color: #92400e; border: 2px solid #f59e0b; }

[data-theme="light"] .toast-success { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
[data-theme="light"] .toast-error { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
[data-theme="light"] .toast-warning { background: #fef3c7; color: #92400e; border-left: 4px solid #f59e0b; }
[data-theme="light"] .toast-info { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }
[data-theme="light"] .toast { box-shadow: 0 4px 20px rgba(0,0,0,0.15); }

[data-theme="light"] .factor-category-header { background: #f8fafc; }
[data-theme="light"] .factor-category-header:hover { background: #eef2ff; }

[data-theme="light"] .history-table tr:hover td { background: #f1f5f9; }

[data-theme="light"] .recommendations-box {
    background: #eff6ff;
    border-color: #bfdbfe;
}

[data-theme="light"] .score-card { background: #f8fafc; border-color: #e2e8f0; }
[data-theme="light"] .score-card:hover { border-color: rgba(26,86,219,0.2); box-shadow: 0 0 16px rgba(26,86,219,0.06); }
[data-theme="light"] .summary-box { background: #f8fafc; }
[data-theme="light"] .intel-card { background: #f8fafc; }

[data-theme="light"] .card-icon {
    background: linear-gradient(135deg, rgba(26,86,219,0.1), rgba(6,182,212,0.08));
    border-color: rgba(26,86,219,0.12);
}

[data-theme="light"] .footer::before {
    background: linear-gradient(90deg, transparent, rgba(26,86,219,0.1), transparent);
}

[data-theme="light"] .form-group input:focus,
[data-theme="light"] .form-group textarea:focus {
    background: white;
    box-shadow: 0 0 0 3px rgba(26,86,219,0.15);
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group textarea,
[data-theme="light"] .form-group select {
    color: #1e293b;
    background: #f8fafc;
}

[data-theme="light"] .pagination button {
    background: white;
    border-color: #e2e8f0;
    color: #1e293b;
}
[data-theme="light"] .pagination button:hover { background: #f8fafc; }
[data-theme="light"] .pagination button.active { background: var(--primary); color: white; border-color: var(--primary); }

[data-theme="light"] .about-card { background: white; border-color: #e2e8f0; }
[data-theme="light"] .weight-bar { background: #e2e8f0; }

[data-theme="light"] .btn-secondary {
    background: #f8fafc;
    color: #1e293b;
    border-color: #e2e8f0;
}
[data-theme="light"] .btn-secondary:hover { background: #e2e8f0; }

[data-theme="light"] .upload-zone:hover {
    border-color: var(--primary-light);
    background: rgba(59, 130, 246, 0.04);
}
[data-theme="light"] .upload-zone.drag-over {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
}
[data-theme="light"] .upload-zone.upload-success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.06);
}
[data-theme="light"] .upload-zone.upload-error {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.06);
}
[data-theme="light"] .upload-status { background: #f8fafc; }

[data-theme="light"] .auth-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

[data-theme="light"] .guest-result-banner {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: #bfdbfe;
}
[data-theme="light"] .guest-result-banner p { color: #1e40af; }

/* === Dark mode specific (default) === */
.risk-seguro { background: #064e3b; color: #6ee7b7; }
.risk-bajo { background: #78350f; color: #fde68a; }
.risk-medio { background: #7c2d12; color: #fdba74; }
.risk-alto { background: #7f1d1d; color: #fca5a5; }
.risk-critico { background: #450a0a; color: #fca5a5; border: 2px solid var(--critical); }

.classification-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: box-shadow var(--transition);
}
.classification-badge.cl-phishing { background: #450a0a; color: #fca5a5; border: 2px solid #ef4444; box-shadow: 0 0 12px rgba(239,68,68,0.2); }
.classification-badge.cl-spam { background: #431407; color: #fdba74; border: 2px solid #f97316; box-shadow: 0 0 12px rgba(249,115,22,0.2); }
.classification-badge.cl-legitimate { background: #064e3b; color: #6ee7b7; border: 2px solid #10b981; box-shadow: 0 0 12px rgba(16,185,129,0.2); }
.classification-badge.cl-suspicious { background: #78350f; color: #fde68a; border: 2px solid #f59e0b; box-shadow: 0 0 12px rgba(245,158,11,0.2); }

/* Message type badge (SMS) */
.message-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sms-badge { background: #1e3a5f; color: #60a5fa; border: 2px solid #3b82f6; }
[data-theme="light"] .sms-badge { background: #dbeafe; color: #1d4ed8; border: 2px solid #3b82f6; }

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 420px;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlideIn 0.3s ease-out;
}
.toast.removing {
    animation: toastSlideOut 0.25s ease-in forwards;
}
.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-message { flex: 1; }
.toast-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 2px;
    flex-shrink: 0;
}
.toast-close:hover { opacity: 1; }
.toast-success { background: #064e3b; color: #6ee7b7; border-left: 4px solid #10b981; }
.toast-error { background: #450a0a; color: #fca5a5; border-left: 4px solid #ef4444; }
.toast-warning { background: #78350f; color: #fde68a; border-left: 4px solid #f59e0b; }
.toast-info { background: #1e3a5f; color: #93c5fd; border-left: 4px solid #3b82f6; }
@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.factor-category-header:hover { background: #1e3a5f; }

.history-table tr:hover td { background: #1e3050; }

.recommendations-box {
    background: #1e3a5f;
    border: 1px solid #2563eb;
    border-radius: 10px;
    padding: 20px;
    margin: 16px 0;
    white-space: pre-line;
    line-height: 1.8;
}

.score-card { background: #0a1020; }
.summary-box { background: #0a1020; }
.intel-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    background: #0a1020;
}

.auth-error {
    background: #450a0a;
    border: 1px solid #7f1d1d;
    color: #fca5a5;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.88rem;
    margin-bottom: 16px;
}

.auth-success {
    background: #052e16;
    border: 1px solid #166534;
    color: #86efac;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.88rem;
    margin-bottom: 16px;
}

[data-theme="light"] .auth-success {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}

.guest-result-banner {
    background: linear-gradient(135deg, #1e3a5f, #0c1425);
    border: 1px solid #2563eb;
    border-radius: 10px;
    padding: 16px 20px;
    text-align: center;
    margin-bottom: 24px;
}
.guest-result-banner p {
    color: #93c5fd;
    font-size: 0.9rem;
    margin-bottom: 10px;
}
.guest-result-banner a { font-weight: 600; }

/* === Header controls (theme + language) === */
.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Language selector */
.lang-selector {
    height: 38px;
    padding: 0 10px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: white;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 26px;
    transition: background 0.2s ease;
}
.lang-selector:hover { background: rgba(255,255,255,0.2); }
.lang-selector option { color: #1e293b; background: white; }

/* Theme toggle button */
.theme-toggle {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: background 0.2s ease;
    flex-shrink: 0;
    margin-left: 8px;
}
.theme-toggle:hover { background: rgba(255,255,255,0.2); }

/* Smooth theme transitions */
body, .card, .about-card, .form-group input, .form-group textarea,
.btn-secondary, .pagination button, .loading-box, .factor-category-header,
.score-card, .summary-box, .recommendations-box, .intel-card, .header,
.footer {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

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

/* === Skip-to-content link (a11y) === */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    z-index: 10000;
    background: var(--primary);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 12px;
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* === Global focus styles (a11y) === */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Remove focus outline for mouse users (keep for keyboard) */
:focus:not(:focus-visible) {
    outline: none;
}

/* Selection color */
::selection {
    background: rgba(14,165,233,0.25);
    color: var(--text);
}

[data-theme="light"] ::selection {
    background: rgba(26,86,219,0.2);
}

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

/* Particle canvas background */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* === Header === */
.header {
    background: linear-gradient(135deg, rgba(5,10,21,0.92) 0%, rgba(12,20,37,0.95) 50%, rgba(17,29,53,0.92) 100%);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 24px rgba(0,0,0,0.35), 0 1px 0 rgba(14,165,233,0.15);
    border-bottom: 1px solid rgba(14,165,233,0.15);
}

.header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(14,165,233,0.4) 20%, rgba(34,211,238,0.5) 50%, rgba(14,165,233,0.4) 80%, transparent);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    color: white;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    transition: opacity var(--transition);
}

.logo:hover { opacity: 0.85; }

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 0 12px rgba(14,165,233,0.3);
}

.logo-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
}

nav { display: flex; gap: 8px; }

nav a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition), background var(--transition);
    position: relative;
}

nav a:hover {
    color: white;
    background: rgba(14,165,233,0.12);
}

nav a.active {
    color: white;
    background: rgba(14,165,233,0.18);
    box-shadow: inset 0 0 12px rgba(14,165,233,0.08);
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 110;
}

.nav-toggle-bar {
    display: block;
    width: 24px;
    height: 2.5px;
    background: white;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}
.nav-toggle.open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}
.nav-toggle.open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* === Main content === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* === Hero section === */
.hero {
    text-align: center;
    padding: 48px 0 32px;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    background: linear-gradient(135deg, #e2e8f0 0%, #0ea5e9 35%, #22d3ee 65%, #e2e8f0 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    animation: shimmerText 6s ease-in-out infinite;
}

@keyframes shimmerText {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* === Cards === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.card:hover {
    border-color: rgba(14,165,233,0.3);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(14,165,233,0.15), rgba(34,211,238,0.1));
    border: 1px solid rgba(14,165,233,0.15);
}

/* === Form === */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group.full-width { grid-column: 1 / -1; }

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.form-group label .optional {
    font-weight: 400;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-elevated);
    color: var(--text);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.15), 0 0 16px rgba(14,165,233,0.08);
    background: var(--bg-card);
}

.form-group textarea { resize: vertical; min-height: 120px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 10px rgba(14,165,233,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(14,165,233,0.4), 0 2px 8px rgba(14,165,233,0.2);
}

.btn-primary:hover::before { opacity: 1; }

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(14,165,233,0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    border-color: rgba(14,165,233,0.25);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    box-shadow: 0 2px 8px rgba(239,68,68,0.25);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(239,68,68,0.35);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* === Result page === */
.result-header {
    text-align: center;
    padding: 32px 0;
}

.result-header h1 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

.gauge-container {
    display: flex;
    justify-content: center;
    margin: 24px 0;
}

.score-label {
    text-align: center;
    margin-top: 12px;
}

.score-value {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    letter-spacing: -0.5px;
}

.risk-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.score-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin: 24px 0;
}

.score-card {
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.score-card:hover {
    border-color: rgba(14,165,233,0.2);
    box-shadow: 0 0 16px var(--glow);
}

.score-card .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-card .value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 4px;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

/* Score mini-bar in score cards */
.score-mini-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    margin-top: 10px;
    overflow: hidden;
}

.score-mini-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Collapsible result sections === */
.collapsible-header {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.collapsible-header:hover {
    opacity: 0.85;
}

.section-toggle-icon {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.result-section .collapsible-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-section.open .collapsible-body {
    max-height: 5000px;
}

.result-section:not(.open) .section-toggle-icon {
    transform: rotate(-90deg);
}

/* === Risk factors === */
.factors-grid {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.factor-category {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.factor-category-header {
    padding: 14px 20px;
    background: var(--bg-elevated);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.factor-list { padding: 0; list-style: none; }

.factor-item {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.severity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.severity-info { background: #94a3b8; box-shadow: 0 0 6px rgba(148,163,184,0.3); }
.severity-low { background: #fbbf24; box-shadow: 0 0 6px rgba(251,191,36,0.35); }
.severity-medium { background: #f97316; box-shadow: 0 0 6px rgba(249,115,22,0.4); }
.severity-high { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,0.45); }
.severity-critical { background: #dc2626; box-shadow: 0 0 10px rgba(220,38,38,0.5); animation: pulseCritical 2s ease-in-out infinite; }

@keyframes pulseCritical {
    0%, 100% { box-shadow: 0 0 6px rgba(220,38,38,0.4); }
    50% { box-shadow: 0 0 12px rgba(220,38,38,0.7); }
}

.factor-text {
    font-size: 0.9rem;
    line-height: 1.5;
}

.factor-score {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Expanded factor items with explanations */
.factor-item-expanded {
    border-top: 1px solid var(--border);
}

.factor-header {
    padding: 12px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: background var(--transition);
}

.factor-header:hover {
    background: var(--bg-elevated);
}

.factor-expand-icon {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 8px;
    transition: transform 0.2s;
}

.factor-explanation {
    display: none;
    padding: 0 20px 16px 42px;
    animation: slideDown 0.2s ease-out;
}

.factor-explanation.expanded {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.explanation-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.explanation-text {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

[data-theme="light"] .explanation-text {
    background: #f0f9ff;
    border-left-color: var(--primary);
    color: #334155;
}

/* === Summary & Recommendations === */
.summary-box {
    background: var(--bg-elevated);
    border-radius: 10px;
    padding: 20px;
    margin: 16px 0;
    line-height: 1.7;
}

/* === LLM Analysis === */
.llm-analysis-box {
    background: var(--bg-elevated);
    border-radius: 10px;
    padding: 20px;
    margin: 16px 0;
    line-height: 1.7;
    border-left: 3px solid #a855f7;
    box-shadow: inset 0 0 20px rgba(168,85,247,0.03);
}

[data-theme="light"] .llm-analysis-box {
    background: #faf5ff;
    border-left-color: #a855f7;
    color: #334155;
}

/* === URL Intelligence === */
.intel-list { display: grid; gap: 16px; }

.intel-url {
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    color: var(--primary-light);
    word-break: break-all;
    margin-bottom: 4px;
}

.intel-domain {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.intel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.intel-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.85rem;
}

.intel-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.intel-detail {
    font-size: 0.78rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .intel-grid { grid-template-columns: 1fr; }
}

/* === History page === */
.history-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.history-toolbar .btn-sm {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.85rem;
}

.history-toolbar .btn-icon {
    font-size: 1rem;
}

.history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 16px;
    table-layout: fixed;
}

.history-table col.col-date    { width: 15%; }
.history-table col.col-sender  { width: 18%; }
.history-table col.col-subject { width: 32%; }
.history-table col.col-score   { width: 8%; }
.history-table col.col-risk    { width: 18%; }
.history-table col.col-actions { width: 9%; }

.history-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

.history-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-table .score-cell { font-weight: 700; }

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.pagination button:hover {
    background: var(--bg-elevated);
    border-color: rgba(14,165,233,0.3);
}
.pagination button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 10px rgba(14,165,233,0.3);
}
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* === About page === */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.about-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.about-card:hover {
    border-color: rgba(14,165,233,0.3);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.about-card h3 {
    font-size: 1.05rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

.about-card p, .about-card ul {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

.about-card ul {
    padding-left: 20px;
}

.weight-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--border);
    margin-top: 8px;
    overflow: hidden;
}

.weight-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(14,165,233,0.3);
}

/* === Pipeline Visualization (About page) === */
.pipeline-section {
    margin: 32px 0;
}

.section-title {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 8px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 32px;
}

.pipeline-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 20px 0;
    overflow-x: auto;
}

.pipeline-input,
.pipeline-output {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.pipeline-connector {
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--border), var(--primary), var(--border));
    position: relative;
}

.pipeline-connector::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid var(--primary);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

.pipeline-input .pipeline-connector::after { right: -6px; }
.pipeline-output .pipeline-connector::after { display: none; }
.pipeline-output .pipeline-connector::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(180deg);
    width: 0;
    height: 0;
    border-left: 8px solid var(--primary);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

.pipeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    background: var(--bg-card);
    min-width: 90px;
    transition: all var(--transition);
}

.pipeline-node-icon {
    font-size: 1.5rem;
}

.pipeline-node-label {
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    white-space: nowrap;
}

.pipeline-node-weight {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.pipeline-node-input {
    border-color: var(--primary);
    background: rgba(14,165,233,0.08);
}

.pipeline-node-output {
    border-color: var(--success);
    background: rgba(52,211,153,0.08);
}

.pipeline-layers {
    display: flex;
    gap: 12px;
    padding: 0 16px;
}

button.pipeline-layer {
    cursor: pointer;
    position: relative;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
}

.pipeline-layer .pipeline-node-layer {
    border-color: var(--border);
}

.pipeline-layer:hover .pipeline-node-layer {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.pipeline-layer.selected .pipeline-node-layer {
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(14,165,233,0.3), 0 0 40px rgba(14,165,233,0.1);
}

.layer-heuristic { border-color: var(--primary) !important; background: rgba(14,165,233,0.06); }
.layer-ml { border-color: var(--accent) !important; background: rgba(34,211,238,0.06); }
.layer-bert { border-color: #7c3aed !important; background: rgba(124,58,237,0.06); }
.layer-llm { border-color: #d97706 !important; background: rgba(217,119,6,0.06); }

.pipeline-layer.selected .layer-heuristic { box-shadow: 0 0 20px rgba(14,165,233,0.4); }
.pipeline-layer.selected .layer-ml { box-shadow: 0 0 20px rgba(34,211,238,0.4); }
.pipeline-layer.selected .layer-bert { box-shadow: 0 0 20px rgba(124,58,237,0.4); }
.pipeline-layer.selected .layer-llm { box-shadow: 0 0 20px rgba(217,119,6,0.4); }

/* Layer detail panels */
.layer-detail {
    display: none;
    margin-top: 24px;
    animation: fadeSlideIn 0.3s ease-out;
}

.layer-detail.active {
    display: block;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 2px;
}

.layer-detail-body {
    padding: 0 20px 20px;
}

/* ML stats grid */
.ml-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.ml-stat-card {
    text-align: center;
    padding: 20px 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.ml-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    color: var(--primary);
    text-shadow: 0 0 20px rgba(14,165,233,0.3);
}

.ml-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* BERT info grid */
.bert-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.bert-info-card {
    padding: 20px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.bert-info-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.bert-info-card h4 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

.bert-info-card p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

/* Score combination bar */
.combination-weights {
    margin-top: 16px;
}

.combination-bar {
    display: flex;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.combination-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    transition: all var(--transition);
}

.combination-segment:hover {
    filter: brightness(1.2);
}

.seg-heuristic { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.seg-ml { background: linear-gradient(135deg, #22d3ee, #06b6d4); }
.seg-bert { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.seg-llm { background: linear-gradient(135deg, #f59e0b, #d97706); }

.combination-labels {
    display: flex;
    margin-top: 8px;
}

.seg-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

.seg-heuristic-label { width: 30%; color: var(--primary); }
.seg-ml-label { width: 25%; color: var(--accent); }
.seg-bert-label { width: 20%; color: #8b5cf6; }
.seg-llm-label { width: 25%; color: #f59e0b; }

/* Risk levels grid */
.risk-levels-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.risk-level-item {
    text-align: center;
}

.risk-level-item p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* === Loading === */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5,10,21,0.7);
    z-index: 200;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.loading-overlay.active { display: flex; }

.loading-box {
    background: var(--bg-card);
    color: var(--text);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-right-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
    box-shadow: 0 0 16px rgba(14,165,233,0.15);
}

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

.loading-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.progress-bar-container {
    width: 100%;
    max-width: 280px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin: 0 auto 12px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: progressShimmer 1.5s ease-in-out infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.loading-step {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* === Empty state === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 16px; }

/* === Footer === */
.footer {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 48px;
    border-top: 1px solid var(--border);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(14,165,233,0.15), transparent);
}

.footer-links {
    margin-top: 8px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 8px;
    font-size: 0.8rem;
}

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

/* === Legal pages === */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.legal-content section {
    margin-bottom: 32px;
}

.legal-content h2 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--primary);
}

.legal-content ul {
    padding-left: 24px;
    margin: 8px 0;
}

.legal-content li {
    margin-bottom: 6px;
}

/* === Cookie consent banner === */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    font-size: 0.9rem;
}

.cookie-message {
    margin: 0;
    color: var(--text-secondary);
    flex: 1;
}

.cookie-message a {
    color: var(--primary);
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .cookie-banner {
        flex-direction: column;
        text-align: center;
        padding: 14px 16px;
    }
    .cookie-actions {
        width: 100%;
        justify-content: center;
    }
}

/* === Upload zones === */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.upload-zone:hover {
    border-color: var(--primary-light);
    background: rgba(14, 165, 233, 0.05);
    box-shadow: 0 0 15px var(--glow);
}

.upload-zone.drag-over {
    border-color: var(--primary);
    background: rgba(14, 165, 233, 0.1);
    box-shadow: 0 0 20px var(--glow);
}

.upload-zone.upload-success {
    border-color: var(--success);
    background: rgba(52, 211, 153, 0.08);
}

.upload-zone.upload-error {
    border-color: var(--danger);
    background: rgba(248, 113, 113, 0.08);
}

.upload-zone-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.upload-zone-text {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 4px;
}

.upload-zone-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.upload-status {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-elevated);
}

.upload-status-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.upload-file-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-cancel-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.upload-cancel-btn:hover { color: var(--danger); }

.upload-progress-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    overflow: hidden;
    margin-bottom: 8px;
}

.upload-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    width: 0%;
    transition: width 0.3s ease;
}

.upload-progress-fill.indeterminate {
    width: 30% !important;
    animation: indeterminate 1.2s ease-in-out infinite;
}

@keyframes indeterminate {
    0% { margin-left: 0; width: 30%; }
    50% { margin-left: 40%; width: 40%; }
    100% { margin-left: 70%; width: 30%; }
}

.upload-message {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.upload-message.success { color: var(--success); font-weight: 600; }
.upload-message.error { color: var(--danger); font-weight: 600; }

/* === Light mode upload overrides === */
[data-theme="light"] .upload-zone:hover {
    border-color: var(--primary-light);
    background: rgba(59, 130, 246, 0.04);
    box-shadow: none;
}
[data-theme="light"] .upload-zone.drag-over {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
    box-shadow: none;
}
[data-theme="light"] .upload-zone.upload-success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.06);
}
[data-theme="light"] .upload-zone.upload-error {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.06);
}

/* === Input Tabs === */
.tab-header {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    gap: 0;
}

.tab-btn {
    padding: 12px 20px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.active {
    color: var(--primary-light);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px 2px 0 0;
    box-shadow: 0 0 8px var(--glow);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 20px;
}

/* Light mode tabs */
[data-theme="light"] .tab-btn.active { color: var(--primary); }
[data-theme="light"] .tab-btn.active::after { background: var(--primary); }

/* === Responsive === */
@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .score-breakdown { grid-template-columns: 1fr; }
    .about-grid { grid-template-columns: 1fr; }
    .pipeline-flow { flex-direction: column; gap: 8px; }
    .pipeline-layers { flex-direction: column; gap: 8px; padding: 0; }
    .pipeline-connector { width: 3px; height: 30px; }
    .pipeline-connector::after { display: none; }
    .pipeline-connector::before { display: none; }
    .pipeline-input, .pipeline-output { flex-direction: column; }
    .ml-stats-grid { grid-template-columns: 1fr 1fr; }
    .bert-info-grid { grid-template-columns: 1fr; }
    .risk-levels-grid { grid-template-columns: repeat(3, 1fr); }
    .combination-segment span { font-size: 0.65rem; }
    .header-inner { padding: 0 16px; flex-wrap: wrap; height: auto; min-height: 64px; }
    .nav-toggle { display: flex; }
    nav {
        display: none;
        flex-direction: column;
        width: 100%;
        order: 10;
        padding: 8px 0 12px;
        gap: 2px;
    }
    nav.open { display: flex; }
    nav a { padding: 10px 16px; font-size: 0.9rem; border-radius: 8px; }
    .hero h1 { font-size: 1.6rem; }
    .container { padding: 20px 16px; }
    .tab-header { gap: 0; }
    .tab-btn { padding: 10px 12px; font-size: 0.82rem; }
    .lang-selector { height: 34px; font-size: 0.8rem; padding: 0 8px; padding-right: 22px; }
    .theme-toggle { width: 34px; height: 34px; font-size: 1rem; }
}

/* === Auth Pages === */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.88rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* === Header Auth Controls === */
#auth-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-nav-item {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.auth-nav-item:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.9);
    font-size: 0.82rem;
    font-weight: 500;
    max-width: 180px;
    padding: 4px 12px 4px 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
}

.user-badge:hover {
    background: rgba(255,255,255,0.15);
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-initial {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 0 8px rgba(14,165,233,0.3);
}

.user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

.auth-logout-btn {
    padding: 6px 14px !important;
    font-size: 0.82rem !important;
    background: rgba(255,255,255,0.1) !important;
    color: white !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
}

.auth-logout-btn:hover {
    background: rgba(255,255,255,0.2) !important;
}

.auth-register-btn {
    padding: 6px 14px !important;
    font-size: 0.82rem !important;
}

/* === Guest Limit Prompt Overlay === */
.guest-prompt-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(5,10,21,0.7);
    z-index: 250;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.guest-prompt-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.guest-prompt-box h2 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

.guest-prompt-box p {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

.guest-prompt-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* === Admin Panel === */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

/* === Admin Reports Section === */
.admin-reports-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.report-stat-card {
    background: linear-gradient(145deg, var(--bg-card), var(--bg-elevated));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.report-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-color, var(--primary));
}

.report-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--stat-color, var(--primary));
}

.report-stat-card.stat-total { --stat-color: var(--primary); }
.report-stat-card.stat-pending { --stat-color: var(--warning); }
.report-stat-card.stat-review { --stat-color: var(--danger); }
.report-stat-card.stat-confirmed { --stat-color: var(--success); }

.report-stat-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
    opacity: 0.9;
}

.report-stat-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    color: var(--stat-color, var(--primary));
    line-height: 1.2;
}

.report-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Report Filter Toggle */
.report-filter-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.report-filter-toggle:hover {
    border-color: var(--primary);
    background: var(--bg-card);
}

.report-filter-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.report-filter-toggle span {
    color: var(--text);
    font-size: 0.9rem;
}

/* Report Cards */
.report-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    transition: var(--transition);
    position: relative;
}

.report-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow), 0 0 20px var(--glow);
}

.report-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.report-url-section {
    flex: 1;
    min-width: 0;
}

.report-url-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.report-url-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--danger);
    word-break: break-all;
    background: rgba(248, 113, 113, 0.1);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.report-meta {
    text-align: right;
    flex-shrink: 0;
}

.report-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.report-admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.report-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.report-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.report-detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-detail-value {
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.report-reason-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.report-reason-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.report-reason-text {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.5;
}

.report-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.btn-approve {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-approve:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.3);
}

.btn-reject {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-reject:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(248, 113, 113, 0.3);
}

/* Votes Progress */
.votes-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.votes-bar {
    flex: 1;
    max-width: 80px;
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 3px;
    overflow: hidden;
}

.votes-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.votes-text {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Score Indicator in Reports */
.report-score {
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-score-value {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Empty state for reports */
.reports-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.reports-empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.reports-empty-text {
    color: var(--text-muted);
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .admin-reports-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .report-card-header {
        flex-direction: column;
    }

    .report-meta {
        text-align: left;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .report-details {
        grid-template-columns: repeat(2, 1fr);
    }

    .report-actions {
        flex-direction: column;
    }

    .btn-approve, .btn-reject {
        width: 100%;
        justify-content: center;
    }
}

/* === Responsive auth === */
@media (max-width: 768px) {
    #auth-controls {
        gap: 4px;
    }
    .user-badge {
        max-width: 100px;
        font-size: 0.75rem;
    }
    .auth-nav-item {
        font-size: 0.78rem;
        padding: 4px 8px;
    }
    .auth-logout-btn, .auth-register-btn {
        padding: 4px 10px !important;
        font-size: 0.75rem !important;
    }
    .guest-prompt-box {
        padding: 24px;
    }
    .guest-prompt-actions {
        flex-direction: column;
    }
}

/* === Landing Page === */
.landing-hero {
    text-align: center;
    padding: 72px 20px 48px;
}

.landing-hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    background: linear-gradient(135deg, #e2e8f0 0%, #0ea5e9 30%, #22d3ee 55%, #34d399 80%, #e2e8f0 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    line-height: 1.2;
    animation: shimmerText 6s ease-in-out infinite;
}

.landing-hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.landing-hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-lg {
    padding: 14px 36px;
    font-size: 1.05rem;
}

.landing-section {
    padding: 48px 0;
}

.landing-section-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    margin-bottom: 36px;
    color: var(--text);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    position: relative;
    overflow: hidden;
}

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

.feature-card:hover {
    border-color: rgba(14,165,233,0.35);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

.feature-card:hover::before { opacity: 1; }

.feature-icon {
    font-size: 1.8rem;
    margin-bottom: 14px;
    filter: drop-shadow(0 0 8px var(--glow));
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    margin-bottom: 8px;
    color: var(--text);
}

.feature-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Steps Section */
.steps-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.step-card {
    text-align: center;
    padding: 32px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.step-card:hover {
    border-color: rgba(14,165,233,0.3);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(14,165,233,0.3);
}

.step-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    margin-bottom: 8px;
    color: var(--text);
}

.step-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 48px;
    padding: 36px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 16px 0 48px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    color: var(--primary-light);
    text-shadow: 0 0 20px var(--glow);
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Landing CTA */
.landing-cta {
    text-align: center;
    padding: 56px 20px;
    border-top: 1px solid var(--border);
}

.landing-cta h2 {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    margin-bottom: 12px;
    color: var(--text);
}

.landing-cta p {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* Light mode landing overrides */
[data-theme="light"] .landing-hero-title {
    color: #0f172a;
    background: linear-gradient(135deg, #0f172a 0%, #1a56db 30%, #06b6d4 55%, #10b981 80%, #0f172a 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerText 6s ease-in-out infinite;
}

[data-theme="light"] .feature-card { background: white; }
[data-theme="light"] .step-card { background: white; }
[data-theme="light"] .stats-bar { background: white; }

[data-theme="light"] .stat-value { color: var(--primary); }

/* Landing responsive */
@media (max-width: 768px) {
    .landing-hero { padding: 48px 16px 32px; }
    .landing-hero-title { font-size: 1.8rem; }
    .landing-hero-subtitle { font-size: 1rem; }
    .features-grid { grid-template-columns: 1fr; }
    .steps-section { grid-template-columns: 1fr; }
    .stats-bar { flex-wrap: wrap; gap: 24px; }
    .stat-item { min-width: 80px; }
    .landing-cta { padding: 40px 16px; }
    .landing-cta h2 { font-size: 1.3rem; }
}

/* === FAQ Section === */
.faq-section,
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-section-title {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 1.1rem;
    color: var(--primary);
    margin: 28px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.faq-section-title:first-of-type {
    margin-top: 0;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(14,165,233,0.3);
}

.faq-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--glow);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
    gap: 16px;
}

.faq-question:hover {
    background: var(--bg-elevated);
}

.faq-question-text {
    flex: 1;
}

.faq-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--primary);
    transition: transform 0.3s ease, background 0.3s ease;
    flex-shrink: 0;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
    background: var(--primary);
    color: white;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer-content {
    padding: 0 24px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

.faq-answer-content a {
    color: var(--primary);
    text-decoration: none;
}

.faq-answer-content a:hover {
    text-decoration: underline;
}

.faq-answer-content ul {
    margin: 12px 0;
    padding-left: 20px;
}

.faq-answer-content li {
    margin-bottom: 6px;
}

/* Light mode FAQ */
[data-theme="light"] .faq-item { background: white; }
[data-theme="light"] .faq-question:hover { background: #f8fafc; }
[data-theme="light"] .faq-icon { background: #f1f5f9; }

/* === Animations === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Staggered entry for grids */
.feature-card:nth-child(1) { animation-delay: 0.05s; }
.feature-card:nth-child(2) { animation-delay: 0.1s; }
.feature-card:nth-child(3) { animation-delay: 0.15s; }
.step-card:nth-child(1) { animation-delay: 0.05s; }
.step-card:nth-child(2) { animation-delay: 0.1s; }
.step-card:nth-child(3) { animation-delay: 0.15s; }

/* === Error Page === */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
    padding: 40px 20px;
}

.error-icon {
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.6;
}

.error-code {
    font-size: 5rem;
    font-weight: 800;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--text-muted) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 8px;
}

.error-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.error-message {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 480px;
    margin-bottom: 32px;
    line-height: 1.6;
}

.error-home-btn {
    padding: 12px 32px;
    font-size: 1rem;
}

/* === Mobile Responsive (480px and below) === */
@media (max-width: 480px) {
    /* Header */
    .header-inner { padding: 0 12px; min-height: 56px; }
    .logo { font-size: 1.15rem; gap: 6px; }
    .logo-img { width: 28px; height: 28px; }
    nav a { padding: 10px 12px; font-size: 0.85rem; }
    .header-controls { gap: 4px; }
    .lang-selector { height: 30px; font-size: 0.72rem; padding: 0 6px; padding-right: 20px; }
    .theme-toggle { width: 30px; height: 30px; font-size: 0.9rem; }

    /* Auth controls */
    #auth-controls { gap: 2px; }
    .user-badge .user-name { display: none; }
    .auth-nav-item { font-size: 0.7rem; padding: 3px 6px; }
    .auth-logout-btn, .auth-register-btn { padding: 3px 8px !important; font-size: 0.7rem !important; }

    /* Main container */
    .container { padding: 16px 12px; }
    .hero h1 { font-size: 1.3rem; }
    .hero p { font-size: 0.88rem; }

    /* Upload zones */
    .upload-zone { padding: 20px 12px; }
    .upload-zone h3 { font-size: 0.95rem; }
    .upload-zone p { font-size: 0.8rem; }

    /* Tabs */
    .tab-btn { padding: 8px 8px; font-size: 0.75rem; }

    /* Score breakdown */
    .score-circle { width: 100px; height: 100px; }

    /* History table */
    .history-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Admin */
    .admin-stats { grid-template-columns: 1fr; }
    .admin-reports-stats { grid-template-columns: 1fr 1fr; }

    /* Buttons - touch friendly */
    .btn { min-height: 44px; }

    /* Landing page */
    .landing-hero { padding: 32px 12px 24px; }
    .landing-hero-title { font-size: 1.5rem; }
    .landing-hero-subtitle { font-size: 0.9rem; }
    .landing-hero-actions { flex-direction: column; align-items: center; }
    .btn-lg { padding: 12px 28px; font-size: 0.95rem; width: 100%; text-align: center; }
    .features-grid { grid-template-columns: 1fr; gap: 12px; }
    .feature-card { padding: 20px; }
    .steps-section { grid-template-columns: 1fr; gap: 16px; }
    .step-card { padding: 24px 16px; }
    .stats-bar { flex-direction: column; gap: 16px; padding: 24px 16px; }
    .landing-cta { padding: 32px 12px; }
    .landing-cta h2 { font-size: 1.2rem; }
    .landing-section-title { font-size: 1.3rem; }

    /* FAQ */
    .faq-question { padding: 14px 16px; font-size: 0.88rem; }
    .faq-answer-content { padding: 0 16px 16px; }

    /* Auth pages */
    .auth-page { padding: 24px 12px; }
    .auth-card { max-width: 100%; }
    .auth-card h1 { font-size: 1.3rem; }

    /* Guest prompt */
    .guest-prompt-box { padding: 20px 16px; }
    .guest-prompt-actions { flex-direction: column; }

    /* Error page */
    .error-code { font-size: 3.5rem; }
    .error-title { font-size: 1.2rem; }
}

/* === Skeleton loading === */
@keyframes skeleton-pulse {
    0% { opacity: 0.4; }
    50% { opacity: 0.8; }
    100% { opacity: 0.4; }
}

.skeleton {
    background: var(--border);
    border-radius: 6px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-line {
    height: 14px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.long { width: 90%; }

.skeleton-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 16px;
}

.skeleton-row {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.skeleton-cell {
    height: 40px;
    border-radius: 6px;
    flex: 1;
}

.skeleton-card {
    padding: 20px;
    border-radius: var(--radius);
    background: var(--card-bg);
    border: 1px solid var(--border);
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .skeleton-grid { grid-template-columns: repeat(2, 1fr); }
}
