/* Material-inspired account surface: clear hierarchy, tactile states, and one primary action. */
.auth-modal {
  padding: 24px;
  background: rgba(2, 12, 20, .68);
  backdrop-filter: blur(18px) saturate(.82);
}

.auth-dialog {
  width: min(640px, 100%);
  max-height: min(860px, calc(100svh - 32px));
  padding: 36px 40px 40px;
  border: 1px solid rgba(167, 203, 228, .18);
  border-radius: 28px;
  background: #0b1c29;
  box-shadow: 0 28px 72px rgba(0, 0, 0, .46), 0 8px 24px rgba(0, 0, 0, .26);
  scrollbar-color: #385166 transparent;
  animation: auth-dialog-enter 180ms cubic-bezier(.2, 0, 0, 1);
}

@keyframes auth-dialog-enter {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-close {
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #142a3a;
  color: #d8e6ef;
  font: 400 25px/1 "DM Sans", sans-serif;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.auth-close:hover {
  background: #1d3749;
  color: #fff;
}

.auth-close:active { transform: scale(.94); }

.auth-close:focus-visible,
.auth-tabs button:focus-visible,
.auth-recovery-link:focus-visible,
.auth-signin-link:focus-visible {
  outline: 3px solid rgba(102, 184, 255, .55);
  outline-offset: 3px;
}

.auth-head > img {
  width: 168px;
  margin: 2px 0 0;
}

.auth-tabs {
  margin: 26px 0 28px;
  padding: 4px;
  gap: 4px;
  border: 0;
  border-radius: 15px;
  background: #102635;
}

.auth-tabs button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #9eb1bf;
  font: 700 13px/1 "DM Sans", sans-serif;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.auth-tabs button:hover { background: rgba(117, 188, 241, .08); color: #dce8ef; }

.auth-tabs button[aria-selected="true"] {
  border: 0;
  background: #1a3b52;
  color: #e8f5ff;
  box-shadow: inset 0 0 0 1px rgba(102, 184, 255, .22), 0 1px 3px rgba(0, 0, 0, .22);
}

.auth-welcome { margin: 0 0 24px; }

.auth-welcome h2 {
  margin: 0;
  color: #f4f8fb;
  font: 600 28px/1.18 "DM Sans", sans-serif;
  letter-spacing: -.025em;
}

.auth-welcome p {
  margin: 8px 0 0;
  color: #a8bac7;
  font-size: 13px;
  line-height: 1.55;
}

.auth-form { gap: 18px; }

.auth-form label,
.auth-password-field > label,
.auth-field-head label {
  gap: 8px;
  color: #c9d6df;
  font: 600 12px/1.25 "DM Sans", sans-serif;
  letter-spacing: .01em;
}

.auth-form input {
  width: 100%;
  height: 56px;
  box-sizing: border-box;
  padding: 0 16px;
  border: 1px solid #4f6678;
  border-radius: 12px;
  background: #0e2332;
  color: #f3f8fb;
  caret-color: #66b8ff;
  font: 500 15px/1 "DM Sans", sans-serif;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.auth-form input::placeholder { color: #758b9b; opacity: 1; }

.auth-form input:hover { border-color: #708698; }

.auth-form input:focus {
  border-color: #66b8ff;
  background: #102838;
  box-shadow: 0 0 0 1px #66b8ff;
}

.auth-form input:user-invalid {
  border-color: #ffb4ab;
  box-shadow: 0 0 0 1px rgba(255, 180, 171, .75);
}

.auth-password-field { gap: 8px; }

.auth-form-actions {
  margin-top: -2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.auth-recovery-link {
  min-height: 44px;
  padding: 0 8px;
  border-radius: 999px;
  color: #82c7ff;
  font: 700 12px/1 "DM Sans", sans-serif;
  text-decoration: none;
}

.auth-recovery-link:hover,
.auth-recovery-link:focus-visible {
  background: rgba(102, 184, 255, .09);
  color: #b9ddff;
  text-decoration: none;
}

.auth-signin-link {
  min-width: 142px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #66b8ff;
  color: #002a45;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font: 800 13px/1 "DM Sans", sans-serif;
  box-shadow: 0 3px 10px rgba(37, 151, 230, .22);
  cursor: pointer;
  transition: background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.auth-signin-link b { font-size: 18px; font-weight: 500; }
.auth-signin-link:hover { background: #91cbff; box-shadow: 0 5px 14px rgba(37, 151, 230, .3); }
.auth-signin-link:active { transform: scale(.98); }

.auth-message:empty { min-height: 0; }

.auth-panel:not(#signinPanel) .auth-form > .button,
.auth-recovery .auth-form > .button {
  min-height: 48px;
  border-radius: 999px;
}

@media (max-width: 600px) {
  .auth-modal { padding: 12px; align-items: end; }

  .auth-dialog {
    max-height: calc(100svh - 24px);
    padding: 26px 20px 22px;
    border-radius: 26px;
  }

  .auth-close { top: 14px; right: 14px; }
  .auth-head > img { width: 148px; }
  .auth-tabs { margin: 22px 0 24px; }
  .auth-tabs button { padding: 0 10px; font-size: 12px; }
  .auth-welcome { margin-bottom: 20px; }
  .auth-welcome h2 { font-size: 25px; }
  .auth-form { gap: 16px; }
  .auth-form-actions { gap: 10px; }
  .auth-signin-link { min-width: 120px; padding-inline: 17px; }
}

@media (max-height: 680px) and (min-width: 601px) {
  .auth-dialog { padding-top: 28px; padding-bottom: 28px; }
  .auth-head > img { width: 150px; }
  .auth-tabs { margin-block: 18px 20px; }
  .auth-welcome { margin-bottom: 18px; }
  .auth-welcome p { margin-top: 5px; }
  .auth-form { gap: 14px; }
  .auth-form input { height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-dialog { animation: none; }
  .auth-close,
  .auth-tabs button,
  .auth-form input,
  .auth-signin-link { transition: none; }
}
