.auth-modal:not([hidden]) {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(6, 16, 38, 0.52);
  backdrop-filter: blur(9px);
  cursor: default;
}

.auth-dialog {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  color: #0b1a3b;
  background: radial-gradient(circle at 92% 5%, rgba(26, 102, 255, 0.14), transparent 32%), #fff;
  box-shadow: 0 32px 96px rgba(6, 16, 38, 0.28);
  animation: authDialogIn 180ms ease-out;
  font-family: "Figtree", "Segoe UI", sans-serif;
}

@keyframes authDialogIn {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-dialog__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #4a5b7a;
  background: #f4f7ff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.auth-dialog__brand {
  display: inline-flex;
  align-items: center;
}

.auth-dialog__brand-logo {
  display: block;
  width: 190px;
  height: auto;
}

.auth-dialog__tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin-top: 24px;
  padding: 4px;
  border-radius: 10px;
  background: #f4f7ff;
}

.auth-dialog__tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  color: #4a5b7a;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.auth-dialog__tabs button.is-active {
  color: #1a66ff;
  background: #fff;
  box-shadow: 0 1px 4px rgba(26, 102, 255, 0.08), 0 2px 12px rgba(11, 26, 59, 0.06);
}

.auth-dialog__copy { margin-top: 26px; }
.auth-dialog__copy > span {
  color: #1a66ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.auth-dialog__copy h2 {
  margin: 8px 0 0;
  color: #0b1a3b;
  font-family: "Plus Jakarta Sans", "Avenir Next", sans-serif;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.035em;
}
.auth-dialog__copy p,
.auth-dialog__terms {
  color: #4a5b7a;
  font-size: 12px;
  line-height: 1.6;
}
.auth-dialog__form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}
.auth-dialog__method {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 0;
}
.auth-dialog__method legend {
  width: 100%;
  margin: 0 0 8px;
  padding: 0;
  color: #0b1a3b;
  font-size: 11px;
  font-weight: 760;
}
.auth-dialog__method label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  color: #4a5b7a;
  font-size: 11px;
  font-weight: 720;
  cursor: pointer;
}
.auth-dialog__method input {
  width: 15px;
  height: 15px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: #1a66ff;
}
.auth-dialog__form label {
  display: grid;
  gap: 7px;
  color: #0b1a3b;
  font-size: 11px;
  font-weight: 700;
}
.auth-dialog__form .auth-dialog__method label {
  display: inline-flex;
  align-items: center;
}
.auth-dialog__form input {
  min-height: 46px;
  padding: 0 12px;
  border: 1.5px solid #d5dce8;
  border-radius: 8px;
  color: #0b1a3b;
  background: #fff;
  font: inherit;
}
.auth-dialog__form input:focus {
  border-color: #1a66ff;
  box-shadow: 0 0 0 3px rgba(26, 102, 255, 0.1);
  outline: none;
}
.auth-dialog__code {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 106px;
  align-items: end;
  gap: 9px;
}
.auth-dialog__code > button {
  min-height: 46px;
  margin: 0;
  padding: 0 12px;
  color: #1a66ff;
  border: 1.5px solid #c8d8fe;
  background: #eef3ff;
  box-shadow: none;
}
.auth-dialog__code > button:hover {
  border-color: #1a66ff;
  background: #e4edff;
}
.auth-dialog__code > button.is-sent {
  color: #12845a;
  border-color: #b8e5d1;
  background: #edfaf4;
}
.auth-dialog__form button {
  min-height: 48px;
  margin-top: 2px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #1a66ff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(26, 102, 255, 0.2);
  cursor: pointer;
}
.auth-dialog__terms {
  margin: 14px 0 0;
  color: #8a9abb;
  font-size: 10px;
}
body.has-auth-modal { overflow: hidden; }

@media (max-width: 760px) {
  .auth-modal:not([hidden]) { align-items: end; padding: 12px; }
  .auth-dialog { padding: 24px 20px 20px; border-radius: 18px 18px 14px 14px; }
  .auth-dialog__copy h2 { font-size: 25px; }
}
