/* Sign-in has one destination; optional entrances stay in the support layer. */
.auth-screen {
  background: radial-gradient(ellipse at 50% 0%, #f5f8f5 0%, #fff 62%);
  overscroll-behavior-y: contain;
}
.auth-screen .auth-card {
  width: min(380px, calc(100% - 48px));
  margin: clamp(32px, 7dvh, 80px) auto 40px;
  padding: 0;
}
.auth-identity { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.auth-identity tormie-companion { --companion-size: 76px; }
.auth-identity .auth-wordmark { margin: 0; font-size: 22px; letter-spacing: -.35px; }
.auth-screen .auth-card h1 { max-width: 330px; margin: 0 0 12px; font-size: 29px; line-height: 1.25; font-weight: 550; letter-spacing: -.7px; text-wrap: balance; }
.auth-screen .auth-card .auth-intro { margin: 0 0 28px; max-width: 34ch; font-size: 14px; line-height: 1.65; }
.auth-screen .auth-card form { gap: 14px; }
.auth-field { display: grid; gap: 7px; }
.auth-screen .auth-card label { font-size: 13px; font-weight: 500; }
.auth-screen .auth-card input {
  height: 46px;
  margin: 0;
  font-size: 16px;
  border-radius: 9px;
  border-color: #819087;
  background: #ffffff;
  box-shadow: 0 1px 2px #253d2e06, inset 0 1px 2px #253d2e03;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.auth-screen .auth-card input:hover { border-color: #6b8273; }
.auth-screen .auth-card input:focus-visible { outline: 2px solid var(--tormie-focus); outline-offset: 2px; border-color: var(--tormie-focus); box-shadow: 0 0 0 5px #4e6d5b0b; }
.auth-screen .auth-card input[readonly] { color: var(--tormie-muted); }
.auth-screen .auth-card .solid-button {
  margin-top: 3px;
  min-height: 46px;
  border-radius: 9px;
  box-shadow: inset 0 1px 0 #ffffff12, 0 2px 4px #253d2e12;
  transition: background-color 150ms ease, box-shadow 150ms ease, transform 120ms ease;
}
.auth-screen .auth-card .solid-button:hover:not(:disabled) { background: #2c4e3f; box-shadow: inset 0 1px 0 #ffffff12, 0 3px 7px #253d2e1a; }
.auth-screen .auth-card .solid-button:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 1px 2px #00000018; }
.auth-screen .auth-card .solid-button:disabled { opacity: .7; cursor: progress; }
.auth-screen .auth-card #switchAuth { min-height: 40px; margin-top: -7px; font-size: 13px; color: var(--tormie-action); }
.auth-hint { margin: 0; color: var(--tormie-muted); font-size: 12px; line-height: 1.55; }
.auth-screen .auth-cancel, .app-loading .auth-cancel { min-height: 40px; justify-content: center; color: var(--tormie-action); font-size: 13px; }
.auth-screen #cancelAuth { margin-top: -7px; }
.auth-service-feedback .auth-cancel { display: flex; margin: 4px auto 0; }
.app-loading .auth-cancel { display: inline-flex; margin-left: 16px; }
.app-loading .solid-button, .app-loading .quiet-button { min-height: 44px; min-width: 88px; padding: 10px 16px; justify-content: center; }
.auth-feedback { display: grid; grid-template-rows: 0fr; margin-block: -7px; transition: grid-template-rows 180ms ease, margin 180ms ease; }
.auth-feedback > div { min-height: 0; overflow: hidden; }
.auth-feedback[data-visible="true"] { grid-template-rows: 1fr; margin-block: 0; }
.auth-feedback[data-visible="true"] > div { padding: 11px 13px; border-radius: 9px; background: #f7f3f1; box-shadow: inset 0 0 0 1px #8c413b0d; animation: auth-feedback-in 180ms ease-out both; }
.auth-feedback .inline-error, .auth-service-feedback .inline-error { margin: 0; font-size: 13px; line-height: 1.55; }
.auth-recovery { margin: 5px 0 0; font-size: 12px; line-height: 1.6; color: #635c59; }
.auth-feedback[data-kind="confirmation"] > div { background: var(--tormie-action-surface, #eef3ef); box-shadow: inset 0 0 0 1px #375a4b0d; }
.auth-feedback[data-kind="confirmation"] .inline-error { color: var(--tormie-action); }
.auth-alternatives { margin-top: 20px; }
.auth-alternative-label { display: flex; gap: 12px; align-items: center; margin: 0 0 13px; color: var(--tormie-muted); font-size: 12px; }
.auth-alternative-label::before, .auth-alternative-label::after { content: ''; flex: 1; height: 1px; background: var(--tormie-line); }
.auth-alternatives .provider-group { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 9px; }
.auth-alternatives .provider-button { min-height: 44px; justify-content: center; padding: 10px 12px; font-size: 13px; border-radius: 9px; background: #ffffffa6; transition: background-color 150ms ease, border-color 150ms ease; }
.auth-alternatives .provider-button:disabled { cursor: progress; opacity: .6; }
.auth-alternatives a.provider-button { display: flex; align-items: center; text-decoration: none; color: var(--tormie-action); }
.auth-shared-scope { margin: 10px 0 0; color: var(--tormie-muted); font-size: 12px; line-height: 1.65; }
.auth-provider-only .provider-group { grid-template-columns: 1fr; }
.auth-provider-only .provider-button.solid-button { background: var(--tormie-action); color: #fff; }
.auth-service-feedback { padding: 14px; border-radius: 10px; background: #f7f3f1; }
.auth-service-feedback #retryBoot { display: block; width: 100%; margin-top: 16px; }
.auth-screen .auth-card .auth-scope { margin: 24px 0 0; color: var(--tormie-muted); font-size: 12px; line-height: 1.65; text-align: center; }
@keyframes auth-feedback-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 480px) {
  .auth-screen .auth-card { width: min(380px, calc(100% - 40px)); margin-top: 28px; margin-bottom: max(28px, env(safe-area-inset-bottom)); }
  .auth-identity { margin-bottom: 24px; gap: 12px; }
  .auth-identity tormie-companion { --companion-size: 64px; }
  .auth-screen .auth-card h1 { font-size: 27px; max-width: 300px; }
}
@media (max-height: 740px) {
  .auth-screen .auth-card { margin-top: 24px; }
  .auth-identity { margin-bottom: 20px; }
  .auth-identity tormie-companion { --companion-size: 60px; }
  .auth-screen .auth-card .auth-intro { margin-bottom: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-screen *, .auth-screen *::before, .auth-screen *::after { animation: none !important; transition: none !important; }
  .auth-screen .auth-card .solid-button:active { transform: none; }
}
@media (forced-colors: active) {
  .auth-screen .auth-card input { border-color: FieldText; }
}
