/* Authentication, questionnaire, audio manager — "Nebula" look. */

body[data-auth-page] { display: grid; place-items: center; min-height: 100vh; }
body[data-auth-page]::after {          /* decorative planet behind the card */
    content: ""; position: fixed; z-index: 0; width: min(64vw, 620px); aspect-ratio: 1; right: -14vw; bottom: -18vw; border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle at 30% 24%, var(--c1), var(--c2) 45%, var(--c3) 100%); opacity: .55; filter: blur(2px);
    box-shadow: 0 0 120px color-mix(in srgb, var(--c2) 50%, transparent);
}
.auth-shell { position: relative; z-index: 1; width: min(100% - 32px, 640px); margin: 5vh auto; padding-bottom: 48px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; color: var(--text); text-decoration: none; font-size: 22px; }
.auth-brand img { width: 46px; height: 58px; object-fit: contain; filter: drop-shadow(0 0 12px color-mix(in srgb, var(--c2) 70%, transparent)); }
body[data-theme="light"] .auth-brand img { filter: invert(1) hue-rotate(250deg) saturate(2); }
.auth-brand strong { font-weight: 800; letter-spacing: -.01em; }
.auth-card { padding: clamp(22px, 4vw, 40px); border: 1px solid var(--line); border-radius: 28px; background: color-mix(in srgb, var(--bg0) 60%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 30px 70px var(--shadow); }
body[data-theme="light"] .auth-card { background: rgba(255,255,255,.85); }
.auth-card h1 { font-size: clamp(28px, 4vw, 40px); margin-top: 0; }
.auth-card form, .auth-card form label { display: grid; gap: 10px; }
.auth-card form { margin: 18px 0; }
.auth-card .field { width: 100%; max-width: none; min-width: 0; margin: 0; }
.auth-card a { color: var(--c1); text-underline-offset: 3px; }
.auth-card a:hover, .auth-card a:focus-visible { color: var(--c2); }
.form-status { min-height: 1.5em; color: var(--c1); font-weight: 600; }
.form-status.error { color: #ff8a8a; }
.input-hint, .human-check small { color: var(--muted); font-size: 12px; }
.password-rules { display: grid; gap: 5px; margin: 3px 0 10px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.password-rules .passed { color: #7ee2a3; }
.password-rules .missing { color: var(--muted); }
.human-check { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.human-check .human-title { margin: 0; font-weight: 700; color: var(--text); }
.human-check .field { max-width: 180px; }

.questionnaire-progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0 22px; }
.questionnaire-progress span { height: 5px; border-radius: 999px; background: var(--line); }
.questionnaire-progress span.completed { background: linear-gradient(90deg, var(--c1), var(--c2)); box-shadow: 0 0 12px color-mix(in srgb, var(--c2) 60%, transparent); }
.questionnaire-step h2 { margin: 6px 0 8px; }
.questionnaire-search-label { display: block; margin-top: 16px; }
.questionnaire-step .field { width: 100%; max-width: none; min-width: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0; max-height: 46vh; overflow-y: auto; padding: 2px; }
.choice-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--panel); cursor: pointer; min-width: 0; overflow-wrap: anywhere; font-size: 13px; transition: border-color .2s, background .2s, transform .2s; }
.choice-item:hover { border-color: var(--c2); transform: translateY(-2px); }
.choice-item:has(input:checked) { border-color: var(--c1); background: color-mix(in srgb, var(--c2) 22%, transparent); }
.auth-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.auth-card, .questionnaire-step { min-width: 0; }

.local-audio-list { display: grid; gap: 12px; margin-top: 16px; }
.local-audio-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.local-audio-item audio { width: min(100%, 340px); }
.local-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

@media (max-width: 700px) { .auth-shell { width: min(100% - 24px, 640px); } .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .auth-shell { margin-top: 20px; } .local-audio-item { flex-direction: column; align-items: stretch; } }
@media (max-width: 420px) { .auth-shell { width: calc(100% - 20px); } .auth-card { padding: 18px; } .choice-grid { grid-template-columns: minmax(0, 1fr); } .auth-actions .btn { flex: 1 1 auto; } }
