/* ============================================================
   CHR Privacy Request Form — Front-end Styles
   WCAG 2.1 AA compliant focus, contrast, spacing
   ============================================================ */

/* ── Wrap ── */
.chr-prf-wrap {
    margin: 40px auto;
    padding: 0 16px;
}
.chr-prf-inner {
    max-width: 720px;
    margin: 0 auto;
}

/* ── Header ── */
.chr-prf-header {
    margin-bottom: 32px;
}
.chr-prf-title {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
    color: #0f2742;
    margin: 0 0 12px;
    line-height: 1.25;
}
.chr-prf-intro {
    font-size: 15px;
    color: #374151;
    line-height: 1.7;
    margin: 0;
    max-width: 640px;
}

/* ── Alert ── */
.chr-prf-alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
}
.chr-prf-alert--error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}
.chr-prf-alert--error ul {
    margin: 6px 0 0 16px;
    padding: 0;
}

/* ── Status (live region) ── */
.chr-prf-status {
    margin-bottom: 16px;
    font-size: 14px;
    min-height: 1em;
}
.chr-prf-status.is-success {
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 8px;
    padding: 12px 16px;
}
.chr-prf-status.is-error {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 12px 16px;
}

/* ── Form ── */
.chr-prf-form {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ── Rows ── */
.chr-prf-row {
    margin-bottom: 24px;
}
.chr-prf-row--split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 560px) {
    .chr-prf-row--split { grid-template-columns: 1fr; }
    .chr-prf-form { padding: 20px 16px; }
}

/* ── Field ── */
.chr-prf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── Label ── */
.chr-prf-label {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    display: block;
}
.chr-prf-req {
    color: #dc2626;
    margin-left: 2px;
}
.chr-prf-optional {
    font-weight: 400;
    color: #6b7280;
    font-size: 13px;
    margin-left: 4px;
}

/* ── Input / Textarea ── */
.chr-prf-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    color: #111827;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}
.chr-prf-input:hover {
    border-color: #9ca3af;
}
.chr-prf-input:focus {
    border-color: #3aa0ff;
    /* WCAG 2.2 Focus Visible — 3px offset ring */
    box-shadow: 0 0 0 3px rgba(58,160,255,.35);
}
.chr-prf-input[aria-invalid="true"] {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220,38,38,.2);
}
.chr-prf-textarea {
    resize: vertical;
    min-height: 110px;
}

/* ── Hint ── */
.chr-prf-hint {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

/* ── Field error ── */
.chr-prf-field-err {
    font-size: 13px;
    color: #dc2626;
    font-weight: 500;
    min-height: 1em;
    display: block;
    /* Hidden until populated */
}
.chr-prf-field-err:empty { display: none; }

/* ── Fieldset / Legend ── */
.chr-prf-fieldset {
    border: none;
    margin: 0;
    padding: 0;
}
.chr-prf-fieldset > .chr-prf-label {
    margin-bottom: 10px;
}

/* ── Radio group ── */
.chr-prf-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chr-prf-radio-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    line-height: 1.5;
}
.chr-prf-radio {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 1px;
    accent-color: #0f2742;
    cursor: pointer;
}
.chr-prf-radio:focus {
    outline: 3px solid rgba(58,160,255,.5);
    outline-offset: 2px;
}

/* ── Checkbox ── */
.chr-prf-field--check {
    flex-direction: column;
    gap: 6px;
}
.chr-prf-check-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    line-height: 1.6;
}
.chr-prf-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: #0f2742;
    cursor: pointer;
}
.chr-prf-checkbox:focus {
    outline: 3px solid rgba(58,160,255,.5);
    outline-offset: 2px;
}

/* ── Required note ── */
.chr-prf-req-note {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 24px;
}

/* ── Actions ── */
.chr-prf-actions {
    margin-bottom: 16px;
}

/* ── Button ── */
.chr-prf-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0f2742;
    color: #fff;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
    text-decoration: none;
}
.chr-prf-btn:hover {
    background: #153355;
}
.chr-prf-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(58,160,255,.5);
}
.chr-prf-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}
.chr-prf-btn--outline {
    background: transparent;
    color: #0f2742;
    border-color: #0f2742;
}
.chr-prf-btn--outline:hover {
    background: #f0f4f8;
}

/* ── Spinner (button loading state) ── */
.chr-prf-btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
}
@keyframes chr-spin { to { transform: rotate(360deg); } }
.chr-prf-btn.is-loading .chr-prf-btn-spinner {
    display: block;
    animation: chr-spin .7s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
    .chr-prf-btn-spinner { animation: none; }
}

/* ── Legal note ── */
.chr-prf-legal {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}
.chr-prf-link {
    color: #1a56db;
    text-decoration: underline;
}
.chr-prf-link:focus {
    outline: 3px solid rgba(58,160,255,.5);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ── Honeypot ── */
.chr-prf-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* ── Authorized agent note ── */
.chr-prf-agent-note {
    margin-top: 32px;
    padding: 20px 24px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    line-height: 1.7;
}
.chr-prf-agent-note h3 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: #0f2742;
}
.chr-prf-agent-note p { margin: 0; }

/* ── Confirmation ── */
.chr-prf-confirm {
    text-align: center;
    padding: 48px 32px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}
.chr-prf-confirm-icon {
    margin-bottom: 20px;
}
.chr-prf-confirm-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f2742;
    margin: 0 0 12px;
}
.chr-prf-confirm p {
    color: #374151;
    font-size: 15px;
    margin: 0 0 24px;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

/* ── High-contrast mode support ── */
@media (forced-colors: active) {
    .chr-prf-input:focus,
    .chr-prf-btn:focus,
    .chr-prf-radio:focus,
    .chr-prf-checkbox:focus {
        outline: 3px solid ButtonText;
    }
}
