/* ======================================================================
   PROROK — Auth experience 4.9
   Digital Mysticism Luxe for login, stepped registration and password flow.
   ====================================================================== */

:root {
  color-scheme: dark;
  --auth-bg: #080c19;
  --auth-panel: rgba(17, 23, 44, .88);
  --auth-panel-strong: rgba(20, 27, 51, .96);
  --auth-soft: rgba(255, 255, 255, .035);
  --auth-border: rgba(184, 154, 255, .22);
  --auth-border-active: rgba(170, 112, 255, .76);
  --auth-text: #f5f2ff;
  --auth-text-secondary: #aaa8bd;
  --auth-text-muted: #777a91;
  --auth-purple: #8b5cf6;
  --auth-violet: #c45cff;
  --auth-pink: #ff6ca8;
  --auth-cyan: #4dd3ff;
  --auth-green: #59e6a7;
  --auth-warning: #f4bd65;
  --auth-danger: #f0788c;
  --auth-gradient: linear-gradient(120deg, #8057f6 0%, #be58ef 48%, #40bff4 100%);
  --auth-font-ui: Inter, Manrope, "SF Pro Text", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --auth-font-display: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --auth-ease: cubic-bezier(.2, .76, .25, 1);
}

html {
  min-width: 0;
  min-height: 100%;
  overflow-x: clip;
  background: #060913;
}

body.auth-page {
  min-width: 0;
  min-height: 100dvh;
  margin: 0;
  overflow-x: clip;
  color: var(--auth-text);
  font-family: var(--auth-font-ui);
  background:
    radial-gradient(circle at 15% 8%, rgba(133, 92, 246, .22), transparent 35%),
    radial-gradient(circle at 90% 34%, rgba(77, 211, 255, .10), transparent 38%),
    linear-gradient(180deg, #11142b 0%, #090d1c 48%, #060913 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.auth-page .pr-cosmic-bg {
  z-index: 0;
  opacity: .9;
}

.auth-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding:
    max(24px, env(safe-area-inset-top, 0px))
    16px
    max(24px, env(safe-area-inset-bottom, 0px));
}

.auth-layout {
  width: min(100%, 980px);
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(360px, 480px);
  align-items: center;
  gap: clamp(28px, 6vw, 80px);
}

.auth-intro {
  min-width: 0;
  padding: 12px 0 12px 8px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 24px;
  color: #d8c8ff;
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .19em;
  text-transform: uppercase;
}

.auth-brand::before {
  content: "";
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, var(--auth-violet), rgba(196, 92, 255, 0));
}

.auth-brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(184, 154, 255, .26);
  border-radius: 15px;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, .18), transparent 34%),
    rgba(19, 25, 49, .72);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, .28),
    0 0 28px rgba(139, 92, 246, .12),
    inset 0 1px 0 rgba(255, 255, 255, .07);
}

.auth-brand-mark svg {
  width: 23px;
  height: 23px;
  color: #d9c9ff;
  filter: drop-shadow(0 0 8px rgba(196, 92, 255, .42));
}

.auth-intro h1,
.auth-panel h1,
.auth-question-title {
  font-family: var(--auth-font-display);
  font-weight: 600;
  letter-spacing: -.025em;
}

.auth-intro h1 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(3rem, 7vw, 5.4rem);
  line-height: .93;
}

.auth-intro-copy {
  max-width: 570px;
  margin: 24px 0 0;
  color: var(--auth-text-secondary);
  font-size: clamp(.98rem, 1.9vw, 1.12rem);
  line-height: 1.72;
}

.auth-intro-points {
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
  list-style: none;
}

.auth-intro-points li {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #d9d5e7;
  font-size: .9rem;
}

.auth-intro-points li::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--auth-gradient);
  box-shadow: 0 0 13px rgba(196, 92, 255, .62);
}

.auth-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: clamp(22px, 5vw, 32px);
  border: 1px solid var(--auth-border);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .068), rgba(255, 255, 255, .014)),
    var(--auth-panel);
  box-shadow:
    0 28px 78px rgba(0, 0, 0, .48),
    inset 0 1px 0 rgba(255, 255, 255, .065);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  isolation: isolate;
  animation: authPanelAppear .52s var(--auth-ease) both;
}

.auth-panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 360px;
  height: 360px;
  left: -210px;
  top: -220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, .20), transparent 65%);
  pointer-events: none;
}

.auth-panel::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 230px;
  height: 230px;
  right: -150px;
  bottom: -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(77, 211, 255, .10), transparent 65%);
  pointer-events: none;
}

.auth-panel-head {
  margin-bottom: 22px;
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
  color: #cbaeff;
  font-size: .69rem;
  font-weight: 760;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.auth-kicker::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--auth-gradient);
}

.auth-panel h1 {
  margin: 0;
  font-size: clamp(2.15rem, 9vw, 3.25rem);
  line-height: 1;
}

.auth-subtitle {
  margin: 12px 0 0;
  color: var(--auth-text-secondary);
  font-size: .9rem;
  line-height: 1.62;
}

.auth-alert {
  margin: 0 0 17px;
  padding: 13px 14px;
  border-radius: 16px;
  font-size: .82rem;
  line-height: 1.5;
}

.auth-alert ul {
  margin: 7px 0 0;
  padding-left: 19px;
}

.auth-alert--error {
  color: #ffe8ed;
  border: 1px solid rgba(240, 120, 140, .36);
  background: rgba(240, 120, 140, .10);
}

.auth-alert--success {
  color: #dcfff0;
  border: 1px solid rgba(89, 230, 167, .32);
  background: rgba(89, 230, 167, .09);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.auth-label {
  color: #d9d5e7;
  font-size: .78rem;
  font-weight: 650;
}

.auth-note {
  color: var(--auth-text-muted);
  font-size: .72rem;
  line-height: 1.45;
}

.auth-control-wrap {
  position: relative;
  min-width: 0;
}

.auth-control {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 0 16px;
  color: var(--auth-text);
  background: rgba(255, 255, 255, .025);
  border: 1px solid rgba(178, 155, 238, .19);
  border-radius: 17px;
  outline: 0;
  font: 500 1rem/1.2 var(--auth-font-ui);
  transition:
    border-color 190ms ease,
    background 190ms ease,
    box-shadow 190ms ease;
}

.auth-control::placeholder {
  color: #6f728a;
}

.auth-control:focus {
  border-color: var(--auth-border-active);
  background: rgba(255, 255, 255, .038);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, .10), 0 0 26px rgba(139, 92, 246, .07);
}

.auth-control[aria-invalid="true"] {
  border-color: rgba(240, 120, 140, .65);
}

.auth-control--with-action {
  padding-right: 52px;
}

.auth-input-action {
  position: absolute;
  right: 7px;
  top: 50%;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  color: #c7bedb;
  border: 0;
  border-radius: 13px;
  background: transparent;
  cursor: pointer;
}

.auth-input-action svg {
  width: 20px;
  height: 20px;
}

.auth-input-action:focus-visible,
.auth-button:focus-visible,
.auth-choice:has(input:focus-visible) {
  outline: 3px solid rgba(77, 211, 255, .26);
  outline-offset: 3px;
}

.auth-actions {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.auth-button {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 54px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 18px;
  background: var(--auth-gradient);
  box-shadow:
    0 13px 30px rgba(119, 72, 245, .30),
    inset 0 1px 0 rgba(255, 255, 255, .20);
  font: 750 .91rem/1 var(--auth-font-ui);
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 200ms ease,
    background 200ms ease,
    box-shadow 200ms ease,
    opacity 180ms ease;
}

.auth-button svg {
  width: 20px;
  height: 20px;
}

.auth-button:active {
  transform: scale(.98);
}

.auth-button--quiet {
  color: var(--auth-text);
  background: rgba(255, 255, 255, .025);
  border-color: rgba(180, 151, 255, .20);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.auth-button--ghost {
  width: auto;
  min-height: 42px;
  padding: 0 12px;
  color: #cdb9ff;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.auth-button[disabled] {
  opacity: .48;
  cursor: not-allowed;
}

.auth-meta {
  margin-top: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  color: var(--auth-text-muted);
  font-size: .76rem;
  text-align: center;
}

.auth-meta a {
  color: #cdb9ff;
  text-decoration: none;
}

.auth-meta a:hover {
  color: #efe8ff;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 3px 0;
  color: var(--auth-text-muted);
  font-size: .69rem;
  text-transform: uppercase;
  letter-spacing: .13em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(184, 154, 255, .18));
}

.auth-divider::after {
  transform: scaleX(-1);
}

/* Registration wizard */
.auth-wizard-head {
  margin-bottom: 20px;
}

.auth-progress-line {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
}

.auth-progress-line > span {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: var(--auth-gradient);
  box-shadow: 0 0 16px rgba(196, 92, 255, .42);
  transition: width 320ms var(--auth-ease);
}

.auth-progress-meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--auth-text-muted);
  font-size: .72rem;
}

.auth-progress-meta strong {
  color: #dfd4f8;
  font-weight: 650;
}

.auth-step {
  display: none;
  min-width: 0;
  animation: authStepIn .34s var(--auth-ease) both;
}

.auth-step.is-active {
  display: grid;
  gap: 18px;
}

.auth-question-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  color: #e5d8ff;
  border: 1px solid rgba(184, 154, 255, .24);
  border-radius: 17px;
  background:
    radial-gradient(circle at 32% 23%, rgba(255, 255, 255, .14), transparent 35%),
    rgba(139, 92, 246, .10);
  box-shadow: 0 0 26px rgba(139, 92, 246, .10), inset 0 1px 0 rgba(255, 255, 255, .05);
}

.auth-question-icon svg {
  width: 24px;
  height: 24px;
}

.auth-question-title {
  margin: -2px 0 0;
  font-size: clamp(2rem, 9vw, 2.75rem);
  line-height: 1.02;
}

.auth-question-copy {
  margin: -8px 0 0;
  color: var(--auth-text-secondary);
  font-size: .84rem;
  line-height: 1.55;
}

.auth-step-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.auth-step-actions .auth-button:first-child:not(:only-child) {
  flex: 1;
}

.auth-step-actions .auth-button--ghost {
  flex: 0 0 auto;
}

.auth-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.auth-choice {
  position: relative;
  min-width: 0;
  min-height: 92px;
  display: grid;
  place-items: center;
  gap: 5px;
  padding: 12px 8px;
  color: #d8d4e7;
  border: 1px solid rgba(178, 155, 238, .18);
  border-radius: 18px;
  background: rgba(255, 255, 255, .025);
  text-align: center;
  cursor: pointer;
  transition: transform 160ms ease, border-color 190ms ease, background 190ms ease, box-shadow 190ms ease;
}

.auth-choice:active {
  transform: scale(.98);
}

.auth-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.auth-choice svg {
  width: 24px;
  height: 24px;
  color: #c7b1ff;
}

.auth-choice strong {
  font-size: .8rem;
  font-weight: 700;
}

.auth-choice small {
  color: var(--auth-text-muted);
  font-size: .67rem;
}

.auth-choice:has(input:checked) {
  color: #fff;
  border-color: rgba(170, 112, 255, .58);
  background: linear-gradient(145deg, rgba(139, 92, 246, .20), rgba(77, 211, 255, .06));
  box-shadow: 0 10px 28px rgba(75, 43, 144, .22), inset 0 1px 0 rgba(255, 255, 255, .07);
}

.auth-choice:has(input:checked) svg {
  color: #fff;
  filter: drop-shadow(0 0 7px rgba(196, 92, 255, .46));
}

.auth-password-strength {
  display: grid;
  gap: 7px;
}

.auth-password-strength-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
}

.auth-password-strength-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--auth-danger);
  transition: width 220ms ease, background 220ms ease;
}

.auth-password-strength-text {
  color: var(--auth-text-muted);
  font-size: .69rem;
}

/* Loading state after successful registration submit */
.auth-loading {
  position: fixed;
  z-index: 15000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  background: rgba(3, 6, 16, .78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: opacity 240ms ease, visibility 240ms ease;
}

body.is-loading .auth-loading {
  opacity: 1;
  visibility: visible;
}

.auth-loading-card {
  width: min(100%, 360px);
  padding: 28px 24px;
  text-align: center;
  border: 1px solid var(--auth-border);
  border-radius: 28px;
  background: var(--auth-panel-strong);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .58);
}

.auth-loading-orbit {
  width: 92px;
  height: 92px;
  margin: 0 auto 18px;
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid rgba(184, 154, 255, .24);
  border-radius: 50%;
  box-shadow: 0 0 34px rgba(139, 92, 246, .22);
}

.auth-loading-orbit::before {
  content: "";
  position: absolute;
  inset: -6px;
  border: 2px solid transparent;
  border-top-color: var(--auth-cyan);
  border-right-color: var(--auth-violet);
  border-radius: 50%;
  animation: authSpin 1.6s linear infinite;
}

.auth-loading-orbit svg {
  width: 36px;
  height: 36px;
  color: #dfceff;
}

.auth-loading-card h2 {
  margin: 0;
  font-family: var(--auth-font-display);
  font-size: 2rem;
  font-weight: 600;
}

.auth-loading-card p {
  margin: 9px 0 0;
  color: var(--auth-text-secondary);
  font-size: .82rem;
  line-height: 1.55;
}

/* Compact pages: forgot/reset. */
.auth-panel--compact {
  max-width: 460px;
  margin-inline: auto;
}

.auth-status-icon {
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  color: #e7d9ff;
  border: 1px solid rgba(184, 154, 255, .24);
  border-radius: 20px;
  background: rgba(139, 92, 246, .10);
  box-shadow: 0 0 28px rgba(139, 92, 246, .12), inset 0 1px 0 rgba(255, 255, 255, .05);
}

.auth-status-icon svg {
  width: 28px;
  height: 28px;
}

.auth-captcha {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 10px;
  align-items: end;
}

.auth-captcha-question {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: #e6ddf8;
  border: 1px solid rgba(178, 155, 238, .18);
  border-radius: 17px;
  background: rgba(255, 255, 255, .025);
  font-weight: 700;
}

@keyframes authPanelAppear {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes authStepIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes authSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 820px) {
  .auth-layout {
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 520px);
    gap: 22px;
  }

  .auth-intro {
    padding: 0 6px;
    text-align: center;
  }

  .auth-brand {
    justify-content: center;
    margin-bottom: 14px;
  }

  .auth-intro h1 {
    font-size: clamp(2.8rem, 14vw, 4.2rem);
  }

  .auth-intro-copy {
    margin-top: 14px;
    font-size: .9rem;
    line-height: 1.55;
  }

  .auth-intro-points {
    display: none;
  }
}

@media (max-width: 430px) {
  .auth-stage {
    align-items: start;
    padding-inline: 12px;
    padding-top: max(18px, env(safe-area-inset-top, 0px));
  }

  .auth-layout {
    gap: 16px;
  }

  .auth-intro h1 {
    font-size: clamp(2.65rem, 15vw, 3.55rem);
  }

  .auth-intro-copy {
    display: none;
  }

  .auth-panel {
    padding: 21px 17px 18px;
    border-radius: 26px;
  }

  .auth-panel h1 {
    font-size: clamp(2.05rem, 11vw, 2.65rem);
  }

  .auth-question-title {
    font-size: clamp(1.9rem, 11vw, 2.4rem);
  }

  .auth-choice-grid {
    gap: 7px;
  }

  .auth-choice {
    min-height: 88px;
    padding-inline: 5px;
  }

  .auth-choice strong {
    font-size: .72rem;
  }

  .auth-captcha {
    grid-template-columns: minmax(0, 1fr) 92px;
  }
}

@media (max-width: 350px) {
  .auth-stage {
    padding-inline: 9px;
  }

  .auth-panel {
    padding-inline: 14px;
  }

  .auth-choice-grid {
    grid-template-columns: 1fr;
  }

  .auth-choice {
    min-height: 64px;
    grid-template-columns: 28px minmax(0, 1fr);
    justify-items: start;
    text-align: left;
    padding: 10px 13px;
  }

  .auth-choice small {
    grid-column: 2;
  }
}

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