/* ═══════════════════════════════════════════════════════════════
   RSP S.T.A.R. Screening — v1.0.0
   Matches rsp-leucovorin-consent design system
   ═══════════════════════════════════════════════════════════════ */

.rsp-star-wrap *,
.rsp-star-wrap *::before,
.rsp-star-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; }

.rsp-star-wrap {
    --navy:         #002470;
    --navy-dark:    #001D5C;
    --navy-grad:    #003087;
    --orange:       #E8731A;
    --orange-hover: #D4650F;
    --white:        #FFFFFF;
    --g50:          #F8F9FA;
    --g100:         #F1F3F5;
    --g200:         #E2E6EA;
    --g300:         #CED4DA;
    --g400:         #ADB5BD;
    --g500:         #868E96;
    --g600:         #6C757D;
    --g700:         #495057;
    --g800:         #343A40;
    --red:          #C0392B;
    --red-light:    #FDEDEC;
    --green:        #27AE60;
    --green-light:  #EAFAF1;
    --yellow:       #F39C12;
    --yellow-light: #FFF8E1;
    --radius:       8px;
    --shadow:       0 4px 20px rgba(0,36,112,0.08);
    --transition:   0.25s cubic-bezier(0.4,0,0.2,1);

    max-width: 780px;
    margin: 32px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--g800);
    -webkit-font-smoothing: antialiased;
}

/* ─── Header ─── */
.rsp-star-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-grad) 60%, #003890 100%);
    padding: 28px 36px;
    text-align: center;
    border-radius: var(--radius) var(--radius) 0 0;
    position: relative;
    overflow: hidden;
}
.rsp-star-header::before {
    content: '';
    position: absolute;
    top: -50%; right: -15%;
    width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(232,115,26,0.06) 0%, transparent 70%);
    pointer-events: none;
}
.rsp-star-header h1 {
    color: var(--white);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 4px;
    line-height: 1.3;
}
.rsp-star-header .rsp-star-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 0.82rem;
    font-weight: 400;
    margin: 0;
}
.rsp-star-header .rsp-star-version {
    display: inline-block;
    margin-top: 10px;
    background: rgba(232,115,26,0.16);
    color: #FFB366;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 20px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ─── Step Indicator ─── */
.rsp-star-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 24px;
    background: var(--white);
    border-left: 1px solid var(--g200);
    border-right: 1px solid var(--g200);
}
.rsp-star-step-tab {
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--g400);
    white-space: nowrap;
    transition: color var(--transition);
}
.rsp-star-step-tab.active { color: var(--navy); font-weight: 600; }
.rsp-star-step-tab.completed { color: var(--green); }
.rsp-star-dot {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    margin-right: 4px;
    background: var(--g200);
    color: var(--g500);
    transition: all var(--transition);
    flex-shrink: 0;
}
.rsp-star-step-tab.active .rsp-star-dot {
    background: var(--navy);
    color: var(--white);
    box-shadow: 0 0 0 3px rgba(0,36,112,0.15);
}
.rsp-star-step-tab.completed .rsp-star-dot {
    background: var(--green);
    color: var(--white);
}
.rsp-star-connector {
    width: 20px; height: 2px;
    background: var(--g200);
    margin: 0 4px;
    border-radius: 2px;
    flex-shrink: 0;
    transition: background var(--transition);
}
.rsp-star-connector.done { background: var(--green); }

/* ─── Form Body ─── */
.rsp-star-body {
    background: var(--white);
    border: 1px solid var(--g200);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 0 36px 36px;
    box-shadow: var(--shadow);
}

/* ─── Panels ─── */
.rsp-star-panel { display: none; animation: rspStarFade 0.3s ease; }
.rsp-star-panel.active { display: block; }
@keyframes rspStarFade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.rsp-star-panel .step-count {
    font-size: 0.75rem;
    color: var(--g500);
    margin-bottom: 4px;
    font-weight: 500;
    padding-top: 24px;
}
.rsp-star-panel h2 {
    font-size: 1.2rem;
    color: var(--navy);
    margin-bottom: 18px;
    font-weight: 700;
    line-height: 1.3;
}

/* ─── Info Panels ─── */
.rsp-star-info {
    background: var(--g50);
    border: 1px solid var(--g200);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 18px;
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--g700);
}
.rsp-star-info strong { color: var(--navy); }

/* ─── Fields ─── */
.rsp-star-field { margin-bottom: 16px; }
.rsp-star-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--g700);
    margin-bottom: 5px;
}
.rsp-star-field label .req { color: var(--orange); margin-left: 2px; }
.rsp-star-field input[type="text"],
.rsp-star-field input[type="email"],
.rsp-star-field input[type="tel"],
.rsp-star-field input[type="date"],
.rsp-star-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--g300);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--g800);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.rsp-star-field input:focus, .rsp-star-field select:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(0,36,112,0.1);
}
.rsp-star-field .hint { font-size: 0.75rem; color: var(--g500); margin-top: 4px; }
.rsp-star-field.error input { border-color: var(--red); background: var(--red-light); }
.rsp-star-field .error-msg { font-size: 0.75rem; color: var(--red); margin-top: 3px; display: none; }
.rsp-star-field.error .error-msg { display: block; }
.rsp-star-row { display: flex; gap: 16px; }
.rsp-star-row > .rsp-star-field { flex: 1; }

/* ─── Question Rows ─── */
.rsp-star-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: var(--g50);
    border: 1px solid var(--g200);
    border-radius: var(--radius);
    margin-bottom: 8px;
    transition: all var(--transition);
}
.rsp-star-q:hover { border-color: var(--g300); }
.rsp-star-q.answered { background: var(--green-light); border-color: #A3E4B8; }
.rsp-star-q.unanswered-error { border-color: var(--red); background: var(--red-light); }
.rsp-star-q .q-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--navy);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}
.rsp-star-q .q-text {
    flex: 1;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--g700);
}
.rsp-star-q .q-btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.rsp-star-q .q-btn {
    padding: 6px 16px;
    border-radius: var(--radius);
    border: 1.5px solid var(--g300);
    background: var(--white);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--g600);
}
.rsp-star-q .q-btn:hover { border-color: var(--navy); color: var(--navy); }
.rsp-star-q .q-btn.selected-yes {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}
.rsp-star-q .q-btn.selected-no {
    background: var(--orange);
    color: var(--white);
    border-color: var(--orange);
}

/* ─── Navigation ─── */
.rsp-star-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--g200);
}
.rsp-star-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    line-height: 1.4;
}
.rsp-star-btn-back {
    background: transparent;
    color: var(--g600);
    border: 1.5px solid var(--g300);
}
.rsp-star-btn-back:hover { background: var(--g100); color: var(--g800); }
.rsp-star-btn-next { background: var(--navy); color: var(--white); }
.rsp-star-btn-next:hover { background: #003590; }
.rsp-star-btn-submit { background: var(--orange); color: var(--white); padding: 12px 30px; font-size: 0.9rem; }
.rsp-star-btn-submit:hover { background: var(--orange-hover); }
.rsp-star-btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* ─── Review ─── */
.rsp-star-review {
    background: var(--g50);
    border: 1px solid var(--g200);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 12px;
}
.rsp-star-review h3 {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 8px;
}
.rsp-star-rv-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.83rem;
    border-bottom: 1px solid var(--g200);
}
.rsp-star-rv-row:last-child { border: none; }
.rsp-star-rv-label { color: var(--g500); }
.rsp-star-rv-value { color: var(--g800); font-weight: 500; text-align: right; }

/* ─── Success ─── */
.rsp-star-success { display: none; text-align: center; padding: 40px 20px; animation: rspStarFade 0.5s ease; }
.rsp-star-success .check-circle {
    width: 64px; height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.rsp-star-success .check-circle svg { width: 32px; height: 32px; }
.rsp-star-success h2 { color: var(--navy); font-size: 1.25rem; margin: 0 0 8px; font-weight: 700; }
.rsp-star-success p { color: var(--g600); font-size: 0.88rem; max-width: 480px; margin: 0 auto 20px; }
.rsp-star-dl-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--navy); font-weight: 600; font-size: 0.88rem;
    text-decoration: none; padding: 10px 20px;
    border: 1.5px solid var(--navy); border-radius: var(--radius);
    transition: all var(--transition); cursor: pointer;
}
.rsp-star-dl-link:hover { background: var(--navy); color: var(--white); }
.rsp-star-save-info {
    background: var(--g50); border: 1px solid var(--g200); border-radius: var(--radius);
    padding: 18px 20px; margin: 16px auto 0; text-align: left;
    font-size: 0.82rem; line-height: 1.6; color: var(--g700); max-width: 480px;
}
.rsp-star-save-info h4 { font-size: 0.78rem; font-weight: 700; color: var(--navy); margin: 0 0 6px; }

/* ─── Risk result badges (on success screen) ─── */
.rsp-star-result-badge {
    display: inline-block; padding: 8px 20px; border-radius: var(--radius);
    font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    margin-bottom: 16px;
}
.rsp-star-result-low    { background: var(--green-light); color: var(--green); }
.rsp-star-result-medium { background: var(--yellow-light); color: var(--yellow); }
.rsp-star-result-high   { background: var(--red-light); color: var(--red); }

/* ─── Honeypot ─── */
.rsp-star-hp { position: absolute; left: -9999px; opacity: 0; height: 0; }

/* ─── Responsive ─── */
@media (max-width: 640px) {
    .rsp-star-wrap { margin: 16px auto; }
    .rsp-star-header { padding: 22px 18px; }
    .rsp-star-header h1 { font-size: 1.1rem; }
    .rsp-star-body { padding: 0 18px 24px; }
    .rsp-star-steps { padding: 14px 10px; overflow-x: auto; }
    .rsp-star-step-tab { font-size: 0; }
    .rsp-star-dot { margin-right: 0; }
    .rsp-star-step-tab.active { font-size: 0.65rem; }
    .rsp-star-step-tab.active .rsp-star-dot { margin-right: 4px; }
    .rsp-star-connector { width: 12px; margin: 0 2px; }
    .rsp-star-row { flex-direction: column; gap: 0; }
    .rsp-star-q { flex-direction: column; align-items: flex-start; gap: 10px; }
    .rsp-star-q .q-btns { align-self: flex-end; }
}
