/* Вход, регистрация и подтверждение: одна задача на экране. */
body[data-auth="1"] { min-height: 100svh; display: flex; flex-direction: column; background: var(--surface); }
.auth-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px clamp(20px,4vw,64px); }
.auth-header .logo { gap: 10px; font-size: 18px; }
.auth-header form { margin: 0; }
.auth-header-link { display: inline-flex; align-items: center; min-height: 44px; border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; }
.auth-header-link:hover { color: var(--text); }
.auth-flow { width: min(100% - 40px,480px); margin: 24px auto 48px; padding: 0; }
.auth-flow--login { width: min(100% - 40px,420px); margin-top: clamp(36px,9vh,100px); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); margin-bottom: 28px; gap: 24px; }
.auth-tabs a { display: flex; align-items: center; justify-content: center; padding: 0 8px 16px; min-height: 48px; font-size: 20px; font-weight: 500; color: var(--text-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.auth-tabs a[aria-current="page"] { color: var(--text); border-color: var(--accent); font-weight: 650; }
.auth-flow .auth-form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.auth-flow .field { gap: 8px; min-width: 0; margin: 0; }
.auth-flow .field label { font-size: 14px; font-weight: 500; color: var(--text); }
.auth-flow .input { min-width: 0; width: 100%; min-height: 48px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; color: var(--text); font: 400 16px/1.4 Onest,sans-serif; caret-color: var(--accent); }
.auth-flow .input:hover { border-color: var(--field-line); }
.auth-flow .input:focus { border-color: var(--accent); outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.auth-flow .input::placeholder { color: var(--text-2); opacity: 1; }
.auth-field-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.auth-field-heading a { font-size: 13px; text-decoration: none; }
.auth-flow .pass-field { position: relative; }
.auth-flow .pass-field .input { padding-right: 48px; }
.auth-flow .auth-eye { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; right: 2px; display: flex; align-items: center; justify-content: center; color: var(--text-2); border: 0; background: transparent; border-radius: 6px; }
.auth-eye .ic { width: 20px; height: 20px; }
.auth-eye-slash { display: none; }
.auth-eye[aria-pressed="true"] .auth-eye-slash { display: block; }
.auth-password-grid, .auth-flow .auth-optional { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }
.auth-flow .registration-role { margin: 0; }
.auth-flow .registration-role legend { margin-bottom: 10px; font-size: 14px; }
.auth-flow .registration-role-options { padding: 4px; gap: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.auth-flow .registration-role-options span { min-height: 44px; padding: 10px 4px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 5px; }
.auth-flow .registration-role-options strong { font-size: 14px; font-weight: 500; }
.auth-flow .registration-role-options input:checked + span { border-color: var(--line); background: var(--surface); color: var(--text); }
.auth-flow .registration-role-options input:checked + span strong { font-weight: 650; }
.auth-flow .registration-role p { margin-top: 8px; font-size: 12px; }
.auth-field-note { display: block; margin: 0; color: var(--text-2); font-size: 12px; line-height: 1.5; }
.auth-flow .auth-details { padding: 0; border: 0; border-block: 1px solid var(--line); }
.auth-flow .auth-details :is([data-menu-trigger], .section-heading) { display: flex; gap: 12px; align-items: center; min-height: 44px; padding: 8px 0; font-size: 14px; color: var(--text); list-style: none; cursor: pointer; }
.auth-details :is([data-menu-trigger], .section-heading)::-webkit-details-marker { display: none; }
.auth-details :is([data-menu-trigger], .section-heading) > span { margin-left: auto; font-size: 12px; color: var(--text-2); }
.auth-details :is([data-menu-trigger], .section-heading) .ic { margin-left: auto; width: 16px; height: 16px; }
.auth-details :is([data-menu-trigger], .section-heading) > span + .ic { margin-left: 0; }
.auth-details[open] :is([data-menu-trigger], .section-heading) .ic { transform: rotate(180deg); }
.auth-flow .auth-optional { margin: 4px 0 16px; }
.auth-flow .auth-consent { align-items: flex-start; gap: 10px; font-size: 12px; line-height: 1.6; margin: 0; }
.auth-flow .auth-consent input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.auth-consent a, .auth-legal a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.auth-flow .auth-submit { display: flex; justify-content: center; align-items: center; width: 100%; min-height: 48px; height: auto; padding: 12px 16px; border-radius: 8px; font: 600 15px/1.4 Onest,sans-serif; white-space: normal; text-align: center; }
.auth-submit:disabled { opacity: .6; cursor: not-allowed; }
.auth-flow .auth-legal { margin: -4px 0 0; color: var(--text-2); font-size: 11px; line-height: 1.6; text-align: center; }
.auth-provider-list { display: flex; flex-direction: column; gap: 10px; }
.auth-flow .auth-provider-btn { display: flex; justify-content: center; gap: 12px; min-height: 48px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 14px; border-radius: 8px; }
.auth-provider-btn .ic-brand { width: 23px; height: 23px; color: var(--text); fill: currentColor; }
.auth-divider { display: flex; align-items: center; gap: 14px; color: var(--text-2); font-size: 12px; margin: 20px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-flow .auth-error, .auth-notice { padding: 12px 14px; margin: 0 0 18px; border-radius: 8px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.auth-notice { background: var(--frame-bg); color: var(--text); border: 1px solid var(--line); }
.auth-flow-heading { margin-bottom: 28px; }
.auth-flow-heading h1 { margin: 0; font-size: clamp(26px,4vw,30px); font-weight: 650; line-height: 1.2; letter-spacing: -.025em; }
.auth-flow-heading p { margin: 12px 0 0; color: var(--text-2); font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.auth-verification { margin-top: clamp(32px,6vh,64px); }
.auth-state-icon { display: block; width: 48px; height: 48px; color: var(--accent); stroke: currentColor; stroke-width: 1.5; fill: none; margin-bottom: 24px; }
.auth-mail-address { display: flex; flex-direction: column; gap: 8px; margin: 0 0 20px; }
.auth-mail-address span { font-size: 13px; color: var(--text-2); }
.auth-mail-address strong { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.auth-verification-hint { margin: 0 0 24px; color: var(--text-2); font-size: 14px; line-height: 1.6; }
.auth-flow .auth-change-email { margin-top: 24px; }
.auth-change-email .auth-form { padding-block: 8px 16px; }
.auth-secondary { display: flex; justify-content: center; align-items: center; min-height: 44px; margin-top: 16px; font-size: 13px; color: var(--text-2); text-align: center; text-underline-offset: 4px; }
.auth-footer { margin-top: auto; padding: 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; }
.auth-footer a { color: var(--text-2); font-size: 11px; text-decoration: none; min-height: 24px; display: inline-flex; align-items: center; }
.auth-flow :is(a,button,:is([data-menu-trigger], .section-heading)):focus-visible, .auth-header :is(a,button):focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
@media(max-width:560px) {
 .auth-header { padding: 12px 20px; }
 .auth-flow { margin-top: 20px; margin-bottom: 32px; }
 .auth-flow--login, .auth-verification { margin-top: 40px; }
 .auth-tabs { margin-bottom: 24px; gap: 16px; }
 .auth-tabs a { font-size: 18px; }
 .auth-password-grid, .auth-flow .auth-optional { grid-template-columns: 1fr; gap: 16px; }
 .auth-flow .auth-consent { font-size: 13px; }
 .auth-flow .auth-legal { font-size: 12px; }
}
@media(prefers-reduced-motion:reduce) { .auth-flow *, .auth-header * { transition: none; animation: none; scroll-behavior: auto; } }

/* Вариант A: открытая форма, единая оболочка для всего пути входа. */
body[data-auth="1"] {background:var(--bg)}
.auth-header {min-height:92px;padding:20px clamp(24px,5vw,72px)}
.auth-header-link {font-size:13px}
.auth-flow {width:min(100% - 48px,390px);margin:38px auto 48px}
.auth-flow--login {width:min(100% - 48px,350px);margin-top:clamp(40px,10vh,110px)}
.auth-handoff,.auth-verification {width:min(100% - 48px,350px);margin-top:clamp(32px,7vh,78px)}
.auth-flow-heading {margin-bottom:28px}
.auth-flow-heading h1 {font-size:30px;font-weight:600;line-height:1.18;letter-spacing:-.028em}
.auth-flow-heading p {font-size:14px;line-height:1.65}
.auth-flow-heading--center {text-align:center}
.auth-tabs {display:flex;justify-content:center;gap:25px;margin-bottom:28px}
.auth-tabs a {min-height:38px;padding:0 0 10px;margin-bottom:-1px;font-size:13px;font-weight:500}
.auth-tabs a[aria-current="page"] {font-weight:500}
.auth-flow .field {gap:7px}
.auth-flow .field label {font-size:12px}
.auth-flow .input {min-height:47px;padding:11px 13px;background:var(--surface);border-color:var(--field-line);font-size:14px}
.auth-flow .auth-form {gap:18px}
.auth-field-heading a {font-size:12px;text-decoration:underline;text-underline-offset:4px}
.auth-flow .auth-provider-btn {min-height:46px;background:var(--surface);font-size:13px}
.auth-divider {font-size:12px;margin:19px 0}
.auth-flow .auth-submit {min-height:47px;font-size:13px;font-weight:600}
.auth-flow .registration-role legend {font-size:12px;margin-bottom:8px;line-height:1.5}
.auth-flow .registration-role-options {background:var(--frame-bg);border:0;padding:4px;border-radius:8px}
.auth-flow .registration-role-options span {min-height:38px;border-radius:5px}
.auth-flow .registration-role-options strong {font-size:12px;font-weight:500}
.auth-flow .registration-role-options input:checked + span {border-color:var(--field-line)}
.auth-flow .registration-role p {font-size:12px;line-height:1.55}
.auth-flow .auth-details {border:0}
.auth-flow .auth-details .section-heading {font-size:12px;cursor:default;min-height:30px}
.auth-flow .auth-details .section-heading .ic {display:none}
.auth-flow .auth-optional {margin:9px 0 0}
.auth-secondary {gap:6px;font-size:12px;margin-top:23px;min-height:30px}
.auth-secondary a {text-decoration:underline;text-underline-offset:4px}
.auth-back {display:inline-flex;align-items:center;gap:8px;margin-bottom:30px;color:var(--text-2);font-size:12px;text-decoration:underline;text-underline-offset:4px}
.auth-footer {padding:22px 24px;gap:18px 24px}
.auth-footer a {font-size:12px}
.auth-flow .auth-error {background:var(--err-soft);color:var(--err);font-size:13px}
.auth-flow .auth-notice {font-size:13px}
.auth-flow .smart-captcha {max-width:100%}
@media(max-width:560px){
 .auth-header {min-height:77px;padding:16px 24px}
 .auth-header .logo {font-size:17px}
 .auth-header-link {font-size:12px}
 .auth-flow,.auth-flow--login,.auth-handoff,.auth-verification {margin-top:30px;margin-bottom:36px}
 .auth-flow-heading h1 {font-size:28px}
 .auth-flow .input {font-size:16px}
 .auth-password-grid {grid-template-columns:1fr;gap:18px}
 .auth-flow .auth-optional {grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 .auth-password-grid .field label {font-size:12px}
 .auth-flow .auth-consent {font-size:12px}
}
@media(max-width:370px){.auth-password-grid,.auth-flow .auth-optional {grid-template-columns:1fr}}
.auth-details-toggle {padding:3px 0;border:0;background:transparent;font:inherit;font-size:12px;color:var(--text-2);cursor:pointer;text-decoration:underline;text-underline-offset:4px;text-align:left;min-height:32px}
.auth-flow .auth-optional[hidden],.auth-flow [data-auth-optional-title][hidden],.auth-flow .auth-details-toggle[hidden] {display:none}

/* Три роли остаются равноправными и помещаются на узком экране. */
.auth-flow .registration-role-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
