/**
 * RSP ASQ-3 Forms — Stylesheet
 * Matches rspeds.com release authorization form design language.
 *
 * @package RSP_ASQ3_Forms
 * @version 1.15.0
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --asq3-navy: #1a1a2e;
    --asq3-navy-light: #2d2d4a;
    --asq3-cream: #f5ede6;
    --asq3-cream-light: #faf7f4;
    --asq3-gold: #d4a574;
    --asq3-gold-dark: #b8864e;
    --asq3-text: #1a1a2e;
    --asq3-text-muted: #5a4a3a;
    --asq3-text-light: #8a7a6a;
    --asq3-border: #d4c4b0;
    --asq3-success: #2d6a4f;
    --asq3-caution: #b8860b;
    --asq3-alert: #c0392b;
    --asq3-white: #ffffff;
    --asq3-radius: 8px;
    --asq3-radius-sm: 4px;
    --asq3-shadow: 0 2px 12px rgba(26,26,46,0.08);
    --asq3-shadow-lg: 0 4px 24px rgba(26,26,46,0.12);
    --asq3-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --asq3-transition: 0.25s ease;
}

/* ========================================
   Container & Layout
   ======================================== */
.rsp-asq3-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px;
    font-family: var(--asq3-font);
    color: var(--asq3-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.rsp-asq3-container {
    background: var(--asq3-white);
    border-radius: var(--asq3-radius);
    box-shadow: var(--asq3-shadow-lg);
    overflow: hidden;
    margin-bottom: 40px;
}

/* ========================================
   Header
   ======================================== */
.rsp-asq3-header {
    background: var(--asq3-navy);
    color: var(--asq3-white);
    padding: 28px 32px 24px;
    text-align: center;
}

.rsp-asq3-logo {
    height: 56px;
    width: auto;
    margin-bottom: 12px;
    display: inline-block;
}

.rsp-asq3-header h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 4px;
    letter-spacing: -0.01em;
    color: var(--asq3-white);
}

.rsp-asq3-subtitle {
    font-size: 13px;
    opacity: 0.75;
    margin: 0;
    font-weight: 400;
    color: var(--asq3-white);
}

/* ========================================
   Progress Bar
   ======================================== */
.rsp-asq3-progress {
    height: 4px;
    background: var(--asq3-cream);
    position: relative;
    overflow: hidden;
}

.rsp-asq3-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--asq3-gold), var(--asq3-gold-dark));
    width: 0%;
    transition: width 0.4s ease;
}

.rsp-asq3-step-labels {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px 0;
    font-size: 11px;
    color: var(--asq3-text-light);
    flex-wrap: wrap;
}

.rsp-asq3-step-label {
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--asq3-cream-light);
    transition: all var(--asq3-transition);
    white-space: nowrap;
}

.rsp-asq3-step-label.active {
    background: var(--asq3-gold);
    color: var(--asq3-white);
    font-weight: 600;
}

.rsp-asq3-step-label.completed {
    background: var(--asq3-navy);
    color: var(--asq3-white);
    opacity: 0.7;
}

/* ========================================
   Steps
   ======================================== */
.rsp-asq3-step {
    padding: 28px 32px 32px;
    animation: asq3FadeIn 0.3s ease;
}

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

.rsp-asq3-step-counter {
    font-size: 12px;
    color: var(--asq3-text-light);
    margin-bottom: 6px;
    font-weight: 500;
}

.rsp-asq3-step h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--asq3-navy);
    margin: 0 0 18px;
}

.rsp-asq3-step h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--asq3-navy);
    margin: 0 0 12px;
}

.rsp-asq3-section-intro {
    font-size: 14px;
    color: var(--asq3-text-muted);
    margin-bottom: 20px;
}

.rsp-asq3-divider {
    border: none;
    border-top: 1px solid var(--asq3-border);
    margin: 24px 0;
}

/* ========================================
   Form Fields
   ======================================== */
.rsp-asq3-field-group {
    margin-bottom: 16px;
}

.rsp-asq3-field-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--asq3-text);
    margin-bottom: 5px;
}

.rsp-asq3-field-group label .required {
    color: var(--asq3-alert);
}

.rsp-asq3-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--asq3-font);
    border: 1.5px solid var(--asq3-border);
    border-radius: var(--asq3-radius-sm);
    background: var(--asq3-white);
    color: var(--asq3-text);
    transition: border-color var(--asq3-transition), box-shadow var(--asq3-transition);
    outline: none;
}

.rsp-asq3-input:focus {
    border-color: var(--asq3-gold);
    box-shadow: 0 0 0 3px rgba(212,165,116,0.2);
}

.rsp-asq3-input.error {
    border-color: var(--asq3-alert);
    box-shadow: 0 0 0 3px rgba(192,57,43,0.12);
}

.rsp-asq3-input-short {
    max-width: 120px;
}

.rsp-asq3-textarea {
    resize: vertical;
    min-height: 50px;
}

.rsp-asq3-field-note {
    font-size: 12px;
    color: var(--asq3-text-light);
    margin-top: 4px;
}

.rsp-asq3-field-row {
    display: flex;
    gap: 16px;
}

.rsp-asq3-half {
    flex: 1;
}

select.rsp-asq3-input {
    appearance: auto;
    cursor: pointer;
}

/* Radio rows for age selector */
.rsp-asq3-radio-row {
    display: flex;
    gap: 20px;
    margin-top: 4px;
}

.rsp-asq3-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 400 !important;
}

/* ========================================
   Question Blocks
   ======================================== */
.rsp-asq3-question {
    padding: 16px 0;
    border-bottom: 1px solid var(--asq3-cream);
}

.rsp-asq3-question:last-of-type {
    border-bottom: none;
}

.rsp-asq3-question-text {
    font-size: 14px;
    color: var(--asq3-text);
    margin: 0 0 10px;
    line-height: 1.55;
}

.rsp-asq3-q-num {
    font-weight: 700;
    color: var(--asq3-navy);
    margin-right: 4px;
}

.rsp-asq3-question-note {
    font-size: 12px;
    color: var(--asq3-text-light);
    margin: -6px 0 10px;
    font-style: italic;
}

/* ========================================
   Response Options (Yes / Sometimes / Not Yet)
   ======================================== */
.rsp-asq3-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.rsp-asq3-option-label {
    cursor: pointer;
    flex: 1;
    min-width: 100px;
}

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

.rsp-asq3-option-box {
    display: block;
    text-align: center;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    border: 2px solid var(--asq3-border);
    border-radius: var(--asq3-radius-sm);
    background: var(--asq3-white);
    color: var(--asq3-text-muted);
    transition: all var(--asq3-transition);
}

.rsp-asq3-option-label input:checked + .rsp-asq3-option-box {
    border-color: var(--asq3-gold);
    background: var(--asq3-cream);
    color: var(--asq3-navy);
    box-shadow: 0 0 0 2px rgba(212,165,116,0.25);
}

.rsp-asq3-option-label:hover .rsp-asq3-option-box {
    border-color: var(--asq3-gold);
    background: var(--asq3-cream-light);
}

/* Unanswered highlight on validation */
.rsp-asq3-question.unanswered .rsp-asq3-options .rsp-asq3-option-box {
    border-color: var(--asq3-alert);
}

/* Overall yes/no narrower */
.rsp-asq3-options-yn .rsp-asq3-option-label {
    min-width: 80px;
    max-width: 120px;
    flex: 0 1 auto;
}

/* ========================================
   Info Boxes
   ======================================== */
.rsp-asq3-info-box {
    background: var(--asq3-cream-light);
    border: 1px solid var(--asq3-border);
    border-radius: var(--asq3-radius-sm);
    padding: 18px 20px;
    margin-bottom: 20px;
    font-size: 14px;
}

.rsp-asq3-info-box h4 {
    margin-bottom: 10px;
}

.rsp-asq3-info-list {
    padding-left: 18px;
    margin: 0;
}

.rsp-asq3-info-list li {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.rsp-asq3-info-warm {
    background: #fff8f0;
    border-color: var(--asq3-gold);
}

.rsp-asq3-info-warm p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
}

/* ========================================
   Buttons & Navigation
   ======================================== */
.rsp-asq3-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--asq3-cream);
}

.rsp-asq3-btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--asq3-font);
    border-radius: var(--asq3-radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--asq3-transition);
    text-decoration: none;
    text-align: center;
    line-height: 1.3;
}

.rsp-asq3-btn-primary {
    background: var(--asq3-navy);
    color: var(--asq3-white);
}

.rsp-asq3-btn-primary:hover {
    background: var(--asq3-navy-light);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(26,26,46,0.2);
}

.rsp-asq3-btn-secondary {
    background: transparent;
    color: var(--asq3-text-muted);
    border: 1.5px solid var(--asq3-border);
}

.rsp-asq3-btn-secondary:hover {
    background: var(--asq3-cream-light);
    border-color: var(--asq3-text-muted);
}

.rsp-asq3-btn-submit {
    background: var(--asq3-gold-dark);
    color: var(--asq3-white);
    padding: 14px 36px;
    font-size: 15px;
}

.rsp-asq3-btn-submit:hover {
    background: var(--asq3-gold);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(184,134,78,0.3);
}

.rsp-asq3-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========================================
   Review Summary
   ======================================== */
.rsp-asq3-review-summary {
    margin-bottom: 20px;
}

.rsp-asq3-review-section {
    margin-bottom: 16px;
}

.rsp-asq3-review-section h4 {
    font-size: 14px;
    color: var(--asq3-navy);
    margin-bottom: 6px;
    border-bottom: 1px solid var(--asq3-cream);
    padding-bottom: 4px;
}

.rsp-asq3-review-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
    font-size: 13px;
}

.rsp-asq3-review-grid .label {
    font-weight: 600;
    color: var(--asq3-text-muted);
}

.rsp-asq3-review-domain {
    background: var(--asq3-cream-light);
    border-radius: var(--asq3-radius-sm);
    padding: 10px 14px;
    margin-bottom: 8px;
    font-size: 13px;
}

.rsp-asq3-review-domain strong {
    color: var(--asq3-navy);
}

.rsp-asq3-review-responses {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.rsp-asq3-review-chip {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.rsp-asq3-review-chip.yes { background: #d4edda; color: #155724; }
.rsp-asq3-review-chip.sometimes { background: #fff3cd; color: #856404; }
.rsp-asq3-review-chip.not_yet { background: #f8d7da; color: #721c24; }

/* ========================================
   Success State
   ======================================== */
.rsp-asq3-success {
    padding: 48px 32px;
    text-align: center;
}

.rsp-asq3-success-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--asq3-success);
    color: var(--asq3-white);
    border-radius: 50%;
    font-size: 28px;
    line-height: 56px;
    font-weight: 700;
}

.rsp-asq3-success h3 {
    text-align: center;
    color: var(--asq3-navy);
    margin-bottom: 12px;
}

.rsp-asq3-success p {
    font-size: 14px;
    color: var(--asq3-text-muted);
    max-width: 480px;
    margin: 0 auto 20px;
}

.rsp-asq3-save-instructions {
    background: var(--asq3-cream-light);
    border: 1px solid var(--asq3-border);
    border-radius: var(--asq3-radius-sm);
    padding: 14px 18px;
    margin: 20px auto 0;
    max-width: 480px;
    font-size: 13px;
    color: var(--asq3-text-muted);
    text-align: left;
}

.rsp-asq3-save-instructions p {
    margin: 0;
    text-align: left;
    font-size: 13px;
}

/* ========================================
   Submit Status
   ======================================== */
.rsp-asq3-submit-status {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
}

.rsp-asq3-submit-status.loading {
    color: var(--asq3-text-light);
}

.rsp-asq3-submit-status.error {
    color: var(--asq3-alert);
    font-weight: 600;
}

/* ========================================
   Age Selector
   ======================================== */
.rsp-asq3-selector .rsp-asq3-selector-body {
    padding: 28px 32px 32px;
}

.rsp-asq3-intro {
    font-size: 14px;
    color: var(--asq3-text-muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

#rsp-asq3-selector-result {
    margin-top: 20px;
    padding: 18px 20px;
    border-radius: var(--asq3-radius-sm);
    font-size: 14px;
    animation: asq3FadeIn 0.3s ease;
}

#rsp-asq3-selector-result.found {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

#rsp-asq3-selector-result.not-found {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

#rsp-asq3-selector-result a {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 24px;
    background: var(--asq3-navy);
    color: var(--asq3-white);
    text-decoration: none;
    border-radius: var(--asq3-radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: all var(--asq3-transition);
}

#rsp-asq3-selector-result a:hover {
    background: var(--asq3-navy-light);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 600px) {
    .rsp-asq3-step {
        padding: 20px 18px 24px;
    }
    .rsp-asq3-header {
        padding: 22px 18px 18px;
    }
    .rsp-asq3-header h2 {
        font-size: 18px;
    }
    .rsp-asq3-field-row {
        flex-direction: column;
        gap: 0;
    }
    .rsp-asq3-options {
        flex-direction: column;
        gap: 8px;
    }
    .rsp-asq3-option-label {
        min-width: unset;
    }
    .rsp-asq3-nav {
        flex-direction: column-reverse;
        gap: 10px;
    }
    .rsp-asq3-nav .rsp-asq3-btn {
        width: 100%;
    }
    .rsp-asq3-review-grid {
        grid-template-columns: 1fr;
    }
    .rsp-asq3-selector-body {
        padding: 20px 18px 24px !important;
    }
}

/* ========================================
   Consent Checkbox (v1.15.0)
   ======================================== */
.rsp-asq3-consent-group {
    margin-top: 8px;
    padding: 12px 14px;
    background: var(--asq3-cream-light);
    border: 1px solid var(--asq3-border);
    border-radius: var(--asq3-radius-sm);
}

.rsp-asq3-checkbox-label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    cursor: pointer;
    font-weight: 400 !important;
    font-size: 13px !important;
    line-height: 1.5;
    color: var(--asq3-text-muted);
}

.rsp-asq3-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--asq3-gold-dark);
}

.rsp-asq3-checkbox-label em {
    color: var(--asq3-text-light);
}
