/* Account dialog. Shares tokens with styles.css; visual shell (.auth-dialog) is defined there. */
.auth-dialog { width: min(440px, calc(100% - 24px)); }
.auth-close {
  position: absolute; inset-inline-end: 16px; top: 16px;
  width: 36px; height: 36px; border: 0; border-radius: 10px;
  background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; padding: 0;
}
.auth-close:hover { background: var(--surface-3); }
.auth-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.auth-head { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; padding-inline-end: 44px; }
.auth-mark { width: 40px; height: 40px; object-fit: contain; flex: none; }
.auth-eyebrow { display: block; font-size: 12px; font-weight: 600; color: var(--muted); direction: ltr; unicode-bidi: isolate; }
.auth-head h2 { margin: 1px 0 0; font-size: 20px; line-height: 1.3; }
.auth-language { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; color: var(--muted); font-size: 13px; font-weight: 600; }
.auth-language select, .auth-field input {
  min-height: 46px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 15px;
}
.auth-language select { min-height: 38px; padding: 6px 10px; font-size: 14px; }
.auth-field input[type="tel"], .auth-field input[inputmode="numeric"] { direction: ltr; text-align: start; }
html[dir="rtl"] .auth-field input[type="tel"], html[dir="rtl"] .auth-field input[inputmode="numeric"] { text-align: right; }
#authCode { letter-spacing: .35em; font-size: 20px; font-variant-numeric: tabular-nums; text-align: center !important; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 0 0 18px; border-radius: 12px; background: var(--surface-2); }
.auth-tabs button { border: 0; border-radius: 9px; padding: 9px 10px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.auth-tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-hint { color: var(--muted); font-size: 13px; line-height: 1.65; margin: 4px 0 16px; }
.auth-submit, .auth-telegram {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px;
  border: 0; border-radius: 12px; background: var(--btn); color: #fff; font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
}
.auth-submit:hover { background: var(--btn-hover); }
.auth-submit:disabled { opacity: .55; cursor: wait; }
.auth-submit.secondary { margin-top: 16px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.auth-telegram { margin: 0 0 14px; background: #229ed9; }
.auth-telegram:hover { background: #1b8ec4; }
.auth-message { margin: 0 0 14px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); border-radius: 10px; background: var(--danger-soft); color: var(--ink); font-size: 13.5px; line-height: 1.55; }
.auth-signed-in { color: var(--ink-2); overflow-wrap: anywhere; }
.auth-signed-in p { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 14px; line-height: 1.7; }
.auth-dialog [hidden] { display: none !important; }
.account-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body:not(.signed-out) .account-button { color: var(--primary); }
.auth-legal { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; }
.auth-legal a { color: var(--muted); text-decoration: none; font-weight: 600; }
.auth-legal a:hover { color: var(--ink); text-decoration: underline; }
/* Auth states: notices, field hints, consent, Telegram steps, account summary */
.auth-notice { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--ink); font-size: 13.5px; line-height: 1.55; border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.auth-field-hint { margin: -6px 0 14px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.auth-field input[aria-invalid="true"], .auth-consent input[aria-invalid="true"] { border-color: var(--danger); outline: 2px solid color-mix(in srgb, var(--danger) 45%, transparent); outline-offset: 0; }
.auth-consent { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 14px; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.auth-consent input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--btn); }
.auth-consent a, .auth-legal a:focus-visible { color: var(--primary); font-weight: 600; }
.auth-link { display: inline-flex; align-items: center; min-height: 40px; margin-top: 8px; padding: 0 4px; border: 0; background: none; color: var(--primary); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.auth-link:hover { text-decoration: underline; }
.auth-step-title { margin: 0 0 12px; font-size: 16px; }
.auth-step-title:focus { outline: none; }
.auth-steps { margin: 0 0 12px; padding-inline-start: 22px; display: grid; gap: 10px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.auth-steps .auth-telegram { margin: 8px 0 0; }
.auth-phone-echo { font-weight: 700; color: var(--ink); unicode-bidi: isolate; }
.auth-waiting { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 13px; line-height: 1.55; }
.auth-account { margin: 0 0 12px; display: grid; gap: 8px; }
.auth-account > div { display: grid; grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.auth-account dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.auth-account dd { margin: 0; display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 14px; }
.auth-account dd small { color: var(--muted); font-size: 12px; }
.auth-signed-summary { margin: 0 0 12px; font-weight: 600; color: var(--ink); }
.auth-signed-in .auth-submit.secondary + .auth-submit.secondary { margin-top: 10px; }
.auth-submit[aria-busy="true"] { opacity: .7; cursor: progress; }
@media (max-width: 479px) { .auth-account > div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
@media (max-width: 719px) {
  .auth-close { top: 12px; inset-inline-end: 12px; width: 44px; height: 44px; }
  .auth-tabs button { min-height: 44px; }
}
.auth-signed-in .auth-hint, .auth-signed-in .auth-signed-summary { padding: 0; background: none; }
.auth-docs { margin: 0 0 12px; padding: 12px; border-radius: 10px; background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.auth-docs .auth-step-title { margin: 0 0 6px; }
.auth-docs .auth-submit { margin-top: 4px; }
.auth-devices { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.auth-devices .auth-hint { margin: 0; }

/* Phone entry: country calling code selector, and the hybrid verification step (one-tap first, code always available). */
.auth-country select { width: 100%; min-height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; }
.auth-telegram-primary { display: flex; align-items: center; justify-content: center; min-height: 48px; margin: 12px 0 6px; padding: 0 16px; border-radius: 12px; background: var(--primary); color: #fff; font-weight: 700; text-decoration: none; }
.auth-telegram-primary:hover { color: #fff; filter: brightness(1.05); }
.auth-telegram-primary[hidden], .auth-waiting[hidden] { display: none; }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; color: var(--muted); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.auth-code-input { font-size: 22px !important; letter-spacing: .42em; text-align: center; font-variant-numeric: tabular-nums; }
.auth-match { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 10px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 12px; font-size: 14px; }
.auth-match strong { font-size: 30px; line-height: 1; letter-spacing: .08em; font-variant-numeric: tabular-nums; color: var(--ink); }
.auth-match[hidden] { display: none; }
/* National-number entry: the calling code of the chosen country sits beside the field. */
.auth-phone-row { display: flex; align-items: stretch; gap: 0; direction: ltr; }
.auth-phone-row input { flex: 1; min-width: 0; border-start-start-radius: 0; border-end-start-radius: 0; }
.auth-phone-row .auth-dial { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line-strong); border-right: 0; border-radius: 10px 0 0 10px; background: var(--surface-2); color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.auth-phone-row .auth-dial[hidden] { display: none; }
.auth-phone-row .auth-dial[hidden] + input { border-radius: 10px; }
