/* Sign-up, verification and onboarding (U-FORM, U-ONB).
   Themed only through styles.css tokens, so dark and light both work.
   Compact buttons use .btn-inline, which the mobile full-width button rule
   in styles.css already excludes. */

/* ── Field help, errors and invalid state ── */
.field-help {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
}
.field-error {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--accent-danger);
}
.field-error:empty { display: none; }
input[aria-invalid="true"] {
    border-color: var(--accent-danger);
}
input[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 3px var(--accent-danger-muted);
}
.form-error-summary {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--accent-danger-muted);
    color: var(--accent-danger);
    font-size: 14px;
}
.form-error-summary:empty { display: none; }

/* Given + family side by side when there is room. */
.name-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 12px;
}
@media (min-width: 480px) {
    .name-row { grid-template-columns: 1fr 1fr; }
}

/* Native checkbox/radio: styles.css gives every input width:100% and
   appearance:none, which would erase them. */
.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -6px 0 18px;
}
.check-row input[type="checkbox"],
.onb-intent input[type="radio"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    padding: 0;
    margin: 0;
    -webkit-appearance: auto;
    appearance: auto;
    accent-color: var(--accent-primary);
}
.check-row label {
    margin: 0;
    font-size: 14px;
    cursor: pointer;
}
.optional-tag {
    font-weight: 400;
    color: var(--text-muted);
}

/* ── Password with show/hide ── */
.pw-wrap {
    display: flex;
    align-items: stretch;
    gap: 8px;
}
.pw-wrap input { flex: 1; min-width: 0; }
button.pw-toggle {
    flex: none;
    padding: 0 12px;
    font-size: 13px;
    min-width: 64px;
}
.pw-checklist {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    font-size: 12px;
    color: var(--text-muted);
}
.pw-checklist li::before {
    content: "○";
    display: inline-block;
    width: 1.2em;
}
.pw-checklist li.ok {
    color: var(--accent-success);
}
.pw-checklist li.ok::before { content: "✓"; }

/* ── Pending submit ── */
button[aria-busy="true"] {
    cursor: progress;
}

.auth-legal {
    margin: 12px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
    text-align: center;
}
.auth-legal a { color: var(--accent-primary); }

/* ── Role picker cards are keyboard-operable ── */
[data-role-card]:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}
.role-price {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Verification panel ── */
.verify-panel h2 { margin-bottom: 8px; }
.verify-address {
    font-weight: 600;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}
/* Headings receive focus programmatically (tabindex=-1) so screen readers
   announce the new step; they are not interactive, so no focus ring. */
.verify-panel h2:focus,
.onb-step h2:focus { outline: none; }
.verify-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 18px 0 10px;
}
.verify-help {
    margin-top: 14px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}
.verify-help summary { cursor: pointer; color: var(--accent-primary); }
.verify-help ul { margin: 8px 0 0 18px; padding: 0; }

/* ── Onboarding page ── */
.onb-shell {
    max-width: 640px;
    margin: 0 auto;
}
.onb-step[hidden] { display: none; }
.onb-intents {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0 20px;
    padding: 0;
    border: none;
}
.onb-intents legend {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.onb-intent {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--input-bg);
    cursor: pointer;
    margin: 0;
}
.onb-intent:has(input:checked) {
    border-color: var(--accent-primary);
    background: var(--accent-primary-muted);
}
.onb-intent:has(input:focus-visible) {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}
.onb-intent-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.onb-intent-desc {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.5;
}
.onb-list {
    list-style: none;
    margin: 16px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.onb-item {
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--input-bg);
}
.onb-item h3 {
    margin: 0 0 4px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.onb-item p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}
.onb-item[data-state="done"] h3::before { content: "✓"; color: var(--accent-success); }
.onb-item[data-state="skipped"] h3::before { content: "–"; color: var(--text-muted); }
.onb-item-status {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}
.onb-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.onb-item-actions a.onb-action {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    border-radius: 10px;
    background: var(--accent-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}
.onb-item-actions button { font-size: 14px; padding: 9px 16px; }
.onb-inline-form {
    margin-top: 12px;
}
.onb-inline-form .form-group { margin-bottom: 10px; }
.onb-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}
.onb-host-copy {
    margin: 0 0 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Dashboard "Getting started" card ── */
.onb-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.onb-card-head h2 { margin: 0; border: none; padding: 0; font-size: 18px; }
.onb-progress-text { margin: 8px 0 6px; font-size: 13px; color: var(--text-secondary); }
.onb-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    overflow: hidden;
}
.onb-bar span {
    display: block;
    height: 100%;
    background: var(--accent-primary);
}
.onb-next { margin: 12px 0; font-size: 14px; }
a.onb-continue {
    display: inline-flex;
    padding: 10px 18px;
    border-radius: 10px;
    background: var(--accent-primary);
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

/* Visually hidden, still read by screen readers. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
