:root {
    --bg: #020617;
    --surface: #0f172a;
    --surface-light: #1e293b;
    --gold: #FFD700;
    --gold-dark: #B8860B;
    --cyan: #00F2FF;
    --cyan-dark: #0891b2;
    --text: #f1f5f9;
    --text-dim: #94a3b8;
    --glass-bg: rgba(15, 23, 42, 0.75);
    --glass-border: rgba(6, 182, 212, 0.25);
    --gold-border: rgba(255, 215, 0, 0.25);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

h1, h2, h3, h4, .logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.gold { color: var(--gold); }
.cyan { color: var(--cyan); }
.dim { color: var(--text-dim); }

.gold-gradient {
    background: linear-gradient(90deg, var(--gold), #FFF 60%, var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Background Cyber-effects */
.cyber-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.cyber-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
}

.glow-orb {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.12;
}

.orb-gold {
    top: -200px;
    left: -200px;
    background: var(--gold);
}

.orb-cyan {
    bottom: 200px;
    right: -200px;
    background: var(--cyan);
}

/* Navbar */
#navbar {
    height: 80px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

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

.logo {
    font-size: 1.5rem;
    letter-spacing: 2px;
    font-weight: 800;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dim);
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.95rem;
}

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

/* Buttons */
.btn {
    padding: 0.8rem 1.6rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--cyan);
    color: #020617;
    box-shadow: 0 4px 15px rgba(0, 242, 255, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 242, 255, 0.4);
    background: #FFF;
}

.btn-gold {
    background: linear-gradient(45deg, var(--gold), var(--gold-dark));
    color: #020617;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.25);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    background: #FFF;
}

.btn-outline {
    border: 1px solid var(--glass-border);
    color: var(--text);
    background: rgba(255, 255, 255, 0.02);
}

.btn-outline:hover {
    background: rgba(0, 242, 255, 0.08);
    border-color: var(--cyan);
}

/* Hero Section */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-image: url('assets/hero_bg.png');
    background-size: cover;
    background-position: center;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 20%, var(--bg) 95%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 850px;
}

.badge {
    background: rgba(6, 182, 212, 0.08);
    color: var(--cyan);
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.pulse-cyan {
    color: var(--cyan);
    animation: blink-anim 1.5s infinite alternate;
}

@keyframes blink-anim {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

h1 {
    font-size: 3.5rem;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

#hero p {
    font-size: 1.25rem;
    color: var(--text-dim);
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

/* Stats */
#stats {
    padding: 4rem 0;
    background: var(--surface);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.stat-card {
    text-align: center;
    background: rgba(2, 6, 23, 0.4);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.stat-card h2 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.stat-card p {
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.stat-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    max-width: 150px;
    margin: 0 auto;
}

.stat-progress {
    height: 100%;
    background: var(--gold);
}

.stat-progress.bg-cyan {
    background: var(--cyan);
}

/* Features */
#features {
    padding: 7rem 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 800;
}

.section-subtitle {
    text-align: center;
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto 4rem auto;
    font-size: 1.1rem;
}

.feature-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 215, 0, 0.1);
    color: var(--gold);
    border: 1px solid var(--gold-border);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.feature-badge.badge-cyan {
    background: rgba(0, 242, 255, 0.1);
    color: var(--cyan);
    border-color: var(--glass-border);
}

.feature-badge.badge-gold {
    background: rgba(255, 215, 0, 0.1);
    color: var(--gold);
    border-color: var(--gold-border);
}

.feature-card {
    background: var(--surface);
    padding: 3rem 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(6, 182, 212, 0.03));
    opacity: 0;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 242, 255, 0.05);
}

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

.icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.feature-card p {
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* XAI Simulator Section */
#xai-simulator {
    padding: 6rem 0;
    background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.simulator-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2.5rem;
    margin-top: 2rem;
}

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

.simulator-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.sim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.8rem;
}

.sim-header h4 {
    font-size: 1.15rem;
    color: #FFF;
}

.sim-status {
    background: rgba(0, 242, 255, 0.1);
    color: var(--cyan);
    border: 1px solid var(--glass-border);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
}

.sim-desc {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* Slider Viewport */
.slider-viewport {
    position: relative;
    width: 100%;
    height: 250px;
    background: #020617;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.car-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.car-svg-container {
    width: 85%;
    max-width: 480px;
    height: auto;
}

.car-svg {
    width: 100%;
    height: auto;
}

.layer-healthy {
    z-index: 1;
}

.layer-laplacian {
    z-index: 2;
    clip-path: inset(0 0 0 50%); /* Javascript will manipulate this */
    background: radial-gradient(circle at center, #001a1d, #020617 80%);
}

.layer-label {
    position: absolute;
    bottom: 10px;
    padding: 0.2rem 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    z-index: 5;
}

.label-left {
    left: 10px;
    color: var(--text-dim);
}

.label-right {
    right: 10px;
    color: var(--cyan);
    border: 1px solid var(--glass-border);
}

/* Slider control overlays */
.slider-control {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: ew-resize;
    z-index: 10;
}

.slider-handle-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%; /* Javascript will move this */
    width: 2px;
    background: var(--cyan);
    box-shadow: 0 0 10px var(--cyan);
    z-index: 8;
    pointer-events: none;
}

.slider-handle-line::after {
    content: '↔';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: var(--cyan);
    color: #020617;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
}

.anomaly-box {
    animation: box-glow 2s infinite alternate;
}

@keyframes box-glow {
    0% { stroke: #FFD700; fill: rgba(255, 0, 0, 0.1); }
    100% { stroke: #FF0055; fill: rgba(255, 0, 85, 0.25); }
}

/* Acoustic Panel styling */
.audio-controls-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding: 0.75rem 1rem;
    background: rgba(2, 6, 23, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: var(--transition);
}

.radio-option:hover {
    background: rgba(255, 255, 255, 0.02);
}

.radio-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.custom-radio {
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-dim);
    border-radius: 50%;
    margin-right: 12px;
    display: inline-block;
    position: relative;
}

.radio-option input:checked ~ .custom-radio {
    border-color: var(--cyan);
}

.radio-option input:checked ~ .custom-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--cyan);
    border-radius: 50%;
}

.radio-text {
    font-size: 0.95rem;
    font-weight: 500;
}

.red-label {
    color: #ff5555;
}

/* Audio Spectrogram Canvas */
.canvas-container {
    position: relative;
    width: 100%;
    height: 200px;
    background: #040815;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#spectrogram-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.ai-classification-hud {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(4, 8, 21, 0.85);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 6px;
    padding: 0.6rem 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-dim);
    z-index: 5;
    pointer-events: none;
}

.hud-prediction {
    margin: 0.25rem 0;
    font-weight: bold;
}

.hud-verdict {
    color: var(--cyan);
    font-weight: bold;
}

/* Blockchain (VeraChain Ledger) */
#blockchain {
    padding: 8rem 0;
    background: radial-gradient(circle at center, #001317 0%, var(--bg) 80%);
}

.blockchain-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.15fr;
    gap: 3.5rem;
    align-items: center;
}

@media (max-width: 992px) {
    .blockchain-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

.blockchain-intro h2 {
    font-size: 2.5rem;
    margin: 1.5rem 0;
}

.blockchain-intro p {
    color: var(--text-dim);
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
}

.badge-cyan {
    color: var(--cyan);
    border: 1px solid var(--cyan);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    display: inline-block;
    letter-spacing: 2px;
    font-weight: bold;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(0, 242, 255, 0.05);
}

.blockchain-stats {
    display: flex;
    gap: 3rem;
}

.b-stat span {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Space Grotesk', sans-serif;
    display: block;
}

.b-stat p {
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin-top: 0.25rem;
}

/* Console Ledger Terminal */
.blockchain-console-wrapper {
    background: #040815;
    border: 1px solid rgba(0, 242, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 25px rgba(0, 242, 255, 0.1);
}

.console-title {
    background: #091024;
    padding: 0.8rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.blinking {
    animation: blink-anim 1s infinite alternate;
}

.console-terminal {
    height: 320px;
    overflow-y: auto;
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #a5f3fc;
    line-height: 1.8;
}

.terminal-line {
    margin-bottom: 0.8rem;
    word-break: break-all;
    border-left: 2px solid rgba(0, 242, 255, 0.1);
    padding-left: 0.8rem;
}

.term-block { color: var(--gold); }
.term-vin { color: var(--text-dim); }
.term-hash { color: #f43f5e; }
.term-success { color: var(--cyan); font-weight: bold; }

/* Pitch Deck Slides Section */
#pitch-deck {
    padding: 7rem 0;
    background: var(--surface);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.pitch-container {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 3rem;
    margin-top: 2rem;
}

@media (max-width: 992px) {
    .pitch-container {
        grid-template-columns: 1fr;
    }
}

.pitch-carousel {
    background: #020617;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 380px;
    height: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.slides-wrapper {
    position: relative;
    width: 100%;
    height: 80%;
}

.pitch-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-out;
    display: flex;
    flex-direction: column;
}

.pitch-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.slide-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--cyan);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.pitch-slide h3 {
    font-size: 1.8rem;
    color: #FFF;
    margin-bottom: 0.25rem;
}

.slide-subtitle {
    font-size: 1rem;
    color: var(--gold);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.slide-points {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.slide-points li {
    font-size: 0.95rem;
    color: var(--text-dim);
    position: relative;
    padding-left: 1.5rem;
}

.slide-points li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--cyan);
}

.carousel-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Downloads Pane */
.pitch-downloads {
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2.5rem;
    min-height: 380px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pitch-downloads h4 {
    font-size: 1.2rem;
    color: #FFF;
}

.pitch-downloads p {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.download-card {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 1.2rem;
    text-decoration: none;
    transition: var(--transition);
}

.download-card:hover {
    border-color: var(--gold-border);
    background: rgba(255, 215, 0, 0.02);
    transform: translateX(4px);
}

.dl-icon {
    font-size: 2rem;
    margin-right: 1.2rem;
}

.dl-info {
    display: flex;
    flex-direction: column;
}

.dl-title {
    font-weight: 700;
    color: #FFF;
    font-size: 1rem;
}

.dl-meta {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.2rem;
}

/* Developer Docs Section */
#developer-docs {
    padding: 6rem 0;
    background: var(--bg);
}

.dev-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 3rem;
}

.dev-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.dev-card p {
    color: var(--text-dim);
    font-size: 1rem;
    margin-bottom: 2rem;
    max-width: 800px;
}

.nginx-config {
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #38bdf8;
    line-height: 1.6;
}

/* Footer styling */
footer {
    padding: 6rem 0 2rem;
    background: #020617;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

.footer-info p {
    margin-top: 1rem;
    color: var(--text-dim);
    max-width: 400px;
}

.footer-links h4, .footer-contact h4 {
    margin-bottom: 1.5rem;
    color: #FFF;
    font-size: 1.1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-dim);
    transition: var(--transition);
    font-size: 0.95rem;
}

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

.footer-contact p {
    color: var(--text-dim);
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .grid-3 { grid-template-columns: 1fr; }
    .nav-links { display: none; }
}

/* ==========================================
   6. SCAN PROTOCOL MODAL & STYLING
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    width: 90%;
    max-width: 850px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.5rem;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 242, 255, 0.1);
    animation: modal-slide-up 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modal-slide-up {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 2rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--cyan);
}

.modal-print-btn {
    background: var(--cyan);
    color: #020617;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 1.6rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 242, 255, 0.25);
    transition: var(--transition);
    margin-top: 1.5rem;
    display: block;
    width: 100%;
}

.modal-print-btn:hover {
    background: #FFF;
    box-shadow: 0 6px 20px rgba(0, 242, 255, 0.4);
    transform: translateY(-1px);
}

/* --- Protocol Wrapper Styling --- */
.protocol-wrapper {
    text-align: left;
    color: var(--text);
    line-height: 1.5;
}

.protocol-wrapper .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.protocol-wrapper .header .logo-block h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--text);
}

.protocol-wrapper .header .logo-block h1 span {
    color: var(--cyan);
}

.protocol-wrapper .header .logo-block p {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 0.2rem;
}

.protocol-wrapper .header .meta-grid {
    display: flex;
    gap: 1.2rem;
}

.protocol-wrapper .header .meta-item {
    text-align: right;
}

.protocol-wrapper .header .meta-item label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 0.1rem;
}

.protocol-wrapper .header .meta-item span {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--cyan);
    font-family: 'JetBrains Mono', monospace;
}

/* Indice d'Irrégularité */
.protocol-wrapper .irregularity-section {
    background: rgba(255, 215, 0, 0.02);
    border: 1px solid var(--gold-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.protocol-wrapper .irreg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.protocol-wrapper .irreg-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.protocol-wrapper .irreg-bar-container {
    position: relative;
    height: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.protocol-wrapper .irreg-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #10b981 0%, #10b981 15%, #f59e0b 35%, #ef4444 60%, #991b1b 100%);
}

.protocol-wrapper .irreg-marker-line {
    position: absolute;
    top: 0;
    height: 100%;
    width: 2px;
    background: rgba(255, 255, 255, 0.8);
}

.protocol-wrapper .irreg-marker-15 { left: 15%; }
.protocol-wrapper .irreg-marker-35 { left: 35%; }
.protocol-wrapper .irreg-marker-60 { left: 60%; }

.protocol-wrapper .irreg-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-dim);
}

.protocol-wrapper .irreg-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-top: 1rem;
}

.protocol-wrapper .irreg-card {
    background: var(--surface-light);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.8rem;
    font-size: 0.75rem;
}

.protocol-wrapper .irreg-card strong {
    display: block;
    margin-bottom: 0.25rem;
}

.protocol-wrapper .irreg-card.ok { border-left: 3px solid #10b981; }
.protocol-wrapper .irreg-card.warn { border-left: 3px solid #f59e0b; }
.protocol-wrapper .irreg-card.crit { border-left: 3px solid #ef4444; }

/* Table design */
.protocol-wrapper .scan-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
}

.protocol-wrapper .scan-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--cyan);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.protocol-wrapper .scan-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.protocol-wrapper .scan-table tr:hover td {
    background: rgba(0, 242, 255, 0.02);
}

.protocol-wrapper .phase-row td {
    color: var(--gold);
    border-bottom: 1px solid var(--gold-border);
    padding-top: 1.2rem;
    padding-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.protocol-wrapper .step-num-badge {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(0, 242, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: var(--cyan);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.protocol-wrapper .step-mode-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    display: inline-block;
}

.protocol-wrapper .mode-cam { background: rgba(0, 242, 255, 0.08); color: var(--cyan); border: 1px solid rgba(0, 242, 255, 0.2); }
.protocol-wrapper .mode-mic { background: rgba(255, 215, 0, 0.08); color: var(--gold); border: 1px solid rgba(255, 215, 0, 0.2); }

.protocol-wrapper .metric-mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* Info Grid */
.protocol-wrapper .info-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.protocol-wrapper .info-box {
    background: rgba(0, 242, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.2rem;
}

.protocol-wrapper .info-box h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cyan);
    margin-bottom: 0.6rem;
}

.protocol-wrapper .info-box ul {
    list-style: none;
    font-size: 0.75rem;
    color: var(--text-dim);
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
}

.protocol-wrapper .info-box li::before {
    content: "→ ";
    color: var(--cyan);
    font-weight: bold;
}

.protocol-wrapper .checklist-box {
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1.2rem;
}

.protocol-wrapper .checklist-box h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: 0.6rem;
}

.protocol-wrapper .checklist-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.protocol-wrapper .check-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.protocol-wrapper .check-item input {
    accent-color: var(--cyan);
    cursor: pointer;
}

/* Legal Notice */
.protocol-wrapper .legal-notice {
    background: rgba(239, 68, 68, 0.03);
    border: 1px solid rgba(239, 68, 68, 0.10);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.protocol-wrapper .legal-notice p {
    margin-bottom: 0.4rem;
}

.protocol-wrapper .legal-notice strong {
    color: var(--text);
}

/* Modal Footer */
.protocol-wrapper .footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
    font-size: 0.65rem;
    color: var(--text-dim);
}

.protocol-wrapper .footer-badge {
    background: rgba(0, 242, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: var(--cyan);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* PRINT MEDIA QUERIES FOR MODAL SINGLE-PAGE PRINTING */
@media print {
    body > *:not(#scan-protocol-modal) {
        display: none !important;
    }
    #scan-protocol-modal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: auto;
        background: white !important;
        display: block !important;
        opacity: 1 !important;
        z-index: 9999 !important;
    }
    .modal-content {
        max-height: none !important;
        overflow: visible !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        width: 100% !important;
        background: white !important;
    }
    .close-modal, .modal-print-btn {
        display: none !important;
    }
    .protocol-wrapper {
        color: #000 !important;
    }
    .protocol-wrapper th, .protocol-wrapper td {
        color: #000 !important;
        border-color: #ccc !important;
    }
    .protocol-wrapper .step-num-badge, .protocol-wrapper .step-mode-badge {
        border-color: #000 !important;
        color: #000 !important;
        background: none !important;
    }
    .protocol-wrapper .info-box, .protocol-wrapper .checklist-box, .protocol-wrapper .legal-notice {
        border-color: #000 !important;
        background: none !important;
        color: #000 !important;
    }
    .protocol-wrapper .irregularity-section {
        border-color: #000 !important;
        background: none !important;
    }
}

/* ==========================================
   7. LANGUAGE SWITCHER & FLEX BUTTONS
   ========================================== */
.lang-selector {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.5rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    transition: var(--transition);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.lang-btn:hover {
    color: var(--cyan);
}

.lang-btn.active {
    color: var(--gold);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.lang-separator {
    color: rgba(255, 255, 255, 0.15);
    user-select: none;
}

.flex.items-center.gap-2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
