:root {
  color-scheme: light;
  --auth-bg: #f8fafc;
  --auth-surface: #ffffff;
  --auth-panel: #f8fafc;
  --auth-soft: #f1f5f9;
  --auth-soft-blue: #eff6ff;
  --auth-border: #e2e8f0;
  --auth-border-strong: #cbd5e1;
  --auth-text: #0f172a;
  --auth-muted: #64748b;
  --auth-muted-strong: #475569;
  --auth-brand: #2563eb;
  --auth-brand-hover: #1d4ed8;
  --auth-success: #10b981;
  --auth-warning: #d97706;
  --auth-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--auth-bg);
  color: var(--auth-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.auth-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(14px, 2.4vh, 32px) 16px;
}

.auth-kicker svg,
.auth-panel-back svg,
.auth-meta-icon svg {
  width: 18px;
  height: 18px;
}

.auth-main {
  width: min(1000px, calc(100vw - 32px));
  min-height: clamp(620px, calc(100svh - 64px), 700px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.45fr) minmax(420px, 0.55fr);
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 28px;
  background: var(--auth-surface);
  box-shadow: var(--auth-shadow);
  animation: authRise 420ms ease both;
}

.auth-visual {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 34px;
  min-height: 640px;
  padding: clamp(28px, 4.4vh, 44px) clamp(32px, 4.8vw, 48px);
  overflow: hidden;
  border-right: 1px solid var(--auth-border);
  background:
    linear-gradient(145deg, rgba(248, 250, 252, 0.96), rgba(239, 246, 255, 0.78)),
    var(--auth-panel);
  color: var(--auth-text);
}

.auth-visual::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto auto;
  z-index: -1;
  width: 72%;
  height: 54%;
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.84), rgba(255, 255, 255, 0));
  clip-path: polygon(26% 0, 100% 0, 100% 100%, 56% 72%);
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid var(--auth-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--auth-muted-strong);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-kicker svg {
  color: #94a3b8;
}

.auth-visual h1 {
  max-width: 430px;
  margin: 24px 0 16px;
  color: var(--auth-text);
  font-size: clamp(40px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: 0;
}

.auth-visual h1 span {
  color: var(--auth-brand);
}

.auth-visual p {
  max-width: 390px;
  margin: 0;
  color: var(--auth-muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.7;
}

.auth-figure-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(310px, 88%);
  min-height: 306px;
  margin: 22px auto 2px;
  animation: authFloat 6s ease-in-out infinite;
}

.auth-figure-stage::before {
  content: "";
  position: absolute;
  width: 86%;
  aspect-ratio: 1;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  background:
    radial-gradient(circle at 45% 35%, rgba(191, 219, 254, 0.9), rgba(219, 234, 254, 0.56) 48%, rgba(219, 234, 254, 0) 74%);
}

.auth-figure-stage::after {
  content: "";
  position: absolute;
  z-index: 0;
  width: 70%;
  height: 22px;
  bottom: 2%;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(147, 197, 253, 0.32);
  filter: blur(8px);
}

.auth-figure-hue {
  position: absolute;
  z-index: 0;
  width: 76%;
  height: 54%;
  right: 6%;
  bottom: 18%;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(14, 165, 233, 0.14));
  filter: blur(22px);
}

.auth-figure-image {
  position: relative;
  z-index: 1;
  display: block;
  width: min(272px, 92%);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 24px 28px rgba(15, 23, 42, 0.16));
}

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

.auth-proof div {
  min-width: 0;
  padding: 13px 12px;
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.auth-proof div:hover {
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.auth-proof strong,
.auth-proof span {
  display: block;
}

.auth-proof strong {
  color: var(--auth-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.auth-proof span {
  margin-top: 5px;
  color: #1e293b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.28;
  overflow-wrap: anywhere;
  white-space: normal;
}

.auth-panel {
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: clamp(28px, 4.4vh, 44px) clamp(32px, 4.8vw, 48px);
  background: var(--auth-surface);
}

.auth-card {
  width: min(100%, 456px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

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

.auth-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.auth-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--auth-muted);
  font-size: 12px;
  font-weight: 800;
}

.auth-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--auth-success);
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.1);
}

.auth-status-dot.is-loading {
  background: var(--auth-brand);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.1);
  animation: authPulse 1.6s ease-in-out infinite;
}

.auth-status-dot.is-warning {
  background: var(--auth-warning);
  box-shadow: 0 0 0 6px rgba(217, 119, 6, 0.1);
}

.auth-panel-back {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid #dbeafe;
  border-radius: 13px;
  background: white;
  color: #334155;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.auth-panel-back:hover {
  border-color: #bfdbfe;
  background: var(--auth-soft-blue);
  color: var(--auth-brand);
  transform: translateY(-1px);
}

.auth-heading {
  margin-top: 16px;
}

.auth-heading h2,
.auth-heading p {
  margin: 0;
}

.auth-heading h2 {
  color: var(--auth-text);
  font-size: clamp(28px, 4vw, 34px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: 0;
}

.auth-heading p {
  max-width: 390px;
  margin-top: 8px;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 1.55;
}

.auth-switch {
  width: min(100%, 454px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 22px 0 22px;
  padding: 4px;
  border-radius: 12px;
  background: var(--auth-soft);
}

.auth-switch a {
  display: grid;
  place-items: center;
  min-height: 40px;
  border-radius: 9px;
  color: var(--auth-muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.auth-switch a:hover {
  color: var(--auth-text);
}

.auth-switch a.is-active {
  background: white;
  color: var(--auth-text);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.auth-mount {
  width: 100%;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.auth-clerk-root {
  width: 100%;
  min-height: 280px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.auth-mount .cl-rootBox,
.auth-mount .cl-cardBox,
.auth-mount .cl-card {
  width: min(100%, 400px) !important;
  max-width: 400px !important;
  margin-inline: auto !important;
}

.auth-mount .cl-card,
.auth-mount .cl-cardBox {
  background: transparent;
}

.auth-status {
  display: grid;
  gap: 14px;
  min-height: 280px;
  align-content: center;
  padding: 26px;
  border: 1px solid var(--auth-border);
  border-radius: 16px;
  background: var(--auth-panel);
  color: var(--auth-muted);
}

.auth-status strong {
  color: var(--auth-text);
  font-size: 16px;
}

.auth-status p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.auth-loader {
  width: 34px;
  height: 34px;
  border: 3px solid #dbeafe;
  border-top-color: var(--auth-brand);
  border-radius: 999px;
  animation: authSpin 900ms linear infinite;
}

.auth-meta {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-top: 18px;
  color: var(--auth-muted);
  font-size: 12px;
  line-height: 1.55;
}

.auth-meta-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--auth-soft);
  color: #94a3b8;
}

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

@keyframes authPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(0.78);
    opacity: 0.7;
  }
}

@keyframes authFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes authRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 980px) {
  .auth-main {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .auth-visual {
    min-height: 420px;
    border-right: 0;
    border-bottom: 1px solid var(--auth-border);
  }

  .auth-panel {
    align-items: center;
  }
}

@media (min-width: 981px) and (max-height: 880px) {
  .auth-shell {
    padding-block: 12px;
  }

  .auth-main {
    min-height: calc(100svh - 24px);
  }

  .auth-visual,
  .auth-panel {
    padding-block: 28px;
  }

  .auth-visual {
    gap: 22px;
  }

  .auth-visual h1 {
    margin: 18px 0 12px;
    font-size: clamp(38px, 4.2vw, 48px);
    line-height: 1.02;
  }

  .auth-visual p {
    line-height: 1.55;
  }

  .auth-figure-stage {
    width: min(258px, 82%);
    min-height: 252px;
    margin-top: 12px;
  }

  .auth-figure-image {
    width: min(230px, 88%);
  }

  .auth-proof {
    gap: 10px;
  }

  .auth-proof div {
    padding: 10px;
  }

  .auth-card {
    gap: 16px;
  }

  .auth-heading {
    margin-top: 14px;
  }

  .auth-heading h2 {
    font-size: clamp(28px, 3.4vw, 32px);
  }

  .auth-switch {
    margin: 18px 0 20px;
  }

  .auth-meta {
    padding-top: 14px;
    line-height: 1.42;
  }

  .auth-meta-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
  }
}

@media (max-width: 640px) {
  body {
    background: #eaf3ff;
  }

  .auth-shell {
    padding: 0;
    background: linear-gradient(180deg, #f8fbff 0%, #edf5ff 52%, #e7f0fb 100%);
  }

  .auth-main {
    width: min(100%, 430px);
    min-height: 100svh;
    margin: 0;
    display: block;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .auth-visual {
    display: none;
  }

  .auth-panel {
    min-height: 100svh;
    display: block;
    padding: max(18px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
    background: transparent;
  }

  .auth-card {
    width: 100%;
    max-width: 380px;
    min-height: calc(100svh - 42px);
    margin: 0 auto;
    justify-content: flex-start;
    gap: 0;
  }

  .auth-mobile-intro {
    display: block;
  }

  .auth-mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 40px;
  }

  .auth-mobile-kicker,
  .auth-mobile-back {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(203, 213, 225, 0.82);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
    color: #334155;
    text-decoration: none;
    backdrop-filter: blur(14px);
  }

  .auth-mobile-kicker {
    padding: 0 12px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .auth-mobile-kicker-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--auth-brand);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  }

  .auth-mobile-back {
    padding: 0 13px;
    font-size: 13px;
    font-weight: 750;
  }

  .auth-mobile-hero {
    display: grid;
    justify-items: center;
    margin: 22px 0 18px;
    text-align: center;
  }

  .auth-mobile-avatar {
    width: 112px;
    height: 112px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    border: 4px solid rgba(255, 255, 255, 0.96);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(247, 251, 255, 0.96), rgba(226, 239, 255, 0.86));
    box-shadow:
      0 12px 28px rgba(37, 99, 235, 0.14),
      inset 0 0 0 1px rgba(191, 219, 254, 0.72);
    overflow: hidden;
  }

  .auth-mobile-avatar img {
    width: 78px;
    max-height: 96px;
    object-fit: contain;
    transform: translateY(4px);
    filter: drop-shadow(0 8px 10px rgba(15, 23, 42, 0.12));
  }

  .auth-mobile-hero h1 {
    max-width: 340px;
    margin: 0;
    color: var(--auth-text);
    font-size: clamp(28px, 7.3vw, 32px);
    font-weight: 900;
    line-height: 1.04;
    letter-spacing: 0;
  }

  .auth-mobile-hero h1 span {
    color: var(--auth-brand);
  }

  .auth-mobile-hero p {
    max-width: 304px;
    margin: 12px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.55;
  }

  .auth-card-top,
  .auth-heading {
    display: none;
  }

  .auth-switch {
    width: 100%;
    margin: 0 0 20px;
    padding: 4px;
    border: 1px solid rgba(203, 213, 225, 0.72);
    border-radius: 13px;
    background: rgba(241, 245, 249, 0.88);
  }

  .auth-switch a {
    min-height: 40px;
    border-radius: 9px;
    font-size: 13px;
  }

  .auth-mount {
    min-height: 0;
    padding: 0;
    border-radius: 0;
  }

  .auth-clerk-root {
    min-height: 0;
  }

  .auth-mount .cl-rootBox,
  .auth-mount .cl-cardBox,
  .auth-mount .cl-card {
    width: 100% !important;
    max-width: 356px !important;
  }

  .auth-status {
    min-height: 250px;
    padding: 22px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
  }

  .auth-meta {
    display: block;
    margin: auto auto 0;
    padding-top: 24px;
    max-width: 280px;
    color: #8ba0bd;
    font-size: 12px;
    line-height: 1.45;
    text-align: center;
  }

  .auth-meta-icon {
    display: none;
  }
}

@media (max-width: 380px) {
  .auth-panel {
    padding-inline: 16px;
  }

  .auth-mobile-hero {
    margin-top: 18px;
  }

  .auth-mobile-avatar {
    width: 96px;
    height: 96px;
    margin-bottom: 14px;
  }

  .auth-mobile-avatar img {
    width: 68px;
    max-height: 84px;
  }

  .auth-mobile-hero h1 {
    font-size: 27px;
  }

  .auth-mobile-hero p {
    font-size: 13px;
  }
}
