/* RSP Pediatric Intake Form — Frontend Styles */
/* Matches the rsp-auth-form design language: navy header, step tabs, clean white body */

.rsp-intake-wrap {
    max-width: 640px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e3e5e8;
    overflow: hidden;
}

/* ── Header ─────────────────────────────────── */
.rsp-intake-header {
    background: #1B3A5C;
    padding: 18px 24px;
}
.rsp-intake-header-inner {
    display: flex;
    align-items: center;
    gap: 14px;
}
.rsp-intake-logo {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: contain;
}
.rsp-intake-header-text h2 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.3;
}
.rsp-intake-header-text p {
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    margin: 2px 0 0;
}

/* ── Step Tabs ──────────────────────────────── */
.rsp-intake-steps {
    display: flex;
    border-bottom: 1px solid #e8eaed;
    overflow-x: auto;
    scrollbar-width: none;
}
.rsp-intake-steps::-webkit-scrollbar { display: none; }
.rsp-step {
    flex: 1;
    padding: 11px 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    color: #a0a8b2;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}
.rsp-step:hover { color: #6b7a8a; }
.rsp-step.active {
    color: #1B3A5C;
    font-weight: 600;
    border-bottom-color: #D4740E;
}
.rsp-step.done { color: #6b7a8a; }

/* ── Form Body ──────────────────────────────── */
.rsp-intake-body { padding: 24px; }
.rsp-step-counter {
    font-size: 11px;
    color: #a0a8b2;
    margin: 0 0 4px;
}
.rsp-intake-panel h3 {
    font-size: 17px;
    font-weight: 600;
    color: #1B3A5C;
    margin: 0 0 4px;
}
.rsp-hint {
    font-size: 13px;
    color: #8a95a2;
    margin: 0 0 20px;
    line-height: 1.5;
}

/* ── Panels ─────────────────────────────────── */
.rsp-intake-panel { display: none; }
.rsp-intake-panel.active { display: block; }

/* ── Fields ─────────────────────────────────── */
.rsp-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}
.rsp-field {
    margin-bottom: 14px;
}
.rsp-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #5a6a7a;
    margin-bottom: 5px;
}
.rsp-field label .req { color: #D4740E; }
.rsp-field input[type="text"],
.rsp-field input[type="date"],
.rsp-field input[type="number"],
.rsp-field input[type="email"],
.rsp-field select,
.rsp-field textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 14px;
    color: #1B3A5C;
    background: #fff;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.rsp-field input:focus,
.rsp-field select:focus,
.rsp-field textarea:focus {
    border-color: #1B3A5C;
    box-shadow: 0 0 0 2px rgba(27,58,92,0.1);
}
.rsp-field textarea { resize: vertical; min-height: 60px; }
.rsp-field input.rsp-error,
.rsp-field select.rsp-error {
    border-color: #d94040;
    box-shadow: 0 0 0 2px rgba(217,64,64,0.12);
}

/* ── Radio Groups ───────────────────────────── */
.rsp-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.rsp-radio-group label {
    font-size: 13px;
    color: #5a6a7a;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    margin-bottom: 0;
}
.rsp-radio-group input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #1B3A5C;
}

/* ── Yes/No Buttons ─────────────────────────── */
.rsp-yn-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid #f2f3f5;
    gap: 12px;
}
.rsp-yn-label {
    font-size: 13px;
    color: #5a6a7a;
    flex: 1;
    line-height: 1.4;
}
.rsp-yn-btns { display: flex; gap: 6px; flex-shrink: 0; }
.rsp-yn {
    padding: 5px 16px;
    border: 1px solid #d0d5dd;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7a8a;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
}
.rsp-yn:hover { background: #f6f8fa; }
.rsp-yn.selected[data-val="Yes"] {
    background: #1B3A5C;
    color: #fff;
    border-color: #1B3A5C;
}
.rsp-yn.selected[data-val="No"] {
    background: #f0f1f3;
    color: #1B3A5C;
    border-color: #d0d5dd;
}

/* ── Checkboxes ─────────────────────────────── */
.rsp-check-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
    margin-bottom: 16px;
}
.rsp-check-grid label {
    font-size: 13px;
    color: #5a6a7a;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.rsp-check-grid input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1B3A5C;
}

/* ── Conditional Fields ─────────────────────── */
.rsp-conditional {
    display: none;
    padding: 8px 0 4px 12px;
    border-left: 2px solid #D4740E;
    margin: 6px 0 10px;
}
.rsp-conditional.visible { display: block; }

/* ── Navigation ─────────────────────────────── */
.rsp-intake-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #f0f1f3;
}
.rsp-btn-back {
    font-size: 13px;
    font-weight: 500;
    color: #8a95a2;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 4px;
}
.rsp-btn-back:hover { color: #1B3A5C; }
.rsp-btn-next {
    padding: 10px 26px;
    background: #1B3A5C;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.rsp-btn-next:hover { background: #15304d; }
.rsp-btn-next:disabled {
    background: #a0a8b2;
    cursor: not-allowed;
}
.rsp-btn-next.submitting {
    pointer-events: none;
    opacity: 0.7;
}

/* ── Review Box ─────────────────────────────── */
.rsp-review-box {
    background: #f6f8fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    max-height: 340px;
    overflow-y: auto;
}
.rsp-review-section {
    margin-bottom: 12px;
}
.rsp-review-section h4 {
    font-size: 11px;
    font-weight: 700;
    color: #D4740E;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 6px;
    padding-bottom: 3px;
    border-bottom: 1px solid #e8eaed;
}
.rsp-review-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 12.5px;
    gap: 12px;
}
.rsp-review-row span:first-child { color: #6b7a8a; }
.rsp-review-row span:last-child { color: #1B3A5C; font-weight: 500; text-align: right; }

/* ── Consent ────────────────────────────────── */
.rsp-consent-row {
    margin: 16px 0 0;
}
.rsp-consent-row label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #5a6a7a;
    line-height: 1.5;
    cursor: pointer;
}
.rsp-consent-row input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: #1B3A5C;
    flex-shrink: 0;
}

/* ── Success Screen ─────────────────────────── */
.rsp-intake-success {
    text-align: center;
    padding: 48px 24px;
}
.rsp-success-icon {
    width: 56px;
    height: 56px;
    background: #e6f4ea;
    color: #1a8b3e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    margin: 0 auto 16px;
}
.rsp-intake-success h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1B3A5C;
    margin: 0 0 8px;
}
.rsp-intake-success p {
    font-size: 14px;
    color: #6b7a8a;
    margin: 0 0 8px;
    line-height: 1.6;
}
.rsp-success-note {
    font-size: 12px !important;
    color: #a0a8b2 !important;
    font-style: italic;
    margin-top: 16px !important;
    padding-top: 16px;
    border-top: 1px solid #e8eaed;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 520px) {
    .rsp-row { grid-template-columns: 1fr; }
    .rsp-check-grid { grid-template-columns: 1fr; }
    .rsp-yn-row { flex-direction: column; align-items: flex-start; gap: 6px; }
    .rsp-intake-body { padding: 18px 16px; }
}
