:root {
  --bg-main: #f5f9ff;
  --bg-secondary: #eef5ff;
  --surface: rgba(255, 255, 255, 0.52);
  --surface-strong: rgba(255, 255, 255, 0.72);
  --surface-border: rgba(255, 255, 255, 0.58);

  --text-main: #142033;
  --text-soft: #5f6f86;
  --text-faint: #7b8ca4;

  --blue: #5a8cff;
  --blue-deep: #3b6ff2;
  --blue-soft: rgba(90, 140, 255, 0.12);

  --line: rgba(120, 148, 194, 0.18);

  --shadow-soft: 0 20px 60px rgba(58, 96, 170, 0.14);
  --shadow-card: 0 16px 40px rgba(84, 112, 168, 0.12);
  --shadow-modal: 0 28px 90px rgba(74, 104, 160, 0.18);

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --header-height: 78px;
  --max-width: 1280px;
  --blur: blur(18px);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body.auth-page {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(118, 170, 255, 0.20), transparent 35%),
    radial-gradient(circle at 85% 15%, rgba(151, 194, 255, 0.18), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

.auth-shell {
  position: relative;
  min-height: 100vh;
  padding: 24px;
  overflow: hidden;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

/* Background */
.bg-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.75;
  pointer-events: none;
}

.orb-1 {
  width: 320px;
  height: 320px;
  top: -80px;
  left: -60px;
  background: rgba(116, 177, 255, 0.25);
}

.orb-2 {
  width: 360px;
  height: 360px;
  right: -100px;
  top: 180px;
  background: rgba(102, 146, 255, 0.16);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(110, 140, 200, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 140, 200, 0.06) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 50%, transparent 100%);
  pointer-events: none;
}

/* Shared glass */
.glass {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.68) 0%,
    rgba(255, 255, 255, 0.44) 100%
  );
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.glass-panel {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.72) 0%,
    rgba(255, 255, 255, 0.52) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.glass-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--blue-deep);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 28px rgba(84, 112, 168, 0.10);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Header — matches homepage */
.site-header {
  position: sticky;
  top: 18px;
  z-index: 20;
  height: var(--header-height);
  max-width: var(--max-width);
  margin: 0 auto 36px auto;
  padding: 0 20px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left,
.header-actions {
  display: flex;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #dceaff 100%);
  border: 1px solid rgba(255,255,255,0.85);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--blue-deep);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-faint);
  font-weight: 600;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.header-nav a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-soft);
  transition: color 0.2s ease, transform 0.2s ease;
}

.header-nav a:hover {
  color: var(--blue-deep);
  transform: translateY(-1px);
}

.header-actions {
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: white;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 100%);
  box-shadow: 0 16px 30px rgba(61, 111, 242, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 20px 38px rgba(61, 111, 242, 0.34);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-main);
  border: 1px solid rgba(255,255,255,0.66);
  box-shadow: 0 8px 24px rgba(96, 127, 183, 0.10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-sm {
  padding: 10px 16px;
  font-size: 0.9rem;
}

.btn-block {
  width: 100%;
}

/* Layout */
.auth {
  position: relative;
  z-index: 1;
  padding: 8px 0 52px;
}

.auth__wrap {
  display: grid;
  grid-template-columns: 1fr 0.92fr;
  gap: 20px;
  align-items: start;
}

/* Cards */
.auth-card,
.side-card {
  position: relative;
  border-radius: 30px;
  overflow: hidden;
}

.auth-card {
  padding: 26px;
}

.side-card {
  padding: 22px;
}

.subtle-card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.66) 0%,
    rgba(244, 248, 255, 0.52) 100%
  );
}

.auth-card__head,
.side-card__kicker,
.side-card__title,
.side-card__list,
.side-card p {
  position: relative;
  z-index: 1;
}

.auth-kicker {
  margin-bottom: 16px;
}

.auth-card__head h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.auth-card__head p {
  margin: 10px 0 0;
  max-width: 62ch;
}

.muted {
  color: var(--text-soft);
}

.small {
  font-size: 0.88rem;
}

/* Form */
.auth-form {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field[hidden] {
  display: none !important;
}

.field__label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.field input {
  width: 100%;
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(170, 191, 228, 0.34);
  outline: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.78),
    0 10px 24px rgba(87, 114, 163, 0.06);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.field input::placeholder {
  color: #8ea0bb;
}

.field input:focus {
  border-color: rgba(59, 111, 242, 0.36);
  box-shadow:
    0 0 0 4px rgba(59, 111, 242, 0.10),
    0 16px 34px rgba(87, 114, 163, 0.10);
  background: rgba(255,255,255,0.88);
}

.field__row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.field__row input {
  flex: 1;
}

.icon-btn {
  border: 1px solid rgba(170, 191, 228, 0.34);
  background: rgba(255,255,255,0.72);
  color: var(--text-main);
  border-radius: 16px;
  padding: 13px 14px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(87, 114, 163, 0.06);
  transition: box-shadow .15s ease, transform .12s ease, border-color .15s ease;
}

.icon-btn:hover {
  box-shadow: 0 14px 28px rgba(13,15,20,.08);
  transform: translateY(-1px);
  border-color: rgba(59, 111, 242, 0.24);
}

.auth-form__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 2px 2px;
}

.check {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-soft);
}

.check input {
  width: 16px;
  height: 16px;
}

.link,
.linkbtn {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.link:hover,
.linkbtn:hover {
  text-decoration: underline;
}

.divider {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
}

.divider:before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(166, 186, 223, 0.30);
}

.divider span {
  position: relative;
  background: rgba(248, 251, 255, 0.85);
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-faint);
}

.auth-foot {
  text-align: center;
  margin-top: 2px;
}

.toast {
  display: none;
  margin-top: 6px;
  border: 1px solid rgba(166, 186, 223, 0.26);
  border-radius: 16px;
  padding: 11px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-soft);
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.toast.show {
  display: block;
}

.toast.is-error {
  color: #8d2740;
  border-color: rgba(216, 108, 138, 0.28);
  background: rgba(255, 242, 246, 0.88);
}

.toast.is-success {
  color: #1f7a57;
  border-color: rgba(64, 176, 125, 0.22);
  background: rgba(240, 255, 248, 0.88);
}

/* Side */
.auth-side {
  display: grid;
  gap: 14px;
}

.side-card__kicker {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-deep);
}

.side-card__title {
  margin-top: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.side-card__list {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.side-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.92rem;
  line-height: 1.6;
  font-weight: 600;
  color: var(--text-soft);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-deep), #9ab9ff);
  margin-top: 7px;
  flex: 0 0 auto;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(19, 31, 52, 0.30);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 101;
  padding: 20px;
}

.modal-backdrop[hidden],
.modal[hidden] {
  display: none !important;
}

.modal__card {
  width: min(520px, 100%);
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(720px 260px at 18% 0%, rgba(47,107,255,.10), transparent 62%),
    radial-gradient(720px 260px at 88% 10%, rgba(34,193,255,.08), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.70));
  border: 1px solid rgba(255,255,255,.70);
  box-shadow: var(--shadow-modal);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.modal__head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(166, 186, 223, 0.24);
  background: rgba(255,255,255,.50);
}

.modal__kicker {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-deep);
}

.modal__head h2 {
  margin: 8px 0 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.verify-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(231, 168, 89, 0.24);
  background: rgba(255, 247, 232, 0.88);
  color: #9a6414;
  font-weight: 700;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
}

.xbtn {
  border: 1px solid rgba(170, 191, 228, 0.32);
  background: rgba(255,255,255,.84);
  color: var(--text-main);
  border-radius: 14px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-weight: 800;
  transition: box-shadow .15s ease, transform .12s ease;
}

.xbtn:hover {
  box-shadow: 0 14px 28px rgba(13,15,20,.10);
  transform: translateY(-1px);
}

.verify {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.code {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.code__box {
  width: 100%;
  height: 54px;
  border-radius: 16px;
  border: 1px solid rgba(170, 191, 228, 0.34);
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  outline: none;
  color: var(--text-main);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.code__box:focus {
  border-color: rgba(59, 111, 242, 0.36);
  box-shadow: 0 0 0 4px rgba(59, 111, 242, 0.10);
}

.verify__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 2px 2px;
}

/* Responsive */
@media (max-width: 980px) {
  .auth__wrap {
    grid-template-columns: 1fr;
  }

  .header-nav {
    display: none;
  }
}

@media (max-width: 860px) {
  .site-header {
    height: auto;
    padding: 16px;
    flex-wrap: wrap;
    gap: 14px;
  }

  .header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .header-actions .btn {
    flex: 1;
  }

  .auth-shell {
    padding: 16px;
  }

  .container {
    width: min(1120px, calc(100% - 8px));
  }
}

@media (max-width: 640px) {
  .auth-card,
  .side-card {
    border-radius: 24px;
  }

  .code {
    grid-template-columns: repeat(3, 1fr);
  }

  .verify__row {
    flex-direction: column;
    align-items: flex-start;
  }
}
