@import url("https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap");

.flash-banner {
  border: 1px solid #c9dceb;
  background: rgba(247, 252, 255, 0.86);
  color: #1f4f73;
  border-radius: 12px;
  padding: 0.76rem 0.95rem;
  margin-bottom: 1rem;
  box-shadow: 0 10px 20px rgba(25, 79, 116, 0.1);
  font-size: 0.92rem;
  font-weight: 700;
  overflow: hidden;
  max-height: 120px;
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    max-height 260ms ease,
    margin 260ms ease,
    padding 260ms ease,
    border-width 220ms ease;
}

.flash-banner.is-dismissing {
  opacity: 0;
  transform: translateY(-6px);
  max-height: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  box-shadow: none;
}

.flash-banner--success {
  border-color: rgba(63, 147, 96, 0.4);
  background: rgba(63, 147, 96, 0.12);
  color: #1f5f3a;
}

.flash-banner--error {
  border-color: rgba(170, 83, 69, 0.42);
  background: rgba(170, 83, 69, 0.12);
  color: #7b2f24;
}

.main-content:has(.auth-main) {
  position: relative;
  min-height: calc(100dvh - var(--navbar-height) - var(--footer-height) - (var(--space-3) * 2));
  padding: clamp(1rem, 2vw, 1.5rem);
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.main-content:has(.auth-main) > .flash-banner {
  position: relative;
  z-index: 2;
  width: min(100%, 780px);
  margin-inline: auto;
}

.auth-main {
  --auth-accent: #3f97d3;
  --auth-glow-a: rgba(124, 198, 246, 0.2);
  --auth-glow-b: rgba(73, 158, 219, 0.14);
  --auth-shell-border: rgba(141, 186, 216, 0.45);
  --auth-shell-bg-a: rgba(246, 252, 255, 0.95);
  --auth-shell-bg-b: rgba(236, 246, 255, 0.98);
  --auth-text-strong: #173f5c;
  --auth-text-muted: #567895;
  --auth-chip-border: rgba(139, 182, 211, 0.42);
  --auth-chip-bg-a: rgba(250, 254, 255, 0.96);
  --auth-chip-bg-b: rgba(233, 244, 255, 0.92);
  --auth-chip-text: #2d5d82;
  --auth-card-border: rgba(136, 183, 214, 0.5);
  --auth-card-bg-a: rgba(251, 255, 255, 0.96);
  --auth-card-bg-b: rgba(238, 248, 255, 0.98);
  --auth-input-border: #b6d2e8;
  --auth-input-bg: rgba(255, 255, 255, 0.9);
  --auth-input-text: #1d4a6c;
  --auth-input-focus-border: #4da8e6;
  --auth-input-focus-ring: rgba(77, 168, 230, 0.22);
  --auth-submit-border: #5aa7da;
  --auth-submit-text: #f5fbff;
  --auth-submit-bg-a: #6bc4ff;
  --auth-submit-bg-b: #3a8fca;
  --auth-submit-hover-border: #3f90c9;
  --auth-submit-hover-text: #f7fcff;
  --auth-submit-hover-bg-a: #82d0ff;
  --auth-submit-hover-bg-b: #4a9ed8;
  --auth-link: #2c79b5;
  --auth-link-hover: #2f78b2;

  width: min(100%, 820px);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  border: 1px solid var(--auth-shell-border);
  border-radius: 24px;
  padding: clamp(1rem, 2.2vw, 1.5rem);
  background:
    radial-gradient(circle at 8% -20%, var(--auth-glow-a), transparent 44%),
    radial-gradient(circle at 95% 124%, var(--auth-glow-b), transparent 44%),
    linear-gradient(168deg, var(--auth-shell-bg-a), var(--auth-shell-bg-b));
  box-shadow: 0 20px 42px rgba(16, 69, 106, 0.14);
  backdrop-filter: blur(14px) saturate(128%);
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.72rem;
}

.auth-main--login {
  --auth-accent: #57abdd;
  --auth-glow-a: rgba(133, 207, 251, 0.2);
  --auth-glow-b: rgba(81, 166, 223, 0.13);
}

.auth-main--register {
  --auth-accent: #4c96cc;
  --auth-glow-a: rgba(108, 189, 240, 0.2);
  --auth-glow-b: rgba(71, 152, 209, 0.13);
  --auth-submit-border: #5ea9dc;
  --auth-submit-bg-a: #78c9ff;
  --auth-submit-bg-b: #3f94cf;
  --auth-submit-hover-border: #4c9ad0;
  --auth-submit-hover-bg-a: #8cd5ff;
  --auth-submit-hover-bg-b: #54a5dc;
}

.auth-main--forgot,
.auth-main--set-password {
  --auth-accent: #5a9ecf;
  --auth-glow-a: rgba(123, 199, 246, 0.18);
  --auth-glow-b: rgba(85, 164, 221, 0.12);
}

.auth-kicker {
  margin: 0;
  font: 700 0.76rem/1 "Space Grotesk", "Trebuchet MS", sans-serif;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--auth-accent);
}

.auth-page-title {
  margin: 0;
  color: var(--auth-text-strong);
  font: 800 clamp(1.45rem, 3.1vw, 2.35rem) / 1.08 "Sora", "Avenir Next", sans-serif;
  letter-spacing: -0.02em;
}

.auth-page-subtitle {
  margin: 0;
  max-width: 68ch;
  color: var(--auth-text-muted);
  font: 600 clamp(0.9rem, 1.35vw, 1rem) / 1.58 "Space Grotesk", "Trebuchet MS", sans-serif;
}

.auth-points {
  margin: 0.12rem 0 0.3rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.46rem;
}

.auth-points li {
  border: 1px solid var(--auth-chip-border);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--auth-chip-bg-a), var(--auth-chip-bg-b));
  color: var(--auth-chip-text);
  padding: 0.44rem 0.7rem;
  font: 650 0.76rem/1.25 "Space Grotesk", "Trebuchet MS", sans-serif;
}

.auth-card {
  width: min(100%, 620px);
  text-align: left;
  border: 1px solid var(--auth-card-border);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--auth-card-bg-a), var(--auth-card-bg-b));
  box-shadow: 0 18px 36px rgba(16, 69, 106, 0.14);
  padding: clamp(1rem, 2.2vw, 1.45rem);
  display: grid;
  gap: 0.78rem;
}

.auth-title {
  margin: 0;
  color: var(--auth-text-strong);
  font: 800 clamp(1.25rem, 2.6vw, 1.72rem) / 1.08 "Sora", "Avenir Next", sans-serif;
  letter-spacing: -0.015em;
}

.auth-subtitle {
  margin: -0.14rem 0 0.06rem;
  color: var(--auth-text-muted);
  font: 600 0.9rem/1.52 "Space Grotesk", "Trebuchet MS", sans-serif;
}

.auth-form {
  display: grid;
  gap: 0.56rem;
}

.auth-form label {
  color: #3a678a;
  font: 700 0.77rem/1 "Space Grotesk", "Trebuchet MS", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-form input {
  width: 100%;
  height: 46px;
  border-radius: 11px;
  border: 1px solid var(--auth-input-border) !important;
  background: var(--auth-input-bg) !important;
  color: var(--auth-input-text) !important;
  padding: 0 0.8rem;
  font: 600 0.93rem/1.2 "Space Grotesk", "Trebuchet MS", sans-serif;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.auth-form input::placeholder {
  color: #799db9;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--auth-input-focus-border) !important;
  background-color: #f8fcff !important;
  box-shadow: 0 0 0 3px var(--auth-input-focus-ring) !important;
}

.auth-input-help {
  margin: 0;
  color: #6788a3;
  font: 600 0.78rem/1.45 "Space Grotesk", "Trebuchet MS", sans-serif;
}

.auth-submit {
  margin-top: 0.24rem;
  border: 1px solid var(--auth-submit-border) !important;
  border-radius: 11px !important;
  min-height: 46px;
  background: linear-gradient(180deg, var(--auth-submit-bg-a), var(--auth-submit-bg-b)) !important;
  color: var(--auth-submit-text) !important;
  font: 800 0.9rem/1 "Space Grotesk", "Trebuchet MS", sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(21, 79, 122, 0.2) !important;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.auth-submit:hover {
  border-color: var(--auth-submit-hover-border) !important;
  background: linear-gradient(180deg, var(--auth-submit-hover-bg-a), var(--auth-submit-hover-bg-b)) !important;
  color: var(--auth-submit-hover-text) !important;
  box-shadow: 0 12px 24px rgba(21, 79, 122, 0.26) !important;
  transform: translateY(-1px);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.62rem 0.9rem;
}

.auth-links a {
  font: 700 0.84rem/1 "Space Grotesk", "Trebuchet MS", sans-serif;
  text-decoration: none;
  color: var(--auth-link);
}

.auth-links a:hover {
  color: var(--auth-link-hover);
  text-decoration: underline;
}

.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--auth-input-text);
  box-shadow: 0 0 0 1000px #fffdfa inset;
  transition: background-color 9999s ease-in-out 0s;
}

html.dark-mode .auth-main,
body.dark-mode .auth-main {
  --auth-shell-border: rgba(93, 148, 186, 0.52);
  --auth-shell-bg-a: rgba(14, 31, 47, 0.96);
  --auth-shell-bg-b: rgba(10, 23, 36, 0.98);
  --auth-text-strong: #eaf5ff;
  --auth-text-muted: #a6c2da;
  --auth-chip-border: rgba(102, 158, 198, 0.45);
  --auth-chip-bg-a: rgba(19, 39, 58, 0.94);
  --auth-chip-bg-b: rgba(13, 30, 45, 0.94);
  --auth-chip-text: #d9ecff;
  --auth-card-border: rgba(90, 145, 185, 0.5);
  --auth-card-bg-a: rgba(14, 31, 48, 0.96);
  --auth-card-bg-b: rgba(9, 21, 33, 0.97);
  --auth-input-border: #4e7fa4;
  --auth-input-bg: #12263a;
  --auth-input-text: #e8f4ff;
  --auth-input-focus-border: #6ec3ff;
  --auth-input-focus-ring: rgba(106, 195, 255, 0.26);
  --auth-link: #8ed2ff;
  --auth-link-hover: #c5e8ff;
  background:
    radial-gradient(circle at 8% -20%, var(--auth-glow-a), transparent 44%),
    radial-gradient(circle at 95% 124%, var(--auth-glow-b), transparent 44%),
    linear-gradient(168deg, var(--auth-shell-bg-a), var(--auth-shell-bg-b));
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.44);
}

html.dark-mode .auth-main--login,
body.dark-mode .auth-main--login {
  --auth-glow-a: rgba(124, 194, 242, 0.24);
  --auth-glow-b: rgba(83, 169, 224, 0.18);
}

html.dark-mode .auth-main--register,
body.dark-mode .auth-main--register {
  --auth-glow-a: rgba(103, 179, 232, 0.24);
  --auth-glow-b: rgba(69, 151, 209, 0.18);
}

html.dark-mode .auth-main--forgot,
html.dark-mode .auth-main--set-password,
body.dark-mode .auth-main--forgot,
body.dark-mode .auth-main--set-password {
  --auth-glow-a: rgba(93, 164, 212, 0.22);
  --auth-glow-b: rgba(75, 143, 193, 0.16);
}

html.dark-mode .auth-kicker,
body.dark-mode .auth-kicker {
  color: #8fd2ff;
}

html.dark-mode .auth-form label,
body.dark-mode .auth-form label {
  color: #b2d0e7;
}

html.dark-mode .auth-input-help,
body.dark-mode .auth-input-help {
  color: #95b6d1;
}

html.dark-mode .flash-banner {
  border-color: rgba(92, 152, 193, 0.34);
  background: rgba(13, 30, 46, 0.9);
  color: #d7ecff;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.42);
}

html.dark-mode .flash-banner--success,
body.dark-mode .flash-banner--success {
  border-color: rgba(76, 193, 140, 0.42);
  background: rgba(31, 102, 75, 0.34);
  color: #c6f3dd;
}

html.dark-mode .flash-banner--error,
body.dark-mode .flash-banner--error {
  border-color: rgba(236, 122, 105, 0.42);
  background: rgba(115, 36, 27, 0.42);
  color: #ffd5cf;
}

html.dark-mode .auth-form input:-webkit-autofill,
html.dark-mode .auth-form input:-webkit-autofill:hover,
html.dark-mode .auth-form input:-webkit-autofill:focus,
body.dark-mode .auth-form input:-webkit-autofill,
body.dark-mode .auth-form input:-webkit-autofill:hover,
body.dark-mode .auth-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--auth-input-text);
  box-shadow: 0 0 0 1000px var(--auth-input-bg) inset;
}

@media (max-width: 760px) {
  .main-content:has(.auth-main) {
    padding: 0.8rem;
  }

  .auth-main {
    width: min(100%, 100%);
    border-radius: 18px;
    padding: 0.88rem;
    gap: 0.6rem;
  }

  .auth-points {
    justify-content: flex-start;
  }

  .auth-card {
    border-radius: 16px;
    padding: 0.88rem;
  }
}
