/* ═══════════════════════════════════════
   ACCESS GAP DIAGNOSTIC - STYLES
   Championship Neurobiology™
   ═══════════════════════════════════════ */

:root {
    --agd-bg: #0B0F1A;
    --agd-surface: #111827;
    --agd-surface-light: #1F2937;
    --agd-border: #2D3748;
    --agd-text: #E2E8F0;
    --agd-text-muted: #94A3B8;
    --agd-text-dim: #64748B;
    --agd-accent: #F97316;
    --agd-accent-glow: rgba(249,115,22,0.15);
    --agd-white: #FFFFFF;
    --agd-clarity: #3B82F6;
    --agd-certainty: #10B981;
    --agd-flow: #A855F7;
    --agd-momentum: #F59E0B;
    --agd-danger: #EF4444;
    --agd-success: #10B981;
    --agd-warning: #F59E0B;
}

/* Reset within plugin scope */
.agd-wrapper { all: initial; display: block; }
.agd-wrapper *, .agd-wrapper *::before, .agd-wrapper *::after {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'DM Sans', sans-serif;
}

.agd-wrapper {
    background: var(--agd-bg);
    color: var(--agd-text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Typography helpers */
.agd-wrapper .agd-head { font-family: 'Playfair Display', serif; }
.agd-wrapper .agd-mono { font-family: 'DM Mono', monospace; }

/* ─── SCREENS ─── */
.agd-screen { display: none; }
.agd-screen.agd-active { display: flex; }

/* ─── WELCOME ─── */
#agd-welcome {
    flex-direction: column; align-items: center; justify-content: center;
    padding: 40px 20px; position: relative; overflow: hidden; min-height: 100vh;
}
.agd-welcome-glow {
    position: absolute; top: 20%; left: 50%; transform: translate(-50%, -50%);
    width: 600px; height: 600px; border-radius: 50%;
    background: radial-gradient(circle, var(--agd-accent-glow) 0%, transparent 70%);
    pointer-events: none;
}
.agd-welcome-content { position: relative; z-index: 1; max-width: 640px; text-align: center; }
.agd-brand-tag {
    font-family: 'DM Mono', monospace; font-size: 11px; color: var(--agd-accent);
    letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 32px;
}
.agd-hero-title {
    font-family: 'Playfair Display', serif; font-size: clamp(36px, 6vw, 56px);
    font-weight: 700; line-height: 1.1; margin-bottom: 24px; color: var(--agd-white);
}
.agd-accent { color: var(--agd-accent); }
.agd-hero-sub { font-size: 17px; line-height: 1.7; color: var(--agd-text-muted); max-width: 480px; margin: 0 auto 16px; }
.agd-hero-desc { font-size: 15px; line-height: 1.7; color: var(--agd-text-dim); max-width: 520px; margin: 0 auto 40px; }

.agd-input {
    background: var(--agd-surface-light); border: 1px solid var(--agd-border);
    border-radius: 8px; padding: 12px 20px; color: var(--agd-white); font-size: 15px;
    font-family: 'DM Sans', sans-serif; outline: none; text-align: center;
    width: 280px; transition: border-color 0.2s;
}
.agd-input:focus { border-color: var(--agd-accent); }
.agd-input.agd-error-input { border-color: var(--agd-danger); }

.agd-btn-primary {
    background: var(--agd-accent); color: var(--agd-white); border: none; border-radius: 8px;
    padding: 16px 48px; font-size: 16px; font-weight: 600; font-family: 'DM Sans', sans-serif;
    cursor: pointer; transition: all 0.2s; box-shadow: 0 0 30px var(--agd-accent-glow);
}
.agd-btn-primary:hover { transform: translateY(-2px); }
.agd-btn-sm { padding: 10px 20px; font-size: 13px; }
.agd-full-width { width: 100%; }

.agd-btn-secondary {
    background: none; border: 1px solid var(--agd-border); border-radius: 8px;
    padding: 10px 24px; color: var(--agd-text-muted); font-size: 13px; cursor: pointer;
    font-family: 'DM Sans', sans-serif; transition: all 0.2s;
}
.agd-btn-secondary:hover { border-color: var(--agd-text-dim); }

.agd-btn-ghost {
    background: none; border: none; color: var(--agd-text-dim); font-size: 13px;
    cursor: pointer; font-family: 'DM Sans', sans-serif; padding: 8px 16px;
    margin-top: 16px; transition: color 0.2s;
}
.agd-btn-ghost:hover { color: var(--agd-text-muted); }

.agd-btn-download {
    background: var(--agd-surface); border: 1px solid var(--agd-border); border-radius: 8px;
    padding: 10px 20px; color: var(--agd-white); font-size: 13px; font-weight: 500;
    cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.2s;
}
.agd-btn-download:hover { border-color: var(--agd-accent); }

.agd-stage-legend, .agd-face-legend {
    display: flex; justify-content: center; gap: 24px; flex-wrap: wrap;
}
.agd-stage-legend { margin-top: 48px; gap: 32px; }
.agd-stage-legend span, .agd-face-legend span {
    display: flex; align-items: center; gap: 8px;
    font-family: 'DM Mono', monospace; font-size: 12px; color: var(--agd-text-dim);
}
.agd-face-legend { margin-top: 16px; }
.agd-face-legend span { font-size: 11px; }
.agd-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.agd-timing-note { margin-top: 48px; font-size: 11px; color: var(--agd-text-dim); line-height: 1.6; }

/* ─── ASSESSMENT ─── */
#agd-assess { flex-direction: column; min-height: 100vh; }
.agd-assess-header {
    padding: 16px 24px; border-bottom: 1px solid var(--agd-border);
    display: flex; align-items: center; justify-content: space-between;
}
.agd-q-counter { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--agd-text-dim); }
.agd-q-counter span { color: var(--agd-accent); }
.agd-stage-tag { font-family: 'DM Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.15em; }
.agd-face-tag { font-size: 11px; color: var(--agd-text-dim); }

.agd-progress { width: 100%; height: 3px; background: var(--agd-border); }
.agd-progress-fill {
    height: 100%; border-radius: 2px;
    background: linear-gradient(90deg, var(--agd-accent), var(--agd-flow));
    transition: width 0.4s ease;
}

.agd-assess-body {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 40px 24px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.agd-assess-body.agd-animating { opacity: 0; transform: translateX(20px); }

.agd-scenario {
    font-size: 13px; color: var(--agd-text-dim); font-style: italic;
    max-width: 560px; text-align: center; line-height: 1.6;
    padding: 12px 20px; background: var(--agd-surface-light); border-radius: 8px;
    border: 1px solid var(--agd-border); margin-bottom: 16px;
}

.agd-question-text {
    font-family: 'Playfair Display', serif; font-size: clamp(20px, 3.5vw, 28px);
    font-weight: 600; line-height: 1.5; text-align: center; max-width: 600px;
    margin: 0 0 48px 0; color: var(--agd-white);
}

.agd-likert-group { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.agd-likert-btn {
    width: 80px; height: 80px; border-radius: 12px;
    border: 2px solid var(--agd-border); background: var(--agd-surface);
    color: var(--agd-text-muted); display: flex; flex-direction: column;
    align-items: center; justify-content: center; cursor: pointer;
    transition: all 0.2s; font-family: 'DM Mono', monospace;
    gap: 4px; line-height: 1.3; text-align: center;
}
.agd-likert-btn:hover { border-color: var(--agd-text-dim); }
.agd-likert-btn.agd-selected {
    border-color: var(--agd-accent); background: var(--agd-accent-glow); color: var(--agd-accent);
}
.agd-likert-btn .agd-num { font-size: 18px; font-weight: 700; }
.agd-likert-btn .agd-lbl { font-size: 9px; white-space: pre-line; }

.agd-nav-btns { display: flex; gap: 16px; margin-top: 40px; align-items: center; }
.agd-nav-dots {
    display: flex; gap: 3px; flex-wrap: wrap; justify-content: center;
    max-width: 500px; margin-top: 32px;
}
.agd-nav-dot {
    width: 8px; height: 8px; border-radius: 2px; cursor: pointer; transition: all 0.2s;
}

/* ─── EMAIL GATE ─── */
#agd-emailgate {
    flex-direction: column; align-items: center; justify-content: center;
    padding: 40px 20px; position: relative; overflow: hidden; min-height: 100vh;
}
.agd-emailgate-glow {
    position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%);
    width: 500px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, rgba(249,115,22,0.1) 0%, transparent 70%);
    pointer-events: none;
}
.agd-emailgate-content { position: relative; z-index: 1; max-width: 480px; text-align: center; }
.agd-check-icon {
    width: 64px; height: 64px; border-radius: 50%; background: var(--agd-accent-glow);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 24px; border: 2px solid rgba(249,115,22,0.25);
    font-size: 28px; color: var(--agd-accent);
}
.agd-gate-title {
    font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 700;
    color: var(--agd-white); margin-bottom: 12px;
}
.agd-gate-desc { font-size: 15px; color: var(--agd-text-muted); line-height: 1.7; margin-bottom: 32px; }
.agd-email-field { margin-bottom: 24px; }
.agd-email-field .agd-input { width: 100%; }
.agd-error { font-size: 12px; color: var(--agd-danger); margin-top: 8px; }
.agd-privacy-note { font-size: 11px; color: var(--agd-text-dim); margin-top: 24px; line-height: 1.6; }

/* ─── RESULTS ─── */
#agd-results { flex-direction: column; }
.agd-results-header {
    padding: 40px 24px 32px; text-align: center;
    border-bottom: 1px solid var(--agd-border);
    background: linear-gradient(180deg, rgba(249,115,22,0.06) 0%, transparent 100%);
}
.agd-results-title {
    font-family: 'Playfair Display', serif; font-size: 32px; font-weight: 700;
    color: var(--agd-white); margin-bottom: 8px;
}
.agd-results-date { font-size: 14px; color: var(--agd-text-dim); }
.agd-results-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.agd-email-sent {
    background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3);
    border-radius: 8px; padding: 10px 20px; color: var(--agd-success);
    font-size: 13px; font-weight: 500;
}

/* Tabs */
.agd-tab-nav {
    display: flex; justify-content: center; gap: 4px;
    padding: 16px 16px 0; border-bottom: 1px solid var(--agd-border); flex-wrap: wrap;
}
.agd-tab {
    background: none; border: none; border-bottom: 2px solid transparent;
    padding: 10px 16px; color: var(--agd-text-dim); font-size: 13px; font-weight: 400;
    cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.2s;
}
.agd-tab.active { border-bottom-color: var(--agd-accent); color: var(--agd-white); font-weight: 600; }

.agd-results-body { max-width: 800px; margin: 0 auto; padding: 32px 20px; }
.agd-tab-content { display: none; }
.agd-tab-content.agd-active { display: block; }

/* Cards */
.agd-card {
    background: var(--agd-surface); border-radius: 12px; padding: 24px;
    border: 1px solid var(--agd-border); margin-bottom: 16px;
}
.agd-card-lg { border-radius: 16px; padding: 32px; }
.agd-label-mono {
    font-family: 'DM Mono', monospace; font-size: 11px; color: var(--agd-accent);
    letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 8px;
}

/* Bars */
.agd-bar-track { height: 8px; background: var(--agd-border); border-radius: 4px; }
.agd-bar-fill { height: 100%; border-radius: 4px; transition: width 1s ease; }

/* Gauge (SVG) */
.agd-gauge { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.agd-gauge svg { transform: rotate(-90deg); }
.agd-gauge-value { font-family: 'DM Mono', monospace; font-weight: 700; color: var(--agd-white); }

/* Grid */
.agd-stage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }

/* Matrix */
.agd-matrix { border-collapse: separate; border-spacing: 4px; width: 100%; }
.agd-matrix th {
    font-family: 'DM Mono', monospace; font-size: 10px; text-align: center;
    padding: 8px; vertical-align: bottom; color: var(--agd-text-dim);
}
.agd-heat-cell {
    width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
    border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--agd-white);
    font-family: 'DM Mono', monospace; margin: 0 auto;
}

/* Priority tags */
.agd-priority-tag {
    display: inline-block; padding: 4px 12px; border-radius: 12px;
    font-size: 11px; font-weight: 600; font-family: 'DM Mono', monospace;
    margin-bottom: 12px;
}

/* CTA */
.agd-cta-block {
    background: linear-gradient(135deg, var(--agd-surface) 0%, rgba(249,115,22,0.08) 100%);
    border-radius: 16px; padding: 32px; text-align: center;
    border: 1px solid rgba(249,115,22,0.2);
}

/* Cycle flow */
.agd-cycle-flow { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 32px; }
.agd-cycle-pill { padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; }

/* Summary row */
.agd-summary-row { display: flex; gap: 24px; margin-top: 24px; flex-wrap: wrap; }
.agd-summary-item { flex: 1; min-width: 200px; }
.agd-summary-label {
    font-size: 11px; color: var(--agd-text-dim); margin-bottom: 4px;
    font-family: 'DM Mono', monospace; text-transform: uppercase;
}

/* Footer */
.agd-footer {
    text-align: center; padding: 32px 20px; border-top: 1px solid var(--agd-border);
    margin-top: 40px; font-size: 11px; color: var(--agd-text-dim); line-height: 1.8;
}

/* Loading */
.agd-loading {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(11,15,26,0.9); display: flex; flex-direction: column;
    align-items: center; justify-content: center; z-index: 9999;
    color: var(--agd-text-muted); font-size: 14px;
}
.agd-spinner {
    width: 40px; height: 40px; border: 3px solid var(--agd-border);
    border-top-color: var(--agd-accent); border-radius: 50%;
    animation: agd-spin 0.8s linear infinite; margin-bottom: 16px;
}
@keyframes agd-spin { to { transform: rotate(360deg); } }

/* ─── RESPONSIVE ─── */
@media (max-width: 600px) {
    .agd-likert-btn { width: 60px; height: 60px; }
    .agd-likert-btn .agd-num { font-size: 16px; }
    .agd-heat-cell { width: 38px; height: 38px; font-size: 11px; }
    .agd-summary-row { flex-direction: column; gap: 12px; }
    .agd-assess-header { flex-wrap: wrap; gap: 8px; }
    .agd-input { width: 100%; }
    .agd-results-title { font-size: 24px; }
}
