.auth-dialog { width: min(540px, calc(100% - 32px)); max-width: none; max-height: calc(100svh - 32px); padding: 0; border-color: #b8c1c7; background: #f4f6f7; box-shadow: 0 24px 90px #17232b30; }
.auth-dialog[open] { display: flex; flex-direction: column; }
.auth-dialog::backdrop { background: #18263078; }
.auth-dialog p { margin: 0; }
.auth-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.auth-header { display: block; margin-bottom: 0; padding: 28px 28px 24px; }
.auth-header .auth-close { align-self: start; }
.auth-header h2 { padding-right: 0; font-size: clamp(25px, 3vw, 30px); line-height: 1.16; letter-spacing: -.035em; text-wrap: balance; }
.auth-header #auth-intro { margin-top: 12px; color: var(--body); font-size: 16px; line-height: 1.5; text-wrap: balance; }
.auth-header .auth-package { margin-top: 18px; padding: 11px 13px; border: 1px solid #6d8ca2; border-radius: 5px; background: #e5edf2; color: var(--steel); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.auth-panels { padding: 0 28px 28px; }
.auth-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-bottom: 22px; padding: 4px; border: 1px solid #c1ccd3; border-radius: 7px; background: #e5ebef; }
.auth-methods button { min-width: 0; min-height: 44px; padding: 9px 8px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted); font: 400 14px/1.35 var(--text); cursor: pointer; }
.auth-methods button[aria-pressed="true"] { border-color: #b9c5cd; background: #f9fafb; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px #17232b0d; }
.auth-methods button:hover { color: var(--ink); }
.auth-label { display: block; margin-bottom: 9px; color: var(--ink); font-size: 16px; font-weight: 600; line-height: 1.4; }
.auth-input { display: block; width: 100%; min-width: 0; min-height: 50px; padding: 12px 13px; border: 1px solid #9cabb5; border-radius: 5px; background: #fff; color: var(--ink); font: 400 16px/1.4 var(--text); }
.auth-input::placeholder { color: #65717b; opacity: 1; }
.auth-input:focus-visible { border-color: var(--steel); outline-color: var(--steel); outline-offset: 3px; }
.auth-input[aria-invalid="true"] { border-color: #a34739; background: #fff9f7; }
.auth-dialog .auth-field-help { color: var(--muted); font-size: 14px; line-height: 1.45; }
.auth-dialog #auth-email-help { margin-top: 10px; }
.auth-dialog .auth-field-error { margin-top: 10px; color: #9a2e27; font-size: 14px; line-height: 1.45; }
.auth-login-password-wrap { margin-top: 20px; }
.auth-password-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; margin-top: 4px; }
.auth-password-demo { margin-top: 3px !important; }
.auth-email-submit, .auth-password-submit, .auth-code-submit { width: 100%; min-height: 48px; margin-top: 22px; cursor: pointer; }
.auth-address { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 14px; margin-bottom: 22px; }
.auth-address > div { min-width: 0; }
.auth-dialog .auth-destination { margin-top: 3px; color: var(--ink); font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.auth-text-button { min-height: 44px; padding: 8px 0; border: 0; background: transparent; color: var(--steel); font: 400 14px/1.4 var(--text); text-align: left; cursor: pointer; }
.auth-text-button:hover:not(:disabled) { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.auth-text-button:disabled { color: var(--muted); cursor: default; }
.auth-code-input { min-height: 62px; font: 700 28px/1.2 var(--heading); letter-spacing: .3em; text-align: center; padding-left: calc(13px + .3em); }
.auth-code-demo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; margin-top: 10px; padding: 4px 11px; border: 1px solid var(--rule); border-radius: 5px; background: #e9edef; color: var(--body); font-size: 14px; line-height: 1.45; }
.auth-code-demo strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .04em; white-space: nowrap; }
.auth-code-demo .auth-fill-code { flex: 0 0 auto; }
.auth-resend-row { margin-top: 10px; }
.auth-dialog .auth-resend-status { color: var(--muted); font-size: 14px; line-height: 1.45; }
.auth-footer { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; padding: 10px 28px 14px; border-top: 1px solid var(--rule); }
.auth-footer > .auth-mode-toggle:only-child { margin-inline: auto; }
@media (max-width: 560px) {
  .auth-dialog { width: calc(100% - 20px); max-height: calc(100svh - 20px); border-radius: 8px; }
  .auth-header { padding: 22px 20px 20px; }
  .auth-header h2 { font-size: 25px; }
  .auth-panels { padding: 0 20px 22px; }
  .auth-footer { padding: 9px 20px 12px; }
  .auth-footer .auth-text-button { flex: 1 0 100%; text-align: center; }
  .auth-address { margin-bottom: 16px; }
}
@media (max-height: 560px) {
  .auth-header { padding-top: 18px; padding-bottom: 18px; }
  .auth-email-submit, .auth-password-submit, .auth-code-submit { margin-top: 18px; }
}

.auth-choice-options { display: grid; gap: 12px; }
.auth-choice-card { min-width: 0; min-height: 112px; padding: 18px; border: 1px solid #b8c5ce; border-radius: 7px; background: #eef3f6; color: var(--ink); text-align: left; cursor: pointer; }
.auth-choice-card:hover { border-color: var(--steel); background: #e5edf2; }
.auth-choice-card > strong { display: block; font: 700 18px/1.3 var(--heading); letter-spacing: -.02em; }
.auth-choice-card > span { display: block; margin-top: 8px; color: var(--body); font: 400 16px/1.45 var(--text); }
.auth-dialog .auth-choice-email { margin-top: 3px; color: var(--ink); font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.auth-password-checks { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.auth-password-checks li { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.auth-password-checks li::before { content: ""; display: grid; flex: 0 0 14px; width: 14px; height: 14px; margin-top: 3px; place-items: center; border: 1px solid #9eafb9; border-radius: 3px; font-size: 10px; line-height: 1; }
.auth-password-checks [data-state="valid"], .auth-password-checks .is-valid { color: var(--steel); }
.auth-password-checks [data-state="valid"]::before, .auth-password-checks .is-valid::before { content: "✓"; border-color: var(--steel); background: var(--steel); color: #fff; }
.auth-password-checks [data-state="invalid"], .auth-password-checks .is-invalid { color: #9a2e27; }
.auth-password-checks [data-state="invalid"]::before, .auth-password-checks .is-invalid::before { border-color: #b46c60; background: #f8ebe7; }
.auth-dialog .auth-password-status { min-height: 21px; margin-top: 12px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.auth-dialog .auth-password-status[data-state="valid"] { color: var(--steel); }
.auth-dialog .auth-password-status[data-state="invalid"] { color: #9a2e27; }
.auth-back-choice { display: block; margin: 8px auto 0; text-align: center; }
.auth-password-submit:disabled { border-color: #cbd0d3; background: #dce0e2; color: #666e73; cursor: default; }
@media (max-width: 560px) {
  .auth-choice-card { padding: 16px; }
  .auth-choice-card > strong { font-size: 17px; }
}

.auth-header .auth-registration-step { margin: 0 0 8px; color: var(--steel); font-size: 14px; font-weight: 600; }

.auth-input[aria-invalid="true"]:focus-visible { border-color: #9a2e27; outline-color: #9a2e27; }

.consultation-form .auth-label:not(:first-child) { margin-top: .8rem; }
.consultation-form textarea.auth-input { resize: vertical; min-height: 6rem; }
.consultation-form button[type="submit"], .consultation-confirmation button { margin-top: .75rem; }
