/* ============================================================
   SoorgaAI — Dynamic Assessment Styles
   Matches existing assessment.css design system
   ============================================================ */

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

:root {
    --bg:        #0D0D0D;
    --surface:   #141414;
    --surface2:  #1a1a1a;
    --border:    rgba(255,255,255,0.08);
    --green:     #5CC5A7;
    --green-dim: rgba(92,197,167,0.15);
    --text:      #FFFFFF;
    --text2:     #AAAAAA;
    --font:      'Inter', -apple-system, sans-serif;
    --radius:    16px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    min-height: 100vh;
}

/* ── Layout ──────────────────────────────────────────────── */
.da-wrapper {
    max-width: 780px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ── Card ────────────────────────────────────────────────── */
.da-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    animation: fadeSlide 0.3s ease;
}

.da-center { text-align: center; align-items: center; display: flex; flex-direction: column; gap: 20px; }

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

/* ── Badge ───────────────────────────────────────────────── */
.da-badge {
    display: inline-block;
    background: var(--green-dim);
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

/* ── Typography ──────────────────────────────────────────── */
h1 { font-size: 28px; font-weight: 700; line-height: 1.2; margin-bottom: 12px; }
h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }

.da-subtitle {
    color: var(--text2);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 32px;
}

.da-welcome-msg {
    color: var(--text2);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 28px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
}

.da-note {
    text-align: center;
    color: var(--text2);
    font-size: 13px;
    margin-top: 16px;
}

/* ── Form ────────────────────────────────────────────────── */
.da-form { display: flex; flex-direction: column; gap: 0; }

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 13px 16px;
    font-size: 15px;
    color: var(--text);
    font-family: var(--font);
    outline: none;
    transition: border-color 0.25s;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus { border-color: var(--green); }

.form-group select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23aaa' fill='none' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }

.form-group select option { background: #1a1a1a; }

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text2);
    margin-top: 6px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
    padding: 14px 32px;
    background: var(--green);
    color: #000;
    border: none;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    font-family: var(--font);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover  { background: #4AB393; transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
    padding: 14px 28px;
    background: transparent;
    color: var(--text2);
    border: 1.5px solid var(--border);
    border-radius: 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    font-family: var(--font);
}

.btn-secondary:hover { border-color: var(--green); color: var(--text); }

.btn-full { width: 100%; margin-top: 8px; }

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0,0,0,0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

/* ── Loading steps ───────────────────────────────────────── */
.da-spinner-large {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(92,197,167,0.2);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.da-steps-loading {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    width: 100%;
    max-width: 380px;
}

.loading-step {
    padding: 12px 18px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text2);
    transition: all 0.3s;
}

.loading-step.active {
    border-color: var(--green);
    color: var(--text);
    background: var(--green-dim);
}

.loading-step.done {
    color: var(--green);
    border-color: rgba(92,197,167,0.3);
}

.loading-step.done::before { content: '✓ '; }

/* ── Info chips (discovery welcome) ──────────────────────── */
.da-info-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.da-info-chip {
    flex: 1;
    min-width: 140px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chip-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text2);
    font-weight: 600;
}

.chip-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

/* ── Question header ─────────────────────────────────────── */
.da-question-header {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.da-company-tag,
.da-domain-tag {
    font-size: 13px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text2);
}

.da-domain-tag {
    background: var(--green-dim);
    border-color: rgba(92,197,167,0.3);
    color: var(--green);
}

/* ── Progress ────────────────────────────────────────────── */
.progress-container { }

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text2);
    margin-bottom: 10px;
}

.progress-track {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--green);
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* ── Focus area label ────────────────────────────────────── */
.da-focus-area {
    display: inline-block;
    background: var(--green-dim);
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 16px;
    letter-spacing: 0.3px;
}

/* ── Question text ───────────────────────────────────────── */
.question-text {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 28px;
    color: var(--text);
}

/* ── Option cards ────────────────────────────────────────── */
.options-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.option-label {
    flex: 1;
    min-width: 90px;
    cursor: pointer;
    position: relative;
}

.option-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text2);
    text-align: center;
    transition: all 0.2s;
    min-height: 70px;
    line-height: 1.3;
}

.option-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 5px;
}

.option-card.selected,
.option-label input:checked + .option-card {
    background: var(--green-dim);
    border-color: var(--green);
    color: var(--text);
}

.option-label:hover .option-card {
    border-color: rgba(92,197,167,0.5);
    background: rgba(92,197,167,0.06);
}

/* ── Nav buttons ─────────────────────────────────────────── */
.step-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.step-counter { font-size: 14px; color: var(--text2); }

/* ── Overlays ────────────────────────────────────────────── */
.da-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13,13,13,0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 9999;
}

.da-overlay p {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

/* ── Error ───────────────────────────────────────────────── */
.error-banner {
    background: rgba(231,76,60,0.12);
    border: 1px solid rgba(231,76,60,0.4);
    border-radius: 10px;
    padding: 12px 16px;
    color: #E74C3C;
    font-size: 14px;
    margin-top: 16px;
    display: none;
}

.error-banner.visible { display: block; }

/* ── Scorecard ───────────────────────────────────────────── */
.scorecard-hero {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 5px solid var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin: 20px 0;
    box-shadow: 0 0 40px rgba(92,197,167,0.25);
    transition: border-color 0.4s, box-shadow 0.4s;
}

.score-number {
    font-size: 44px;
    font-weight: 900;
    line-height: 1;
}

.score-label {
    font-size: 14px;
    color: var(--text2);
}

.stage-name {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 10px;
}

.stage-desc {
    color: var(--text2);
    font-size: 15px;
    line-height: 1.6;
    max-width: 560px;
    margin-bottom: 16px;
}

.stage-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--text2);
    font-size: 14px;
    font-weight: 500;
}

.dot { color: rgba(255,255,255,0.2); }

/* ── Focus area bars ─────────────────────────────────────── */
.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.section-sub {
    color: var(--text2);
    font-size: 14px;
    margin-bottom: 24px;
}

.fa-bar-row {
    margin-bottom: 16px;
}

.fa-bar-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.fa-name  { font-size: 14px; font-weight: 600; }
.fa-score { font-size: 14px; font-weight: 700; }

.fa-track {
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    overflow: hidden;
}

.fa-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.6s ease;
    background: var(--green);
}

/* ── Stage ladder ────────────────────────────────────────── */
.stage-ladder-card { }

.stage-ladder {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.ladder-rung {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.ladder-active {
    background: var(--green-dim);
    border-color: var(--green);
}

.ladder-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ladder-label {
    font-size: 14px;
    font-weight: 600;
}

/* ── CTA card ────────────────────────────────────────────── */
.cta-card {
    background: linear-gradient(135deg, rgba(92,197,167,0.08), rgba(92,197,167,0.03));
    border-color: rgba(92,197,167,0.25);
    text-align: center;
}

.cta-card h2 { margin-bottom: 10px; }
.cta-card p  { color: var(--text2); margin-bottom: 28px; font-size: 15px; line-height: 1.6; }

.cta-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .da-wrapper { padding: 20px 16px 60px; }
    .da-card { padding: 24px 18px; }
    h1 { font-size: 22px; }
    .options-grid { gap: 6px; }
    .option-card { padding: 10px 6px; min-height: 58px; font-size: 11px; }
    .option-value { font-size: 16px; }
    .step-nav { flex-wrap: wrap; }
    .btn-primary, .btn-secondary { flex: 1; text-align: center; }
    .score-circle { width: 110px; height: 110px; }
    .score-number { font-size: 36px; }
    .da-info-row { gap: 8px; }
    .da-info-chip { min-width: 100px; }
    .cta-buttons { flex-direction: column; }
    .cta-buttons button { width: 100%; }
}
