/* Общая публичная форма: прежний флоу, токены/кнопки общей дизайн-системы. */
body.modal-open { overflow: hidden; }
.auth-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; overflow: hidden; padding: 24px; background: color-mix(in srgb, var(--n900) 60%, transparent); backdrop-filter: blur(8px); }
.auth-modal[hidden], .auth-modal [hidden] { display: none !important; }
.auth-modal, .auth-modal * { box-sizing: border-box; }
.auth-dialog { position: relative; width: min(480px, 100%); max-height: min(100%, var(--auth-vvh, 100dvh)); overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; border: 1px solid var(--border-main); border-radius: 16px; padding: 32px; background: var(--card-bg); color: var(--text-main); font-size: 16px; line-height: 1.5; }
.auth-dialog :focus-visible { outline: 3px solid var(--success); outline-offset: 3px; }
.auth-dialog h2 { font-size: 24px; font-weight: 800; line-height: 1.25; margin: 0; padding-right: 32px; }
.auth-dialog p { margin: 8px 0; }
.auth-dialog a { color: var(--success); text-underline-offset: 3px; }
.auth-brand { display: block; width: 88px; height: auto; margin-bottom: 24px; }
.auth-close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--border-main); border-radius: 8px; background: var(--n50); color: var(--text-main); font: inherit; font-size: 28px; cursor: pointer; }
.auth-form { margin-top: 24px; }
.auth-form label { display: block; font-size: 14px; font-weight: 700; margin: 16px 0 8px; }
.auth-form label:first-child { margin-top: 0; }
.auth-form .phone-input { width: 100%; min-height: 52px; padding: 12px; border: 1px solid var(--border-main); border-radius: 8px; background: var(--card-bg); color: var(--text-main); font: inherit; font-size: 16px; }
.auth-form .phone-input::placeholder { color: var(--text-secondary); }
.auth-form .phone-input[aria-invalid=true] { border-color: var(--danger); }
.auth-form > .btn-primary, .auth-form > .btn-secondary { width: 100%; min-height: 52px; height: auto; margin-top: 16px; }
.auth-form .form-note, .auth-form .auth-hint { color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.auth-form .form-status { color: var(--danger); font-size: 14px; font-weight: 600; white-space: pre-line; }
.auth-form .form-status.info { color: var(--info); }
.auth-form .auth-consent { display: flex; gap: 12px; align-items: flex-start; margin: 16px 0 4px; font-size: 14px; line-height: 1.5; color: var(--text-secondary); font-weight: 500; cursor: pointer; }
.auth-consent input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--accent); }
.auth-consent.is-error { color: var(--danger); }
.auth-hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; opacity: 0; }
.auth-phone-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.auth-phone-line span { font-weight: 700; }
.auth-change { min-height: 44px; padding: 0 8px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--text-secondary); cursor: pointer; }
.auth-forgot { display: block; padding-block: 12px; font-size: 14px; text-align: center; }
.auth-lead-note { font-size: 16px; }
.auth-card-title { font-size: 20px; font-weight: 800; margin-block: 16px; }
.auth-pw-wrap { position: relative; }
.auth-pw-wrap .phone-input { padding-right: 52px; }
.auth-pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--text-secondary); cursor: pointer; }
.auth-pw-eye svg { display: block; width: 22px; height: 22px; }
.auth-pw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-form .auth-input-locked { background: var(--n100); color: var(--text-secondary); }
.auth-switch { border-top: 1px solid var(--border-main); margin-top: 24px; padding-top: 12px; text-align: center; font-size: 14px; }
.auth-switch a { min-height: 44px; display: inline-flex; align-items: center; }
.auth-cab-list { display: grid; gap: 12px; }
.auth-cab { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 12px; border: 1px solid var(--border-main); border-radius: 12px; background: var(--card-bg); color: var(--text-main); text-align: left; font: inherit; cursor: pointer; }
.auth-cab:hover { border-color: var(--accent); background: var(--accent-tint); }
.auth-cab.is-loading { opacity: .6; }
.auth-cab-ava { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; border-radius: 50%; background: var(--accent-soft); color: var(--success); font-weight: 700; }
.auth-cab-ava img { width: 100%; height: 100%; object-fit: cover; }
.auth-cab-meta { flex: 1; min-width: 0; display: grid; gap: 4px; }
.auth-cab-name { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.auth-cab-role { font-size: 14px; color: var(--text-secondary); }
.auth-cab-chev { width: 20px; height: 20px; flex: 0 0 auto; }
.auth-cab-linkall { display: flex; gap: 12px; margin-top: 16px; font-size: 14px; }
.auth-cab-linkall input { width: 20px; height: 20px; accent-color: var(--accent); flex: 0 0 auto; }
.auth-cab-back { width: 100%; border: 0; background: none; font: inherit; font-size: 14px; cursor: pointer; }
@media (max-width: 640px) {
    .auth-modal { align-items: end; padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
    .auth-dialog { padding: 24px 20px; max-height: calc(var(--auth-vvh, 100dvh) - 24px); }
    .auth-pw-grid { grid-template-columns: 1fr; gap: 0; }
    body.auth-kb-open .auth-brand, body.auth-kb-open .auth-form .form-note, body.auth-kb-open .auth-lead-note, body.auth-kb-open .auth-hint { display: none; }
    body.auth-kb-open .auth-form { margin-top: 16px; }
    body.auth-kb-open .auth-dialog { padding-top: 16px; padding-bottom: 12px; }
    body.auth-kb-open .auth-form > .btn-primary { position: sticky; bottom: 0; z-index: 2; }
}
