
:root {
  color-scheme: light;
  --bg: #090d54;
  --bg-2: #070a3f;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e5e7eb;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  --primary: #090d54;
  --primary-hover: #070a3f;
  --focus: #111827;
  --radius: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 30% 20%, rgba(255, 255, 255, 0.08), transparent 60%),
    radial-gradient(900px 500px at 70% 80%, rgba(255, 255, 255, 0.06), transparent 55%),
    linear-gradient(135deg, var(--bg), var(--bg-2));
}

.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  position: relative;
  overflow: hidden;
}

.auth::before {
  content: "";
  position: absolute;
  inset: -40px;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.10) 0 7px, transparent 8px),
    radial-gradient(circle at 40% 10%, rgba(255, 255, 255, 0.08) 0 10px, transparent 11px),
    radial-gradient(circle at 82% 22%, rgba(255, 255, 255, 0.10) 0 9px, transparent 10px),
    radial-gradient(circle at 66% 55%, rgba(255, 255, 255, 0.07) 0 12px, transparent 13px),
    radial-gradient(circle at 20% 75%, rgba(255, 255, 255, 0.06) 0 11px, transparent 12px),
    radial-gradient(circle at 88% 78%, rgba(255, 255, 255, 0.08) 0 8px, transparent 9px);
  opacity: 0.85;
  pointer-events: none;
  filter: blur(0.2px);
}

.auth__card {
  width: min(420px, 92vw);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 28px 24px;
  position: relative;
}

.auth__header {
  text-align: center;
  margin-bottom: 18px;
}

.auth__brand {
  display: grid;
  place-items: center;
  margin: 2px auto 10px;
  color: #090d54;
}

.auth__logo {
  display: block;
  width: 160px;
  height: auto;
}

.auth__title {
  margin: 0;
  letter-spacing: 0.26em;
  font-size: 14px;
  font-weight: 700;
  color: #090d54;
}

.auth__subtitle {
  margin: 6px 0 0;
  font-size: 10px;
  letter-spacing: 0.46em;
  font-weight: 700;
  color: var(--muted);
}

.auth__alert {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 13px;
}

.auth__form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field__label {
  font-size: 12px;
  font-weight: 700;
  color: #111827;
}

.field__hint {
  font-weight: 600;
  color: var(--muted);
}

.field__input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 13px;
  outline: none;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__input::placeholder {
  color: #94a3b8;
}

.field__input:focus {
  border-color: rgba(17, 24, 39, 0.55);
  box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.12);
}

.field__password {
  position: relative;
}

.field__input--with-button {
  padding-right: 44px;
}

.icon-button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.icon-button:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
}

.icon-button:focus-visible {
  outline: 3px solid rgba(17, 24, 39, 0.55);
  outline-offset: 2px;
}

.auth__row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  cursor: pointer;
}

.check__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.check__box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #fff;
  display: inline-block;
  position: relative;
}

.check__input:checked + .check__box {
  background: var(--primary);
  border-color: var(--primary);
}

.check__input:checked + .check__box::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}

.check__input:focus-visible + .check__box {
  outline: 3px solid rgba(17, 24, 39, 0.55);
  outline-offset: 2px;
}

.check__label {
  font-size: 12px;
  font-weight: 600;
  color: #111827;
}

.btn {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.06s ease;
}

.btn:hover {
  background: var(--primary-hover);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
}

.auth__footer {
  text-align: center;
  margin-top: 4px;
}

.link {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
}

.link--button {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.link--button:hover {
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.link:focus-visible {
  outline: 3px solid rgba(17, 24, 39, 0.55);
  outline-offset: 3px;
  border-radius: 6px;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
}

.modal__panel {
  width: min(440px, 92vw);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  padding: 18px;
  position: relative;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.modal__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.modal__desc {
  margin: 0 0 14px;
  font-size: 13px;
  color: #475569;
  line-height: 1.35;
}

.modal__form {
  display: grid;
  gap: 14px;
}

.loading-overlay[hidden] {
  display: none;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  gap: 12px;
  background: #ffffff;
  padding: 24px;
}

.loading-overlay__spinner {
  width: 56px;
  height: 56px;
  position: relative;
}

.loading-overlay__spinner::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #111827;
  transform: translate(-50%, -50%);
  box-shadow:
    18px 0 0 #111827,
    12.7px 12.7px 0 #1f2937,
    0 18px 0 #334155,
    -12.7px 12.7px 0 #475569,
    -18px 0 0 #64748b,
    -12.7px -12.7px 0 #94a3b8,
    0 -18px 0 #cbd5e1,
    12.7px -12.7px 0 #94a3b8;
  animation: loading-dots 0.95s linear infinite;
}

.loading-overlay__text {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.02em;
}

@keyframes loading-dots {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@media (max-width: 420px) {
  .auth__card {
    padding: 22px 18px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }

  .loading-overlay__spinner {
    animation: none !important;
  }

  .loading-overlay__spinner::before {
    animation: none !important;
  }
}

