/**
 * Filepath: plugins/bluepip-assessment/public/css/bpas-public.css
 * Bluepip Assessment — Public Styles
 */

/* ── Wrap & Layout ──────────────────────────────────────────────────── */
.bpas-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px 60px;
    font-family: 'Nunito Sans', 'Segoe UI', sans-serif;
    color: #1E293B;
    position: relative;
}

.bpas-screen { display: block; }

/* ── Header ─────────────────────────────────────────────────────────── */
.bpas-header {
    text-align: center;
    padding: 24px 0 20px;
}
.bpas-header h2 {
    font-size: clamp(22px, 5vw, 30px);
    font-weight: 800;
    color: #0F172A;
    margin: 0 0 8px;
}
.bpas-header p {
    font-size: 15px;
    color: #64748B;
    margin: 0;
}

/* ── Card ───────────────────────────────────────────────────────────── */
.bpas-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ── Form rows ──────────────────────────────────────────────────────── */
.bpas-form-row { margin-bottom: 16px; }
.bpas-form-row label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}
.bpas-form-row small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #94A3B8;
}
.bpas-form-row-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 0;
}
@media (max-width: 480px) {
    .bpas-form-row-half { grid-template-columns: 1fr; }
}

/* ── Inputs ─────────────────────────────────────────────────────────── */
.bpas-input,
.bpas-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #1E293B;
    background: #F8FAFC;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.bpas-input:focus,
.bpas-select:focus {
    outline: none;
    border-color: #1B4FBF;
    background: #fff;
}

/* ── Info box ───────────────────────────────────────────────────────── */
.bpas-info-box {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: #1E3A8A;
    line-height: 1.5;
}
.bpas-info-box p { margin: 0; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.bpas-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.18s;
    text-decoration: none;
    font-family: inherit;
}
.bpas-btn-full { width: 100%; }
.bpas-btn-primary {
    background: #1B4FBF;
    color: #fff;
    border-color: #1B4FBF;
}
.bpas-btn-primary:hover { background: #1540A0; }
.bpas-btn-outline {
    background: transparent;
    color: #1B4FBF;
    border-color: #1B4FBF;
}
.bpas-btn-outline:hover { background: #EFF6FF; }
.bpas-btn-success {
    background: #059669;
    color: #fff;
    border-color: #059669;
}
.bpas-btn-success:hover { background: #047857; }
.bpas-btn-gold {
    background: #C9A63A;
    color: #fff;
    border-color: #C9A63A;
    font-size: 15px;
    padding: 14px 28px;
}
.bpas-btn-gold:hover { background: #B8922E; }
.bpas-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Error message ──────────────────────────────────────────────────── */
.bpas-error-msg {
    background: #FEE2E2;
    border: 1px solid #FECACA;
    border-radius: 8px;
    color: #991B1B;
    padding: 10px 14px;
    font-size: 13px;
    margin-top: 12px;
}

/* ── Quiz header ────────────────────────────────────────────────────── */
.bpas-quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 8px;
    flex-wrap: wrap;
    gap: 8px;
}
.bpas-quiz-meta { display: flex; gap: 16px; align-items: center; }
.bpas-quiz-subject {
    font-weight: 700;
    font-size: 15px;
    color: #1B4FBF;
}
.bpas-quiz-progress {
    font-size: 13px;
    color: #64748B;
}
.bpas-timer-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #F1F5F9;
    padding: 6px 14px;
    border-radius: 99px;
}
.bpas-timer {
    font-weight: 800;
    font-size: 16px;
    color: #1E293B;
    font-variant-numeric: tabular-nums;
    min-width: 52px;
}
.bpas-timer-warning { color: #D97706 !important; }
.bpas-timer-critical { color: #DC2626 !important; animation: bpas-blink 1s step-end infinite; }
@keyframes bpas-blink { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── Progress bar ───────────────────────────────────────────────────── */
.bpas-progress-bar-wrap {
    height: 6px;
    background: #E2E8F0;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 16px;
}
.bpas-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #1B4FBF, #C9A63A);
    border-radius: 99px;
    transition: width 0.3s ease;
}

/* ── Question card ──────────────────────────────────────────────────── */
.bpas-question-card { padding: 24px; }
.bpas-question-num {
    font-size: 12px;
    font-weight: 700;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 10px;
}
.bpas-question-text {
    font-size: 16px;
    font-weight: 600;
    color: #0F172A;
    line-height: 1.55;
    margin-bottom: 20px;
}

/* ── Options ────────────────────────────────────────────────────────── */
.bpas-options { display: flex; flex-direction: column; gap: 10px; }
.bpas-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: #F8FAFC;
}
.bpas-option:hover { border-color: #93C5FD; background: #EFF6FF; }
.bpas-option-selected {
    border-color: #1B4FBF !important;
    background: #EFF6FF !important;
}
.bpas-option input[type="radio"] { display: none; }
.bpas-option-letter {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: #E2E8F0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    color: #475569;
    transition: background 0.15s, color 0.15s;
}
.bpas-option-selected .bpas-option-letter {
    background: #1B4FBF;
    color: #fff;
}
.bpas-option-text {
    font-size: 14px;
    color: #1E293B;
    line-height: 1.45;
    padding-top: 4px;
}

/* ── Save indicator ─────────────────────────────────────────────────── */
.bpas-save-indicator {
    text-align: right;
    font-size: 12px;
    color: #059669;
    font-weight: 600;
    margin-top: 8px;
}

/* ── Navigation ─────────────────────────────────────────────────────── */
.bpas-quiz-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.bpas-q-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    flex: 1;
    justify-content: center;
}
.bpas-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #E2E8F0;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.bpas-dot:hover { transform: scale(1.2); }
.bpas-dot-answered { background: #93C5FD; }
.bpas-dot-active { background: #1B4FBF; transform: scale(1.3); }

/* ── Results: score grid ─────────────────────────────────────────────── */
.bpas-score-card { text-align: center; }
.bpas-score-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
@media (max-width: 440px) {
    .bpas-score-grid { grid-template-columns: repeat(2, 1fr); }
}
.bpas-score-big {
    font-size: clamp(24px, 7vw, 36px);
    font-weight: 900;
    color: #1B4FBF;
    line-height: 1;
    display: block;
}
.bpas-score-label {
    font-size: 12px;
    color: #64748B;
    margin-top: 4px;
    display: block;
}
.bpas-band-badge {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 99px;
    font-weight: 700;
    font-size: 14px;
    margin-top: 8px;
}

/* ── Gap report ─────────────────────────────────────────────────────── */
.bpas-gap-title {
    font-size: 15px;
    font-weight: 700;
    color: #1B4FBF;
    margin: 0 0 6px;
}
.bpas-gap-intro {
    font-size: 13px;
    color: #64748B;
    margin: 0 0 16px;
}
.bpas-topic-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.bpas-topic-weak {
    background: #FEF2F2;
    border-color: #FECACA;
}
.bpas-warn-icon { font-size: 18px; flex-shrink: 0; }
.bpas-topic-info { flex: 1; min-width: 120px; }
.bpas-topic-name { font-weight: 700; font-size: 13px; color: #1E293B; }
.bpas-topic-score { font-size: 12px; color: #64748B; margin-top: 2px; }
.bpas-topic-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    flex: 1;
}
.bpas-topic-bar-wrap { position: relative; }
.bpas-topic-bar {
    height: 8px;
    border-radius: 99px;
    transition: width 0.5s;
    flex: 1;
    max-width: 100%;
}
.bpas-topic-pct { font-size: 12px; font-weight: 700; white-space: nowrap; }
.bpas-band-pill {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

/* ── CTA card ───────────────────────────────────────────────────────── */
.bpas-cta-card h3 {
    font-size: 18px;
    font-weight: 800;
    color: #0F172A;
    margin: 0 0 8px;
}
.bpas-cta-card p { font-size: 14px; color: #475569; margin: 0 0 16px; }
.bpas-result-icon { font-size: 52px; line-height: 1; margin-bottom: 8px; }

/* ── Loading overlay ────────────────────────────────────────────────── */
.bpas-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.88);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.bpas-loading-overlay p {
    font-size: 15px;
    font-weight: 600;
    color: #1B4FBF;
}
.bpas-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #BFDBFE;
    border-top-color: #1B4FBF;
    border-radius: 50%;
    animation: bpas-spin 0.75s linear infinite;
}
@keyframes bpas-spin { to { transform: rotate(360deg); } }
