.auth-section form, .auth-providers, .auth-invitation { margin-block: 1rem; }
.auth-section input, .auth-section button, .family-page select, #invitation-url { min-height: 44px; width: 100%; max-width: 100%; box-sizing: border-box; }
.auth-link { display: inline-flex; align-items: center; min-height: 44px; }
.auth-invitation { border-top: 1px solid currentColor; padding-top: 1rem; overflow-wrap: anywhere; }
.auth-providers { display: grid; gap: .75rem; }
.auth-section .family-form { display: grid; gap: .75rem; }

/* Общая оболочка и поля для всех шагов входа, пароля и подтверждения почты. */
.auth-page { min-height: 100dvh; margin: 0; display: flex; flex-direction: column; color: var(--text); background: var(--bg); }
.auth-header { min-height: 88px; padding: 14px max(20px, calc((100vw - 1200px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.auth-header .app-brand { width: 176px; flex-shrink: 0; }
.auth-header .app-brand img { width: 100%; height: auto; }
.auth-header nav { display: flex; gap: 28px; }
.auth-header nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); text-decoration: none; }
.auth-header nav a:hover { color: var(--accent); }
.auth-layout { width: 100%; max-width: 600px; padding: 40px 20px 24px; margin: 0 auto; box-sizing: border-box; flex: 1; }
.auth-card { padding: 36px 40px; box-shadow: 0 6px 30px rgb(20 53 110 / 3%); }
.auth-card h1 { margin: 0 0 12px; font-size: clamp(26px, 3vw, 34px); line-height: 1.2; letter-spacing: -.025em; text-align: center; }
.auth-subtitle { margin: 0 0 28px; color: var(--muted); line-height: 1.55; text-align: center; overflow-wrap: anywhere; }
.auth-form { display: grid; gap: 22px; }
.auth-field { min-width: 0; }
.auth-field label:not(.ui-check), .auth-form > label:not(.auth-consent):not(.ui-check) { display: block; margin: 0; }
.auth-hint { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.auth-password { position: relative; }
.auth-password input { padding-right: 58px !important; }
.auth-eye { position: absolute; right: 3px; top: 3px; width: 44px; height: 44px; padding: 10px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.auth-eye:hover { background: var(--accent-soft); color: var(--accent); }
.auth-eye[aria-pressed=true] { color: var(--accent); background: var(--accent-soft); }
.auth-primary { width: 100%; min-height: 52px; padding: 12px 16px; text-align: center; }
.auth-notice { margin: 0 0 20px; line-height: 1.5; }
.auth-form .auth-notice { margin: 0; }
.auth-consent { display: flex !important; gap: 12px; align-items: flex-start; font-weight: 400 !important; line-height: 1.55; }
.auth-consent input { width: 20px; height: 20px; min-width: 20px; margin-top: 3px; accent-color: var(--accent); }
.auth-divider { padding-top: 24px; margin: 24px 0 0; border-top: 1px solid var(--border); text-align: center; color: var(--muted); }
.auth-small-link, .auth-back { min-height: 44px; display: flex; align-items: center; justify-content: center; width: fit-content; max-width: 100%; margin: 12px auto 0; }
.auth-back { margin: -8px 0 22px; justify-content: flex-start; }
.auth-align-end { margin: -12px 0 -10px auto; }
.auth-align-start { margin: 4px 0 0; }
.auth-center { text-align: center; }
.auth-symbol { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 50%; color: var(--accent); background: var(--accent-soft); font-size: 32px; }
.auth-symbol--success { color: var(--success); background: var(--success-soft); }
.auth-symbol--warning { color: var(--warning); background: var(--warning-soft); }
.auth-address { text-align: center; overflow-wrap: anywhere; margin: -12px 0 24px; font-weight: 600; }
.auth-code-input { font-variant-numeric: tabular-nums; font-size: 24px !important; letter-spacing: .3em; text-align: center; }
.auth-resend { text-align: center; margin: 18px 0 0; }
.auth-text-button { min-height: 44px; padding: 8px 12px; border: 0; border-radius: 8px; font: inherit; color: var(--accent); background: transparent; cursor: pointer; }
.auth-text-button:hover:not(:disabled) { background: var(--accent-soft); }
.auth-text-button:disabled { color: var(--muted); cursor: default; }
.auth-footer { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 20px; padding: 14px 20px 28px; }
.auth-footer a { min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; }
.auth-providers:empty { display: none; }
.auth-providers button { width: 100%; }
.auth-skip { position: absolute; top: -100px; left: 20px; z-index: 10; padding: 12px; background: white; }
.auth-skip:focus { top: 8px; }
.auth-page [hidden] { display: none !important; }
.auth-dialog h1 { margin: 0 0 22px; font-size: 28px; line-height: 1.2; text-align: center; }
.auth-dialog-close { display: grid; place-items: center; width: 44px; height: 44px; margin: -24px -20px 0 auto; font-size: 26px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.auth-dialog-close:hover { background: var(--accent-soft); }
.auth-dialog [hidden] { display: none !important; }
@media(max-width:600px) {
    .auth-header { min-height: 72px; padding: 10px 18px; gap: 12px; }
    .auth-header .app-brand { width: 140px; }
    .auth-header nav { gap: 14px; font-size: 14px; }
    .auth-layout { padding: 20px 12px 8px; }
    .auth-card { padding: 26px 20px; border-radius: 14px; }
    .auth-card h1 { font-size: 28px; }
    .auth-form { gap: 20px; }
    .auth-subtitle { font-size: 16px; margin-bottom: 24px; }
    .auth-dialog-close { margin: -16px -8px 0 auto; }
}
