:root {
  --bg: #ffffff;
  --ink: #0a0a0a;
  --ink-soft: #3a3a3a;
  --ink-mute: #6b6b6b;
  --line: rgba(0, 0, 0, 0.07);
  --line-strong: rgba(0, 0, 0, 0.12);
  --accent: #111111;
  --hot: #ff2d55;
  --cyan: #00e5ff;
  --lime: #c8ff00;
  --gold: #ffe600;
  --pink: #ff4fd8;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --radius: 0;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }

.auth-page {
  display: grid;
  min-height: 100svh;
}

@media (min-width: 900px) {
  .auth-page { grid-template-columns: 1.05fr 0.95fr; }
}

/* —— Visual panel —— */
.auth-visual {
  position: relative;
  display: none;
  overflow: hidden;
  background: #0d0d0d;
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

@media (min-width: 900px) {
  .auth-visual {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
  }
}

.auth-visual-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 30% 20%, rgba(255, 45, 85, 0.28) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 80% 70%, rgba(0, 229, 255, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse 40% 35% at 50% 90%, rgba(255, 230, 0, 0.12) 0%, transparent 45%),
    linear-gradient(160deg, #121212 0%, #1a1214 45%, #0e161a 100%);
}

.auth-visual-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 20%, transparent 75%);
}

.auth-visual-noise {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.auth-visual-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100%;
  padding: 2.5rem 2.75rem;
}

@media (min-width: 900px) {
  .auth-visual-content {
    justify-content: center;
    align-items: center;
    padding: 2.5rem;
  }

  .auth-visual-brand {
    position: absolute;
    top: 2.5rem;
    left: 2.75rem;
  }
}

.auth-visual-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  width: fit-content;
  opacity: 0;
  animation: auth-rise 0.7s var(--ease) 0.05s forwards;
}

.auth-brand-logo {
  display: block;
  height: 28px;
  width: auto;
  max-width: none;
  object-fit: contain;
  flex-shrink: 0;
}

.auth-visual-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.35rem;
  width: 100%;
  max-width: 32rem;
  text-align: center;
}

@media (min-width: 900px) {
  .auth-visual-stage {
    padding: 0;
  }
}

.auth-visual-kicker {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  opacity: 0;
  animation: auth-rise 0.7s var(--ease) 0.15s forwards;
}

.auth-caption-demo {
  position: relative;
  width: min(560px, 100%);
  min-height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem 0.75rem;
  opacity: 0;
  animation: auth-rise 0.8s var(--ease) 0.28s forwards;
}

.auth-caption-demo .caption-layer {
  position: relative;
  z-index: 2;
  width: 100%;
  text-align: center;
  pointer-events: none;
}

.auth-caption-demo .caption-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3em 0.4em;
  line-height: 1.1;
  min-height: 1.2em;
}

.auth-caption-demo .caption-word {
  display: inline-block;
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  font-size: clamp(1.85rem, 4.5vw, 2.75rem);
  text-transform: uppercase;
  color: #fff;
  letter-spacing: -0.02em;
  transition: color 0.12s, transform 0.18s var(--ease), text-shadow 0.18s, opacity 0.18s;
  opacity: 0.4;
  transform: scale(0.92);
  text-shadow:
    -2px -2px 0 #0a0a0a,
    2px -2px 0 #0a0a0a,
    -2px 2px 0 #0a0a0a,
    2px 2px 0 #0a0a0a,
    3px 4px 0 rgba(0, 0, 0, 0.35);
}

.auth-caption-demo .caption-word.is-active {
  opacity: 1;
  transform: scale(1.12);
  animation: auth-word-pop 0.38s var(--ease);
}

.auth-caption-demo .caption-word.is-spoken {
  opacity: 0.85;
  transform: scale(1);
}

.auth-caption-demo[data-preset="hormozi"] .caption-word {
  color: #fff;
  font-family: "Oswald", sans-serif;
}

.auth-caption-demo[data-preset="hormozi"] .caption-word.is-active {
  color: var(--gold);
  text-shadow:
    -2px -2px 0 #0a0a0a,
    2px -2px 0 #0a0a0a,
    -2px 2px 0 #0a0a0a,
    2px 2px 0 #0a0a0a,
    3px 3px 0 #0a0a0a,
    0 0 20px rgba(255, 230, 0, 0.45);
}

.auth-caption-demo[data-preset="tiktok"] .caption-word {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.02em;
}

.auth-caption-demo[data-preset="tiktok"] .caption-word.is-active {
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.7), 2px 2px 0 var(--hot);
}

.auth-caption-demo[data-preset="anime"] .caption-word {
  color: #ffc0e8;
}

.auth-caption-demo[data-preset="anime"] .caption-word.is-active {
  color: #fff200;
  text-shadow: 0 0 16px rgba(255, 105, 180, 0.8), -2px 0 #ff69b4, 2px 0 #00e5ff;
}

.auth-caption-demo[data-preset="gaming"] .caption-word {
  color: #9dff9d;
  font-family: "Oswald", sans-serif;
}

.auth-caption-demo[data-preset="gaming"] .caption-word.is-active {
  color: #ff3030;
  text-shadow: 0 0 20px rgba(0, 255, 0, 0.5), 0 3px 0 #000;
}

.auth-caption-demo[data-preset="neon"] .caption-word {
  color: #a0ffff;
}

.auth-caption-demo[data-preset="neon"] .caption-word.is-active {
  color: #ff00ff;
  text-shadow: 0 0 22px #ff00ff, 0 0 40px rgba(0, 255, 255, 0.5);
}


@keyframes auth-word-pop {
  0% { transform: scale(0.92); }
  55% { transform: scale(1.16); }
  100% { transform: scale(1.12); }
}

.auth-visual-lead {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.55);
  max-width: 28ch;
  line-height: 1.55;
  opacity: 0;
  animation: auth-rise 0.7s var(--ease) 0.4s forwards;
}

/* —— Form panel —— */
.auth-form-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 1.5rem;
  min-height: 100svh;
  background: var(--bg);
}

.auth-form-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
  opacity: 0.9;
}

.auth-form-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255, 255, 255, 0.95) 0%, transparent 70%),
    radial-gradient(ellipse 45% 35% at 90% 80%, rgba(255, 45, 85, 0.045) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 10% 70%, rgba(0, 229, 255, 0.04) 0%, transparent 50%);
}

.auth-form-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
}

.auth-mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  margin-bottom: 2rem;
  opacity: 0;
  animation: auth-rise 0.65s var(--ease) 0.05s forwards;
}

@media (min-width: 900px) {
  .auth-mobile-brand { display: none; }
}

.auth-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.85rem, 4vw, 2.35rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
  margin-bottom: 0.45rem;
  opacity: 0;
  animation: auth-rise 0.65s var(--ease) 0.12s forwards;
}

.auth-subtitle {
  font-size: 0.975rem;
  color: var(--ink-mute);
  margin-bottom: 1.85rem;
  opacity: 0;
  animation: auth-rise 0.65s var(--ease) 0.2s forwards;
}

.auth-alert {
  display: none;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.35rem;
  border: 1px solid rgba(255, 45, 85, 0.28);
  background: rgba(255, 45, 85, 0.08);
  color: #c4183a;
  font-size: 0.875rem;
  font-weight: 550;
  line-height: 1.4;
}

.auth-alert[hidden],
.auth-alert:not(.is-visible) {
  display: none !important;
}

.auth-alert.is-visible {
  display: flex !important;
  animation: auth-rise 0.35s var(--ease);
}

.auth-alert svg {
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: #ff2d55;
}

.auth-alert span {
  flex: 1;
  min-width: 0;
  color: #c4183a;
}

.auth-form {
  opacity: 0;
  animation: auth-rise 0.65s var(--ease) 0.28s forwards;
}

.form-field { margin-bottom: 1.15rem; }

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.45rem;
}

.form-input {
  width: 100%;
  padding: 0.9rem 1rem;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input::placeholder { color: #a3a3a3; }

.form-input:hover { border-color: rgba(0, 0, 0, 0.22); }

.form-input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.08);
}

.form-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--ink-mute);
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.form-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-mute);
  cursor: pointer;
  user-select: none;
}

.form-checkbox input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--ink);
  cursor: pointer;
}

.form-link {
  color: var(--ink);
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.form-link:hover {
  color: var(--hot);
  border-bottom-color: var(--hot);
}

.auth-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.25rem;
  background: var(--ink);
  color: #fff;
  font-size: 0.975rem;
  font-weight: 650;
  border-radius: var(--radius);
  transition: transform 0.25s var(--ease), background 0.2s, box-shadow 0.25s;
}

.auth-btn:hover {
  transform: translateY(-2px);
  background: #222;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.auth-btn:active { transform: translateY(0) scale(0.99); }

.auth-btn svg { transition: transform 0.3s var(--ease); }
.auth-btn:hover svg { transform: translateX(3px); }

.auth-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.6rem 0;
  color: var(--ink-mute);
  font-size: 0.8125rem;
  opacity: 0;
  animation: auth-rise 0.65s var(--ease) 0.36s forwards;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}

.auth-divider span { padding: 0 0.9rem; }

.auth-footer {
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-mute);
  opacity: 0;
  animation: auth-rise 0.65s var(--ease) 0.42s forwards;
}

.auth-footer a {
  color: var(--ink);
  font-weight: 650;
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.2s, border-color 0.2s;
}

.auth-footer a:hover {
  color: var(--hot);
  border-bottom-color: var(--hot);
}

.auth-back {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-mute);
  transition: color 0.2s;
}

.auth-back:hover { color: var(--ink); }

@keyframes auth-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .auth-visual-brand,
  .auth-visual-kicker,
  .auth-caption-demo,
  .auth-visual-lead,
  .auth-mobile-brand,
  .auth-title,
  .auth-subtitle,
  .auth-form,
  .auth-divider,
  .auth-footer,
  .auth-alert,
  .auth-caption-demo .caption-word.is-active {
    opacity: 1;
    animation: none;
    transform: none;
  }

  .auth-caption-demo .caption-word {
    opacity: 1;
    transform: none;
  }
}

/* —— Register: mobile layout —— */
.auth-register-header {
  display: none;
}

.auth-header-logo {
  display: none;
  align-items: center;
  justify-content: center;
}

.auth-form-shell {
  width: 100%;
  max-width: 400px;
}

.auth-form-head {
  margin-bottom: 0.25rem;
}

.auth-form-section {
  margin-bottom: 0.35rem;
}

.auth-form-section--password {
  margin-top: 0.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line-strong);
}

.auth-form-actions {
  margin-top: 0.35rem;
}

@media (max-width: 899px) {
  .auth-page--register {
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 100svh;
    min-height: 100dvh;
    background:
      radial-gradient(ellipse 70% 55% at 30% 20%, rgba(255, 45, 85, 0.28) 0%, transparent 55%),
      radial-gradient(ellipse 55% 45% at 80% 70%, rgba(0, 229, 255, 0.2) 0%, transparent 50%),
      radial-gradient(ellipse 40% 35% at 50% 90%, rgba(255, 230, 0, 0.12) 0%, transparent 45%),
      linear-gradient(160deg, #121212 0%, #1a1214 45%, #0e161a 100%);
  }

  .auth-page--register .auth-visual {
    display: block;
    position: relative;
    z-index: 0;
    flex-shrink: 0;
    min-height: 0;
    border-right: none;
    border-bottom: none;
    background: transparent;
  }

  .auth-page--register .auth-visual-bg,
  .auth-page--register .auth-visual-grid,
  .auth-page--register .auth-visual-noise {
    display: none;
  }

  .auth-page--register .auth-visual-content {
    min-height: 0;
    padding: calc(env(safe-area-inset-top, 0px) + 3.75rem) 1.25rem 1.5rem;
    justify-content: flex-start;
    align-items: center;
  }

  .auth-page--register .auth-visual-brand {
    display: none;
  }

  .auth-page--register .auth-visual-stage {
    gap: 0.65rem;
    max-width: 100%;
  }

  .auth-page--register .auth-visual-kicker {
    font-size: 0.6875rem;
    letter-spacing: 0.16em;
    opacity: 1;
    animation: none;
  }

  .auth-page--register .auth-caption-demo {
    min-height: 4.25rem;
    padding: 0.15rem 0;
    width: 100%;
    opacity: 1;
    animation: none;
    margin-top: 0;
  }

  .auth-page--register .auth-caption-demo .caption-word {
    font-size: clamp(1.45rem, 6.5vw, 2rem);
  }

  .auth-page--register .auth-visual-lead {
    display: none;
  }

  .auth-page--register .auth-form-panel {
    flex: 1;
    justify-content: flex-start;
    align-items: stretch;
    min-height: 0;
    margin-top: 0.85rem;
    padding: 0;
    background: transparent;
    border-radius: 1.35rem 1.35rem 0 0;
    overflow: hidden;
  }

  .auth-page--register .auth-form-panel::before,
  .auth-page--register .auth-form-panel::after {
    display: none;
  }

  .auth-page--register .auth-register-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    padding: calc(env(safe-area-inset-top, 0px) + 0.65rem) 1rem 0.65rem;
    background: linear-gradient(180deg, rgba(13, 13, 13, 0.96) 0%, rgba(13, 13, 13, 0.72) 70%, transparent 100%);
    pointer-events: none;
  }

  .auth-page--register .auth-register-header > * {
    pointer-events: auto;
  }

  .auth-page--register .auth-register-header .auth-back {
    position: static;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.55rem;
    margin: -0.45rem -0.55rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.72);
  }

  .auth-page--register .auth-register-header .auth-back:hover {
    color: #fff;
  }

  .auth-page--register .auth-header-logo {
    display: inline-flex;
    justify-self: center;
  }

  .auth-page--register .auth-header-logo .auth-brand-logo {
    height: 24px;
    filter: brightness(1.05);
  }

  .auth-page--register .auth-register-header .lang-switch {
    position: static;
    justify-self: end;
  }

  .auth-page--register .auth-register-header .lang-switch-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.16);
    color: #fff;
    height: 2.15rem;
    font-size: 0.8125rem;
  }

  .auth-page--register .auth-form-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: none;
    background: var(--bg);
    border-radius: 1.35rem 1.35rem 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.22);
  }

  .auth-page--register .auth-form-inner {
    max-width: none;
    padding: 1.35rem 1.25rem calc(env(safe-area-inset-bottom, 0px) + 1.25rem);
  }

  .auth-page--register .auth-form-head {
    margin-bottom: 0.15rem;
  }

  .auth-page--register .auth-title {
    font-size: 1.65rem;
    margin-bottom: 0.35rem;
    opacity: 1;
    animation: none;
  }

  .auth-page--register .auth-subtitle {
    font-size: 0.9375rem;
    line-height: 1.45;
    margin-bottom: 1.35rem;
    opacity: 1;
    animation: none;
  }

  .auth-page--register .auth-form {
    opacity: 1;
    animation: none;
  }

  .auth-page--register .form-field {
    margin-bottom: 0.95rem;
  }

  .auth-page--register .form-label {
    font-size: 0.78125rem;
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
  }

  .auth-page--register .form-input {
    padding: 0.875rem 0.95rem;
    font-size: 1rem;
    border-radius: 0.75rem;
    border-color: var(--line);
    background: #fafafa;
    min-height: 3rem;
  }

  .auth-page--register .form-input:focus {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.06);
  }

  .auth-page--register .auth-form-section--password {
    margin-top: 0.25rem;
    padding-top: 1rem;
  }

  .auth-page--register .form-hint {
    font-size: 0.71875rem;
    margin-top: 0.4rem;
  }

  .auth-page--register .auth-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 28%);
  }

  .auth-page--register .auth-btn {
    min-height: 3.15rem;
    border-radius: 0.85rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  .auth-page--register .auth-footer {
    margin-top: 1rem;
    padding-top: 0.25rem;
    font-size: 0.875rem;
    opacity: 1;
    animation: none;
  }
}

@media (min-width: 900px) {
  .auth-page--register .auth-register-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    padding: 1.25rem 1.5rem;
    pointer-events: none;
  }

  .auth-page--register .auth-register-header > * {
    pointer-events: auto;
  }

  .auth-page--register .auth-register-header .auth-back {
    position: static;
  }

  .auth-page--register .auth-register-header .lang-switch {
    position: static;
  }

  .auth-page--register .auth-form-panel {
    padding-top: 4rem;
  }

  .auth-page--register .auth-form-shell {
    margin: 0 auto;
  }
}
