/* ============================================
   CloudScan — Neon Noir Vaporwave + Cat Theme
   ============================================ */

/* --- Reset & Variables --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Vaporwave palette */
    --bg-deep: #0c0015;
    --bg-card: #140022;
    --bg-card-hover: #1e0033;
    --bg-terminal: #0a0012;
    --border: #2a1145;
    --border-glow: #bf5af233;

    /* Neon accents */
    --neon-pink: #ff6ec7;
    --neon-purple: #bf5af2;
    --neon-cyan: #00f5d4;
    --neon-blue: #7b61ff;
    --neon-green: #39ff14;
    --neon-red: #ff3366;
    --neon-amber: #ffb800;
    --neon-magenta: #ff00ff;

    /* Text */
    --text-primary: #f0e6ff;
    --text-secondary: #a78bdb;
    --text-muted: #5c3d8f;
    --text-terminal: #00f5d4;

    /* Gauge colors by score range */
    --score-good: #39ff14;
    --score-mid: #ffb800;
    --score-bad: #ff3366;

    /* Sizing */
    --max-width: 1280px;
    --radius: 12px;
    --radius-sm: 8px;

    /* Fonts */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Screens --- */
.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: flex;
}

/* ============================================
   HERO SCREEN
   ============================================ */
#hero {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 2rem;
    overflow: hidden;
}

/* Animated grid background */
.hero-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(191, 90, 242, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(191, 90, 242, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridDrift 20s linear infinite;
}

@keyframes gridDrift {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(60px, 60px);
    }
}

/* Radial glow — pink/purple vaporwave */
.hero-glow {
    position: absolute;
    top: 30%;
    left: 50%;
    width: 900px;
    height: 700px;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse,
            rgba(255, 110, 199, 0.15) 0%,
            rgba(191, 90, 242, 0.08) 40%,
            transparent 70%);
    pointer-events: none;
}

/* Secondary glow (cyan from bottom right) */
.hero-glow::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -20%;
    width: 500px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(0, 245, 212, 0.1) 0%, transparent 70%);
}

/* Nav */
.hero-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2.5rem;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.15rem;
}

.brand-icon {
    font-size: 1.4rem;
}

.brand-name {
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--neon-pink);
}

/* Title */
.hero-content {
    text-align: center;
    z-index: 5;
    max-width: 720px;
}

.hero-title {
    font-size: clamp(2.2rem, 5.5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.2rem;
    letter-spacing: -0.02em;
}

.title-line {
    display: block;
}

.title-line.accent {
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.hero-subtitle strong {
    color: var(--neon-cyan);
}

/* Input group */
.scan-input-group {
    display: flex;
    align-items: stretch;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    max-width: 560px;
    margin: 0 auto;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.scan-input-group:focus-within {
    border-color: var(--neon-pink);
    box-shadow: 0 0 0 3px rgba(255, 110, 199, 0.15), 0 0 30px rgba(255, 110, 199, 0.1);
}

.input-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    padding-left: 1.2rem;
}

.input-prefix {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    white-space: nowrap;
    user-select: none;
}

#url-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1rem;
    padding: 1rem 0.4rem;
}

#url-input::placeholder {
    color: var(--text-muted);
}

.btn-scan {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 2rem;
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
    color: #fff;
    border: none;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    white-space: nowrap;
}

.btn-scan:hover {
    opacity: 0.9;
}

.btn-scan:active {
    transform: scale(0.98);
}

.btn-icon {
    transition: transform 0.2s;
}

.btn-scan:hover .btn-icon {
    transform: translateX(3px);
}

.hero-disclaimer {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 1rem;
}

/* Error message */
.scan-error {
    color: var(--neon-red);
    font-size: 0.9rem;
    margin-top: 1rem;
    padding: 0.7rem 1.2rem;
    background: rgba(255, 51, 102, 0.08);
    border: 1px solid rgba(255, 51, 102, 0.2);
    border-radius: var(--radius-sm);
}

/* Feature pills */
.hero-features {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 3rem;
    z-index: 5;
}

.feature-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.pill-dot.perf {
    background: var(--neon-pink);
}

.pill-dot.sec {
    background: var(--neon-cyan);
}

.pill-dot.seo {
    background: var(--neon-amber);
}

.pill-dot.acc {
    background: var(--neon-purple);
}

.pill-dot.tech {
    background: var(--neon-blue);
}

.hidden {
    display: none !important;
}

/* ============================================
   SCANNING SCREEN
   ============================================ */
#scanner {
    flex-direction: column;
    padding: 0;
}

.scanner-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    min-height: 100vh;
}

/* Terminal Panel */
.terminal-panel {
    background: var(--bg-terminal);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1.2rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background: #ff5f56;
}

.dot.yellow {
    background: #ffbd2e;
}

.dot.green {
    background: #27c93f;
}

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.terminal-body {
    flex: 1;
    padding: 1rem 1.2rem;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--text-terminal);
}

.terminal-body::-webkit-scrollbar {
    width: 4px;
}

.terminal-body::-webkit-scrollbar-track {
    background: transparent;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.terminal-cursor {
    animation: blink 1s step-end infinite;
    color: var(--neon-cyan);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.terminal-line {
    margin-bottom: 2px;
}

.terminal-line.info {
    color: var(--neon-purple);
}

.terminal-line.success {
    color: var(--neon-cyan);
}

.terminal-line.warning {
    color: var(--neon-amber);
}

.terminal-line.error {
    color: var(--neon-red);
}

.terminal-line.dim {
    color: var(--text-muted);
}

.terminal-line.header {
    color: var(--neon-pink);
    font-weight: 700;
    margin-top: 0.5rem;
    margin-bottom: 0.2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.2rem;
}

/* Results Panel */
.results-panel {
    padding: 2rem 2.5rem 4rem;
    overflow-y: auto;
}

/* Scan Target */
.scan-target {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.scan-target-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--neon-pink);
    padding: 0.2rem 0.5rem;
    background: rgba(255, 110, 199, 0.1);
    border-radius: 4px;
    letter-spacing: 0.1em;
}

.scan-target-url {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-secondary);
    word-break: break-all;
}

.scan-back-btn {
    margin-left: auto;
    padding: 0.45rem 0.95rem;
    font-size: 0.8rem;
}

/* Progress Bar */
.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-purple), var(--neon-cyan));
    border-radius: 3px;
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: -2px;
    bottom: -2px;
    width: 20px;
    background: rgba(255, 110, 199, 0.4);
    filter: blur(8px);
    border-radius: 50%;
}

.progress-text {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 3rem;
    text-align: right;
}

/* ============================================
   GAUGE CARDS
   ============================================ */
.gauges-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.gauge-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    opacity: 0.4;
}

.gauge-card.active {
    opacity: 1;
    border-color: var(--border-glow);
    box-shadow: 0 0 20px rgba(191, 90, 242, 0.08);
}

.gauge-ring {
    position: relative;
    width: 100px;
    height: 100px;
}

.gauge-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 6;
}

.gauge-fill {
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 326.73;
    stroke-dashoffset: 326.73;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1),
        stroke 0.5s ease;
}

.gauge-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
}

.gauge-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Score colors - neon vaporwave */
.score-good {
    stroke: var(--score-good);
}

.score-mid {
    stroke: var(--score-mid);
}

.score-bad {
    stroke: var(--score-bad);
}

.text-good {
    color: var(--score-good);
}

.text-mid {
    color: var(--score-mid);
}

.text-bad {
    color: var(--score-bad);
}

/* ============================================
   SECTION CARDS
   ============================================ */
.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s, transform 0.5s;
}

.section-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-icon {
    font-size: 1.1rem;
}

/* Checklist items */
.checklist {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s, transform 0.3s;
}

.check-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.check-icon {
    font-size: 1rem;
    width: 1.2rem;
    text-align: center;
    flex-shrink: 0;
}

.check-item.pass {
    border-left: 3px solid var(--neon-cyan);
}

.check-item.fail {
    border-left: 3px solid var(--neon-red);
}

.check-item.warn {
    border-left: 3px solid var(--neon-amber);
}

.check-item.pending {
    border-left: 3px solid var(--text-muted);
    color: var(--text-muted);
}

.check-item.pending .check-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Tech tags */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    padding: 0.4rem 0.85rem;
    background: rgba(191, 90, 242, 0.08);
    border: 1px solid rgba(191, 90, 242, 0.2);
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--neon-purple);
    font-family: var(--font-mono);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s, transform 0.3s;
}

.tech-tag.visible {
    opacity: 1;
    transform: scale(1);
}

/* Metrics grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.metric-item {
    text-align: center;
    padding: 1rem 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s, transform 0.4s;
}

.metric-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.3rem;
}

.metric-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Issues list */
.issues-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.issue-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s, transform 0.4s;
}

.issue-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.issue-item.critical {
    background: rgba(255, 51, 102, 0.08);
    border: 1px solid rgba(255, 51, 102, 0.15);
}

.issue-item.warning {
    background: rgba(255, 184, 0, 0.08);
    border: 1px solid rgba(255, 184, 0, 0.15);
}

.issue-item.info {
    background: rgba(191, 90, 242, 0.06);
    border: 1px solid rgba(191, 90, 242, 0.12);
}

.issue-severity {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.issue-item.critical .issue-severity {
    background: rgba(255, 51, 102, 0.2);
    color: var(--neon-red);
}

.issue-item.warning .issue-severity {
    background: rgba(255, 184, 0, 0.2);
    color: var(--neon-amber);
}

.issue-item.info .issue-severity {
    background: rgba(191, 90, 242, 0.15);
    color: var(--neon-purple);
}

/* Deep scan toggle */
.deep-scan-container {
    margin-bottom: 1.25rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    user-select: none;
}

/* Hero form placement for pre-run deep scan control */
#scan-form .deep-scan-container {
    display: flex;
    justify-content: center;
    margin-top: 0.8rem;
    margin-bottom: 0.25rem;
}

#scan-form .toggle-label {
    background: rgba(15, 21, 33, 0.8);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
}

.toggle-label input {
    display: none;
}

.toggle-slider {
    width: 40px;
    height: 22px;
    background: var(--border);
    border-radius: 11px;
    position: relative;
    transition: background 0.3s;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: transform 0.3s, background 0.3s;
}

.toggle-label input:checked+.toggle-slider {
    background: var(--neon-pink);
}

.toggle-label input:checked+.toggle-slider::after {
    transform: translateX(18px);
    background: #fff;
}

/* SSL details */
.ssl-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.ssl-item {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
}

.ssl-item-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}

.ssl-item-value {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============================================
   LEAD GATE OVERLAY
   ============================================ */
.lead-gate {
    position: fixed;
    inset: 0;
    background: rgba(12, 0, 21, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.lead-gate-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3rem;
    max-width: 480px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 0 60px rgba(255, 110, 199, 0.1), 0 0 120px rgba(191, 90, 242, 0.05);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lead-gate-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.lead-gate-close:hover {
    color: var(--text-primary);
}

.lead-gate-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.lead-gate-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.lead-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lead-form input {
    padding: 0.85rem 1.2rem;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
}

.lead-form input:focus {
    border-color: var(--neon-pink);
}

.lead-form input::placeholder {
    color: var(--text-muted);
}

.btn-unlock {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.5rem;
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 0.5rem;
}

.btn-unlock:hover {
    opacity: 0.9;
}

.btn-unlock:active {
    transform: scale(0.98);
}

.lead-gate-note {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 1rem;
}

/* Full report banner */
.full-report-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    z-index: 50;
    font-size: 0.9rem;
    color: var(--text-secondary);
    animation: slideUpBanner 0.5s ease;
}

@keyframes slideUpBanner {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.btn-unlock-sm {
    padding: 0.55rem 1.2rem;
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.btn-unlock-sm:hover {
    opacity: 0.9;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .scanner-layout {
        grid-template-columns: 1fr;
    }

    .terminal-panel {
        position: relative;
        height: 300px;
        min-height: 300px;
    }

    .gauges-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    #hero {
        padding: 1.5rem 1rem;
    }

    .hero-nav {
        padding: 1rem 1.2rem;
    }

    .brand {
        font-size: 1rem;
    }

    .scan-input-group {
        flex-direction: column;
        border-radius: var(--radius);
    }

    .btn-scan {
        justify-content: center;
        padding: 1rem;
    }

    .results-panel {
        padding: 1.5rem 1rem 5rem;
    }

    .gauges-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ssl-details {
        grid-template-columns: 1fr;
    }

    .full-report-banner {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
        padding: 1rem;
    }

    .hero-features {
        gap: 0.5rem;
    }

    .feature-pill {
        font-size: 0.7rem;
        padding: 0.35rem 0.75rem;
    }

    .lead-gate-content {
        padding: 2rem 1.5rem;
    }
}

/* ============================================
   ANIMATIONS & UTILITIES
   ============================================ */
@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 110, 199, 0.2);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(255, 110, 199, 0);
    }
}

.pulse-glow {
    animation: pulseGlow 2s infinite;
}

/* Scanning state on the button */
.btn-scan.scanning {
    pointer-events: none;
    opacity: 0.7;
}

.btn-scan.scanning .btn-text::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ============================================
   DYNAMIC REACTIVE BACKGROUND
   ============================================ */

/* Ambient glow overlay — positioned behind scanner content */
.scanner-ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    transition: background 1.5s ease, box-shadow 2s ease;
    overflow: hidden;
}

/* Make scanner content sit above the ambient layer */
.scanner-layout {
    position: relative;
    z-index: 1;
}

/* — Health States — */

/* Default: subtle vaporwave purple scanning glow */
.scanner-ambient.state-scanning {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(191, 90, 242, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(255, 110, 199, 0.04) 0%, transparent 50%);
}

/* Healthy: green ambient wash */
.scanner-ambient.state-healthy {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(57, 255, 20, 0.07) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(0, 245, 212, 0.05) 0%, transparent 50%);
    box-shadow: inset 0 0 120px rgba(57, 255, 20, 0.03);
}

/* Warning: amber ambient wash */
.scanner-ambient.state-warning {
    background:
        radial-gradient(ellipse at 30% 40%, rgba(255, 184, 0, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 70%, rgba(255, 184, 0, 0.04) 0%, transparent 50%);
    box-shadow: inset 0 0 120px rgba(255, 184, 0, 0.03);
}

/* Critical: red ambient + pulse */
.scanner-ambient.state-critical {
    background:
        radial-gradient(ellipse at 30% 40%, rgba(255, 51, 102, 0.1) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 70%, rgba(255, 51, 102, 0.06) 0%, transparent 50%);
    box-shadow: inset 0 0 120px rgba(255, 51, 102, 0.04);
    animation: criticalPulse 3s ease-in-out infinite;
}

@keyframes criticalPulse {

    0%,
    100% {
        box-shadow: inset 0 0 120px rgba(255, 51, 102, 0.04);
    }

    50% {
        box-shadow: inset 0 0 200px rgba(255, 51, 102, 0.1);
    }
}

/* Flash effect for when a critical issue is found */
.scanner-ambient.flash-critical {
    animation: criticalFlash 0.6s ease-out;
}

@keyframes criticalFlash {
    0% {
        background: rgba(255, 51, 102, 0.15);
    }

    100% {
        background: transparent;
    }
}

/* Flash for warning */
.scanner-ambient.flash-warning {
    animation: warningFlash 0.5s ease-out;
}

@keyframes warningFlash {
    0% {
        background: rgba(255, 184, 0, 0.12);
    }

    100% {
        background: transparent;
    }
}

/* Flash for pass/success */
.scanner-ambient.flash-success {
    animation: successFlash 0.4s ease-out;
}

@keyframes successFlash {
    0% {
        background: rgba(57, 255, 20, 0.08);
    }

    100% {
        background: transparent;
    }
}

/* Scanline overlay inside scanner — hacker feel */
.scanner-ambient::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.008) 2px,
            rgba(255, 255, 255, 0.008) 4px);
    pointer-events: none;
    z-index: 1;
}

/* Particle canvas — floating motes */
#ambient-particles {
    position: absolute;
    inset: 0;
    z-index: 0;
}

/* Phase indicator bar at very top of scanner */
.phase-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 50;
    background: var(--border);
    overflow: hidden;
}

.phase-bar-fill {
    height: 100%;
    width: 0%;
    transition: width 0.5s ease, background 0.5s ease;
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-purple), var(--neon-cyan));
}

/* Health-aware phase bar colors */
.phase-bar-fill.bar-healthy {
    background: linear-gradient(90deg, var(--neon-cyan), var(--score-good));
}

.phase-bar-fill.bar-warning {
    background: linear-gradient(90deg, var(--neon-amber), var(--score-mid));
}

.phase-bar-fill.bar-critical {
    background: linear-gradient(90deg, var(--neon-red), var(--neon-pink));
}

/* Terminal border glow reacts to health */
.terminal-panel {
    transition: border-color 1s ease, box-shadow 1s ease;
}

.terminal-panel.health-good {
    border-right-color: rgba(57, 255, 20, 0.2);
    box-shadow: inset -2px 0 20px rgba(57, 255, 20, 0.03);
}

.terminal-panel.health-mid {
    border-right-color: rgba(255, 184, 0, 0.2);
    box-shadow: inset -2px 0 20px rgba(255, 184, 0, 0.03);
}

.terminal-panel.health-bad {
    border-right-color: rgba(255, 51, 102, 0.2);
    box-shadow: inset -2px 0 20px rgba(255, 51, 102, 0.03);
}

/* --- County Comparison Panel --- */
.compare-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.compare-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.compare-legend {
    display: flex;
    gap: 1.5rem;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    margin-bottom: 0.5rem;
}

.legend-you {
    color: var(--neon-pink);
}

.legend-county {
    color: var(--neon-purple);
}

.compare-row {
    display: grid;
    grid-template-columns: 120px 1fr 140px;
    align-items: center;
    gap: 1rem;
}

.compare-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.compare-dual-bar {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.compare-bar-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.compare-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease-out;
}

.compare-bar.you {
    background: var(--neon-pink);
    box-shadow: 0 0 10px rgba(255, 51, 102, 0.3);
}

.compare-bar.county {
    background: var(--neon-purple);
    box-shadow: 0 0 10px rgba(191, 90, 242, 0.3);
}

.compare-scores {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.compare-you {
    color: var(--neon-pink);
    font-weight: 700;
}

.compare-county {
    color: var(--text-muted);
}

.compare-ahead {
    color: var(--neon-green);
    font-size: 0.75rem;
}

.compare-behind {
    color: var(--neon-pink);
    font-size: 0.75rem;
}

.compare-verdict {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--neon-purple);
}

.compare-verdict p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}

@media (max-width: 600px) {
    .compare-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .compare-scores {
        justify-content: flex-start;
    }
}
