/* ═══════════════════════════════════════════════════════════
   FairAI Pro — Design System & Styles
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    /* Colors — Dark Theme */
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-tertiary: #16161f;
    --bg-card: rgba(22, 22, 35, 0.7);
    --bg-card-hover: rgba(30, 30, 48, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);

    --border-primary: rgba(255, 255, 255, 0.06);
    --border-secondary: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(108, 92, 231, 0.3);

    --text-primary: #f0f0f5;
    --text-secondary: #9595a8;
    --text-tertiary: #5e5e72;
    --text-muted: #44445a;

    /* Accent Colors */
    --accent-purple: #6C5CE7;
    --accent-purple-light: #a29bfe;
    --accent-blue: #00D2FF;
    --accent-cyan: #00E5CC;
    --accent-green: #00E676;
    --accent-yellow: #FFD93D;
    --accent-orange: #FF9F43;
    --accent-red: #FF6B6B;
    --accent-pink: #FD79A8;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6C5CE7, #00D2FF);
    --gradient-secondary: linear-gradient(135deg, #a29bfe, #6C5CE7);
    --gradient-success: linear-gradient(135deg, #00E676, #00D2FF);
    --gradient-warning: linear-gradient(135deg, #FFD93D, #FF9F43);
    --gradient-danger: linear-gradient(135deg, #FF6B6B, #FD79A8);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow-purple: 0 0 30px rgba(108, 92, 231, 0.15);
    --shadow-glow-blue: 0 0 30px rgba(0, 210, 255, 0.15);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --section-padding: 100px 0;
    --container-width: 1200px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

::selection {
    background: rgba(108, 92, 231, 0.3);
    color: var(--text-primary);
}

/* ── Background Effects ────────────────────────────────────── */
.bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
}

.bg-orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.15), transparent 70%);
    top: -200px;
    left: -200px;
    animation: float-orb 20s ease-in-out infinite;
}

.bg-orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.1), transparent 70%);
    top: 40%;
    right: -150px;
    animation: float-orb 25s ease-in-out infinite reverse;
}

.bg-orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 229, 204, 0.08), transparent 70%);
    bottom: -100px;
    left: 30%;
    animation: float-orb 22s ease-in-out infinite;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 60px 60px;
}

@keyframes float-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(40px, 30px) scale(1.05); }
}

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 24px;
    transition: var(--transition-base);
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-primary);
}

.navbar.scrolled {
    background: rgba(10, 10, 15, 0.9);
    border-bottom: 1px solid var(--border-secondary);
}

.nav-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-accent {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}

.nav-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-glass);
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid var(--border-primary);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(0, 230, 118, 0); }
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 60px;
    gap: 60px;
    max-width: var(--container-width);
    margin: 0 auto;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 100px;
    border: 1px solid var(--border-accent);
    background: rgba(108, 92, 231, 0.08);
    color: var(--accent-purple-light);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-2 {
    background: var(--gradient-success);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 48px;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    animation: fadeInUp 0.6s ease 0.4s both;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hero-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.hero-stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-stat-divider {
    width: 1px;
    height: 36px;
    background: var(--border-secondary);
}

/* Hero Visual — Code Card */
.hero-visual {
    flex: 1;
    max-width: 480px;
    animation: fadeInUp 0.8s ease 0.3s both;
}

.hero-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg), var(--shadow-glow-purple);
}

.hero-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-glass);
}

.hero-card-dots {
    display: flex;
    gap: 6px;
}

.hero-card-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.hero-card-dots span:nth-child(1) { background: #FF5F57; }
.hero-card-dots span:nth-child(2) { background: #FEBC2E; }
.hero-card-dots span:nth-child(3) { background: #28CA41; }

.hero-card-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.hero-card-code {
    padding: 24px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--text-secondary);
    overflow-x: auto;
}

.json-key { color: var(--accent-purple-light); }
.json-val { color: var(--accent-blue); }
.json-val-green { color: var(--accent-green); }
.json-str { color: var(--accent-yellow); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(108, 92, 231, 0.4);
}

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

.btn-secondary:hover {
    border-color: var(--accent-purple);
    background: rgba(108, 92, 231, 0.1);
}

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

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--text-tertiary);
    background: var(--bg-glass);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-primary);
    background: var(--bg-glass);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

/* ── Sections ──────────────────────────────────────────────── */
.section {
    position: relative;
    z-index: 1;
    padding: var(--section-padding);
}

.section-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

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

.section-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 100px;
    border: 1px solid var(--border-accent);
    background: rgba(108, 92, 231, 0.08);
    color: var(--accent-purple-light);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 560px;
    margin: 0 auto;
}

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

.step-card {
    position: relative;
    padding: 32px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    overflow: hidden;
}

.step-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), transparent, rgba(0, 210, 255, 0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.step-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow-purple);
}

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

.step-number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-purple-light);
    margin-bottom: 16px;
    opacity: 0.6;
}

.step-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: rgba(108, 92, 231, 0.1);
    border: 1px solid rgba(108, 92, 231, 0.15);
    color: var(--accent-purple-light);
    margin-bottom: 20px;
}

.step-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

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

/* ── Upload Panel ──────────────────────────────────────────── */
.analysis-container {
    max-width: 720px;
    margin: 0 auto;
}

.upload-panel, .config-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: 32px;
    backdrop-filter: blur(10px);
}

.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    border: 2px dashed var(--border-secondary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: center;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent-purple);
    background: rgba(108, 92, 231, 0.05);
}

.upload-zone.dragover {
    transform: scale(1.02);
}

.upload-icon {
    color: var(--accent-purple-light);
    margin-bottom: 16px;
    opacity: 0.7;
}

.upload-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.upload-desc {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.upload-formats {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 100px;
    background: var(--bg-glass);
}

.upload-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
}

.upload-divider::before,
.upload-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-primary);
}

/* ── Config Panel ──────────────────────────────────────────── */
.config-panel {
    animation: fadeInUp 0.4s ease;
}

.config-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: 24px;
}

.config-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--accent-purple-light);
}

.config-filename {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.config-rows {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.config-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Data Preview Table */
.data-preview-container {
    margin-bottom: 28px;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.table-wrapper th {
    padding: 10px 14px;
    text-align: left;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.7rem;
    white-space: nowrap;
}

.table-wrapper td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    white-space: nowrap;
}

.table-wrapper tr:last-child td {
    border-bottom: none;
}

.table-wrapper tr:hover td {
    background: var(--bg-glass);
}

/* Form */
.config-form {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-primary);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

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

.form-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-secondary);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239595a8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.form-select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.btn-analyze {
    padding: 14px 24px;
    font-size: 1rem;
    margin-top: 8px;
}

/* ── Loading Overlay ───────────────────────────────────────── */
.loading-overlay {
    text-align: center;
    padding: 60px 24px;
    max-width: 420px;
    margin: 0 auto;
    animation: fadeInUp 0.4s ease;
}

.loading-spinner {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
}

.spinner-ring {
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring-2 {
    inset: 8px;
    border-top-color: var(--accent-blue);
    animation-direction: reverse;
    animation-duration: 0.8s;
}

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

.loading-content h3 {
    font-size: 1.25rem;
    margin-bottom: 6px;
}

.loading-content p {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    margin-bottom: 28px;
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color var(--transition-base);
}

.loading-step.active {
    color: var(--text-secondary);
}

.loading-step.done {
    color: var(--accent-green);
}

.ls-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.loading-step.active .ls-dot {
    background: var(--accent-purple);
    animation: pulse-dot 1s ease-in-out infinite;
}

.loading-step.done .ls-dot {
    background: var(--accent-green);
}

/* ── Results Dashboard ─────────────────────────────────────── */
.results-dashboard {
    animation: fadeInUp 0.6s ease;
}

/* Score Hero */
.score-hero {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    margin-bottom: 24px;
    overflow: hidden;
    position: relative;
}

.score-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    opacity: 0.15;
}

.score-hero.score-green::before { background: var(--accent-green); }
.score-hero.score-yellow::before { background: var(--accent-yellow); }
.score-hero.score-red::before { background: var(--accent-red); }

.score-ring-container {
    position: relative;
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.score-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring-bg {
    fill: none;
    stroke: var(--border-primary);
    stroke-width: 8;
}

.score-ring-fill {
    fill: none;
    stroke: url(#score-gradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 534;
    stroke-dashoffset: 534;
    transition: stroke-dashoffset 1.5s ease-in-out;
}

.score-value-wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-value {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
}

.score-label-small {
    font-size: 1rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.score-info {
    flex: 1;
}

.score-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

.score-badge.badge-green {
    background: rgba(0, 230, 118, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(0, 230, 118, 0.2);
}

.score-badge.badge-yellow {
    background: rgba(255, 217, 61, 0.12);
    color: var(--accent-yellow);
    border: 1px solid rgba(255, 217, 61, 0.2);
}

.score-badge.badge-red {
    background: rgba(255, 107, 107, 0.12);
    color: var(--accent-red);
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.score-headline {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.score-direction {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.metric-card {
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    transition: var(--transition-base);
}

.metric-card:hover {
    border-color: var(--border-secondary);
}

.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

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

.metric-tag {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 100px;
    background: var(--bg-glass);
    color: var(--text-tertiary);
    border: 1px solid var(--border-primary);
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--font-mono);
    letter-spacing: -0.02em;
    margin: 8px 0 16px;
}

.metric-value.val-fair { color: var(--accent-green); }
.metric-value.val-warn { color: var(--accent-yellow); }
.metric-value.val-danger { color: var(--accent-red); }

.metric-bar-wrap {
    margin-bottom: 16px;
}

.metric-bar {
    position: relative;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    margin-bottom: 6px;
    overflow: visible;
}

.metric-bar-fair {
    position: absolute;
    top: 0;
    left: 40%;
    width: 20%;
    height: 100%;
    background: rgba(0, 230, 118, 0.2);
    border-radius: 3px;
}

.metric-bar-fair-dir {
    position: absolute;
    top: 0;
    left: 40%;
    width: 22.5%;
    height: 100%;
    background: rgba(0, 230, 118, 0.2);
    border-radius: 3px;
}

.metric-bar-marker {
    position: absolute;
    top: -5px;
    width: 4px;
    height: 16px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: left 1s ease-in-out;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.metric-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.metric-desc {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

/* Comparison Card */
.comparison-card, .detail-card, .feature-card {
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: -12px;
    margin-bottom: 20px;
}

.comparison-bars {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comparison-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.comparison-label {
    width: 140px;
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 600;
}

.comparison-label .sub-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.comparison-bar-track {
    flex: 1;
    height: 28px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.comparison-bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    transition: width 1s ease-in-out;
    display: flex;
    align-items: center;
    padding-left: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    min-width: fit-content;
}

.comparison-bar-fill.bar-privileged {
    background: var(--gradient-primary);
}

.comparison-bar-fill.bar-unprivileged {
    background: var(--gradient-warning);
}

.comparison-percent {
    width: 60px;
    text-align: right;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

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

.perf-item {
    padding: 16px;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
}

.perf-item-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.perf-item-value {
    font-size: 1.4rem;
    font-weight: 800;
    font-family: var(--font-mono);
}

/* Group Table */
.group-table-wrap table {
    width: 100%;
    border-collapse: collapse;
}

.group-table-wrap th {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-primary);
}

.group-table-wrap td {
    padding: 10px 12px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-primary);
    font-family: var(--font-mono);
}

.group-table-wrap tr:last-child td {
    border-bottom: none;
}

.group-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: var(--font-primary);
}

.group-tag.tag-priv {
    background: rgba(108, 92, 231, 0.12);
    color: var(--accent-purple-light);
}

.group-tag.tag-unpriv {
    background: rgba(255, 159, 67, 0.12);
    color: var(--accent-orange);
}

/* Feature Bars */
.feature-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feature-name {
    width: 140px;
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.feature-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.feature-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
    background: var(--gradient-primary);
}

.feature-bar-fill.negative {
    background: var(--gradient-warning);
}

.feature-val {
    width: 50px;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* Recommendations Card */
.recommendations-card {
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.mitigation-scores-card {
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.mitigation-score-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.mitigation-score-item {
    padding: 16px;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
}

.mitigation-score-label {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    font-weight: 600;
}

.mitigation-score-value {
    font-size: 1.9rem;
    font-family: var(--font-mono);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.mitigation-red { color: var(--accent-red); }
.mitigation-yellow { color: var(--accent-yellow); }
.mitigation-green { color: var(--accent-green); }

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rec-item {
    display: flex;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
    background: var(--bg-glass);
    transition: var(--transition-base);
}

.rec-item:hover {
    border-color: var(--border-secondary);
    background: var(--bg-glass-hover);
}

.rec-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    font-size: 1.1rem;
}

.rec-icon.rec-critical {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.15);
}

.rec-icon.rec-warning {
    background: rgba(255, 217, 61, 0.1);
    border: 1px solid rgba(255, 217, 61, 0.15);
}

.rec-icon.rec-info {
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.15);
}

.rec-icon.rec-success {
    background: rgba(0, 230, 118, 0.1);
    border: 1px solid rgba(0, 230, 118, 0.15);
}

.rec-content {
    flex: 1;
}

.rec-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.rec-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.rec-severity {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: 8px;
    vertical-align: middle;
}

.rec-severity.sev-critical {
    background: rgba(255, 107, 107, 0.12);
    color: var(--accent-red);
}

.rec-severity.sev-warning {
    background: rgba(255, 217, 61, 0.12);
    color: var(--accent-yellow);
}

.rec-severity.sev-info {
    background: rgba(0, 210, 255, 0.12);
    color: var(--accent-blue);
}

/* Results Footer */
.results-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border-primary);
    padding: 40px 24px;
}

.footer-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-logo p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.footer-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-dot {
    color: var(--text-muted);
}

/* ── Toast ─────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    min-width: 280px;
    backdrop-filter: blur(10px);
}

.toast.toast-error {
    border-color: rgba(255, 107, 107, 0.3);
    background: rgba(255, 107, 107, 0.08);
}

.toast.toast-success {
    border-color: rgba(0, 230, 118, 0.3);
    background: rgba(0, 230, 118, 0.08);
}

.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* AI Explanation Card */
.explanation-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-top: 24px;
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.6s ease;
}

.explanation-content {
    margin-top: 16px;
    min-height: 100px;
    position: relative;
    color: var(--text-secondary);
}

.explanation-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.explanation-list li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.explanation-list li::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: var(--accent-purple-light);
    font-size: 1.5rem;
    line-height: 1;
    top: -2px;
}

.explanation-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    color: var(--text-tertiary);
}

.mini-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(108, 92, 231, 0.1);
    border-top: 3px solid var(--accent-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.explanation-error {
    color: var(--accent-red);
    text-align: center;
    padding: 20px;
    background: rgba(255, 107, 107, 0.05);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 107, 107, 0.1);
}

/* ── Utilities ─────────────────────────────────────────────── */
.hidden {
    display: none !important;
}

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

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 120px;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-visual {
        max-width: 100%;
    }

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

    .details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 60px 0;
    }

    .nav-links {
        display: none;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .mitigation-score-grid {
        grid-template-columns: 1fr;
    }

    .score-hero {
        flex-direction: column;
        text-align: center;
    }

    .hero-stats {
        flex-direction: column;
        gap: 16px;
    }

    .hero-stat-divider {
        width: 40px;
        height: 1px;
    }

    .comparison-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .comparison-label {
        width: 100%;
    }

    .comparison-bar-track {
        width: 100%;
    }

    .comparison-percent {
        width: auto;
    }

    .footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}
