/*
 * Zapbuild Smartbot — auth layout
 * Faithful port of the source AuthLayout.tsx: animated dark story panel
 * (gradient washes, faint grid, gradient headline, glassmorphic widget
 * card with a scripted conversation, floating stat chip, floating
 * feature pills) + the white auth card on the right.
 */

.zb-auth {
  min-height: 100vh;
  width: 100%;
  background: hsl(var(--zb-bg-page));
}

@media (min-width: 1024px) {
  .zb-auth {
    display: grid;
    grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
  }
}

/* ---------------- Left: story panel ---------------- */

.zb-auth__story {
  display: none;
  position: relative;
  overflow: hidden;
  color: hsl(var(--zb-text-inverse));
  background: hsl(var(--zb-bg-sidebar));
}

@media (min-width: 1024px) {
  .zb-auth__story { display: flex; }
}

.zb-auth__wash-a,
.zb-auth__wash-b,
.zb-auth__corner,
.zb-auth__grid {
  position: absolute;
  pointer-events: none;
}

.zb-auth__wash-a {
  top: -33%; left: -25%; height: 120%; width: 120%;
  border-radius: 999px; filter: blur(64px);
  background: radial-gradient(circle at 30% 30%, hsl(var(--zb-accent) / 0.55), transparent 60%);
  animation: zb-auth-wash-a 30s linear infinite alternate;
}
.zb-auth__wash-b {
  bottom: -33%; right: -25%; height: 110%; width: 110%;
  border-radius: 999px; filter: blur(64px);
  background: radial-gradient(circle at 60% 60%, hsl(var(--zb-accent) / 0.35), transparent 65%);
  animation: zb-auth-wash-b 30s linear infinite alternate;
}
.zb-auth__corner {
  bottom: 0; right: 0; height: 70%; width: 70%;
  background: radial-gradient(circle at 80% 90%, rgba(0,0,0,0.55), transparent 60%);
}
.zb-auth__grid {
  inset: 0; opacity: 0.06;
  background-image:
    linear-gradient(hsl(var(--zb-text-inverse)) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--zb-text-inverse)) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 75%);
}

@keyframes zb-auth-wash-a {
  0%   { opacity: 0.06; transform: translate3d(-6%, -4%, 0); }
  100% { opacity: 0.12; transform: translate3d(6%, 4%, 0); }
}
@keyframes zb-auth-wash-b {
  0%   { opacity: 0.06; transform: translate3d(5%, 6%, 0); }
  100% { opacity: 0.12; transform: translate3d(-5%, -6%, 0); }
}

.zb-auth__story-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 40px;
}
@media (min-width: 1280px) {
  .zb-auth__story-inner { padding: 56px; }
}

.zb-auth__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.zb-auth__brand img { height: 30px; width: 30px; }
.zb-auth__brand span { font-weight: 600; font-size: var(--text-md); color: rgba(255,255,255,0.95); }

.zb-auth__headline {
  margin: 40px auto 0;
  width: 100%;
  max-width: 560px;
  text-align: center;
}
.zb-auth__headline h2 {
  font-size: 28px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.85) 55%, hsl(var(--zb-accent)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@media (min-width: 1280px) {
  .zb-auth__headline h2 { font-size: 34px; }
}
.zb-auth__headline p {
  margin: 12px auto 0;
  max-width: 48ch;
  font-size: var(--text-md);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
}

/* Vignette (widget card + chip + pills) */

.zb-auth__vignette-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 0 40px;
}

.zb-auth__vignette {
  position: relative;
  width: 100%;
  max-width: 520px;
}

.zb-auth__glow {
  position: absolute;
  inset: -64px;
  z-index: 1;
  border-radius: 999px;
  filter: blur(48px);
  background: radial-gradient(ellipse at center, hsl(var(--zb-accent) / 0.14), transparent 65%);
  animation: zb-card-glow-pulse 6s ease-in-out infinite;
}
.zb-auth__glow-cool {
  position: absolute;
  inset: -40px;
  z-index: 1;
  border-radius: 32px;
  filter: blur(32px);
  background: radial-gradient(ellipse at 30% 40%, rgba(56,189,248,0.10), transparent 60%);
}
@keyframes zb-card-glow-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 0.85; transform: scale(1.04); }
}

.zb-auth__card-mock {
  position: relative;
  z-index: 10;
  margin: 0 auto;
  width: 400px;
  max-width: 100%;
  transform: rotate(-2.5deg);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  background: linear-gradient(155deg, rgba(255,255,255,0.94) 0%, rgba(255,255,255,0.80) 55%, rgba(255,255,255,0.92) 100%);
  box-shadow: 0 40px 80px -24px rgba(0,0,0,0.55), 0 20px 40px -16px rgba(0,0,0,0.40), 0 8px 16px -8px rgba(0,0,0,0.25);
  animation: zb-card-float 8s ease-in-out infinite;
}
@keyframes zb-card-float {
  0%   { transform: rotate(-2.5deg) translate3d(0, -4px, 0); }
  50%  { transform: rotate(-2.5deg) translate3d(0, 4px, 0); }
  100% { transform: rotate(-2.5deg) translate3d(0, -4px, 0); }
}

.zb-auth__card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: hsl(var(--zb-accent));
}
.zb-auth__card-head-left { display: flex; align-items: center; gap: 10px; }
.zb-auth__card-avatar {
  height: 32px; width: 32px; border-radius: 999px;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  color: white;
}
.zb-auth__card-head-name { font-size: 13px; font-weight: 600; color: white; line-height: 1.2; }
.zb-auth__card-head-status { display: flex; align-items: center; gap: 5px; font-size: 10px; color: rgba(255,255,255,0.8); margin-top: 2px; }
.zb-auth__card-head-status span { height: 6px; width: 6px; border-radius: 999px; background: white; }
.zb-auth__card-head-icons { display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,0.85); }

.zb-auth__card-body {
  position: relative;
  min-height: 220px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(248,250,252,0.65) 0%, rgba(241,245,249,0.5) 100%);
}

.zb-auth__bubble-row { display: flex; }
.zb-auth__bubble-row.is-end { justify-content: flex-end; }
.zb-auth__bubble {
  max-width: 80%;
  border-radius: var(--radius-lg);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}
.zb-auth__bubble.is-visitor {
  background: hsl(var(--zb-accent));
  color: white;
  border-bottom-right-radius: 4px;
}
.zb-auth__bubble.is-ai {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(255,255,255,0.7);
  color: hsl(var(--zb-text-primary));
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 12px -4px rgba(15,23,42,0.12);
}

.zb-auth__ai-row { display: flex; align-items: flex-end; gap: 8px; margin-top: 12px; }
.zb-auth__ai-avatar {
  height: 24px; width: 24px; border-radius: 999px; flex-shrink: 0;
  background: hsl(var(--zb-accent) / 0.14);
  display: flex; align-items: center; justify-content: center;
  color: hsl(var(--zb-accent-active));
}

.zb-auth__mini-table { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 6px; }
.zb-auth__mini-table td { padding: 4px 0; border-top: 1px solid hsl(var(--zb-border)); }
.zb-auth__mini-table td:first-child { color: hsl(var(--zb-text-muted)); padding-right: 8px; border-right: 1px solid hsl(var(--zb-border)); }
.zb-auth__mini-table td:last-child { padding-left: 8px; font-weight: 500; }

.zb-auth__sysline {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 14px; font-size: 11px; color: hsl(var(--zb-text-muted));
}
.zb-auth__sysline span.badge {
  height: 16px; width: 16px; border-radius: 999px; background: hsl(var(--zb-info));
  color: white; font-size: 9px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

.zb-auth__card-input {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.55);
}
.zb-auth__card-input span { flex: 1; font-size: 12px; color: rgba(100,116,139,0.8); }
.zb-auth__card-send {
  height: 28px; width: 28px; border-radius: 999px; flex-shrink: 0;
  background: hsl(var(--zb-accent)); color: white;
  display: flex; align-items: center; justify-content: center;
}

.zb-auth__stat-chip {
  display: none;
  position: absolute;
  z-index: 40;
  bottom: -48px; left: -40px;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-radius: var(--radius-xl);
  background: hsl(var(--zb-bg-sidebar));
  border: 1px solid hsl(var(--zb-accent) / 0.3);
  box-shadow: 0 12px 24px rgba(0,0,0,0.35);
  transform: rotate(2deg);
  white-space: nowrap;
}
@media (min-width: 1280px) { .zb-auth__stat-chip { display: flex; } }
.zb-auth__stat-chip .value { font-size: 18px; font-weight: 600; color: hsl(var(--zb-accent)); line-height: 1; }
.zb-auth__stat-chip .label { font-size: 10px; color: rgba(255,255,255,0.6); margin-top: 2px; }

.zb-auth__pill {
  display: none;
  position: absolute;
  z-index: 30;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: white;
  background: hsl(var(--zb-bg-sidebar) / 0.92);
  border: 1px solid hsl(var(--zb-accent) / 0.3);
  box-shadow: 0 6px 14px rgba(0,0,0,0.30);
  animation: zb-pill-drift 8s ease-in-out infinite;
}
@media (min-width: 1280px) { .zb-auth__pill { display: inline-flex; } }
.zb-auth__pill .zb-icon { color: hsl(var(--zb-accent)); width: 12px; height: 12px; }
@keyframes zb-pill-drift {
  0%   { transform: translate3d(0, 0, 0); }
  50%  { transform: translate3d(0, -4px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
.zb-auth__pill--1 { top: -24px; left: -20px; animation-duration: 7s; }
.zb-auth__pill--2 { top: -16px; right: -20px; animation-duration: 8s; animation-delay: -0.8s; }
.zb-auth__pill--3 { top: 50%; left: -48px; transform: translateY(-50%); animation-duration: 9s; animation-delay: -1.6s; }
.zb-auth__pill--4 { bottom: -20px; right: -20px; animation-duration: 10s; animation-delay: -2.4s; }

.zb-auth__footnote {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

/* ---------------- Right: auth card panel ---------------- */

.zb-auth__panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 24px;
  min-height: 100vh;
}

.zb-auth__panel-wash {
  position: absolute;
  top: -160px; right: -160px;
  height: 560px; width: 560px;
  border-radius: 999px;
  filter: blur(64px);
  pointer-events: none;
  background: radial-gradient(circle at 30% 30%, hsl(var(--zb-accent) / 0.45), transparent 65%);
  animation: zb-right-wash 25s ease-in-out infinite alternate;
}
@keyframes zb-right-wash {
  0%   { transform: translate3d(0, 0, 0) scale(1); opacity: 0.35; }
  100% { transform: translate3d(-8%, 8%, 0) scale(1.08); opacity: 0.55; }
}

.zb-auth__content {
  position: relative;
  width: 100%;
  max-width: 400px;
}
@media (min-width: 1024px) {
  .zb-auth__content { margin-top: -24px; }
}

.zb-auth__mobile-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
@media (min-width: 1024px) {
  .zb-auth__mobile-logo { display: none; }
}
.zb-auth__mobile-logo img { height: 30px; width: 30px; }
.zb-auth__mobile-logo span { font-weight: 600; font-size: var(--text-md); }

.zb-auth__card {
  width: 100%;
  background: hsl(var(--zb-bg-card));
  border: 1px solid hsl(var(--zb-border));
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
  padding: 32px;
  animation: zb-card-rise 250ms ease-out both;
}
@keyframes zb-card-rise {
  0%   { opacity: 0; transform: translate3d(0, 8px, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}

.zb-auth__card h1 {
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.zb-auth__card > p.zb-auth__subtitle {
  margin-top: 6px;
  font-size: var(--text-sm);
  color: hsl(var(--zb-text-muted));
}

.zb-auth__form { margin-top: 24px; display: flex; flex-direction: column; gap: 16px; }

.zb-auth__alert {
  border-radius: var(--radius-md);
  border: 1px solid hsl(var(--zb-danger) / 0.3);
  background: hsl(var(--zb-danger) / 0.08);
  color: hsl(var(--zb-danger));
  padding: 10px 12px;
  font-size: var(--text-sm);
}

.zb-auth__row { display: flex; align-items: center; justify-content: space-between; }
.zb-auth__link { font-size: var(--text-xs); font-weight: 500; color: hsl(var(--zb-accent-active)); }
.zb-auth__link:hover { text-decoration: underline; }

.zb-auth__password-field { position: relative; }
.zb-auth__password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--zb-text-muted));
  display: flex;
}
.zb-auth__password-toggle:hover { color: hsl(var(--zb-text-primary)); }

.zb-auth__footer-text {
  text-align: center;
  font-size: var(--text-sm);
  color: hsl(var(--zb-text-muted));
}

.zb-auth__hint {
  border-radius: var(--radius-md);
  border: 1px solid hsl(var(--zb-border));
  background: hsl(var(--zb-bg-input) / 0.6);
  padding: 10px 12px;
  text-align: center;
  font-size: 11px;
  color: hsl(var(--zb-text-muted));
}
.zb-auth__hint code {
  font-weight: 600;
  color: hsl(var(--zb-text-primary));
  background: hsl(var(--zb-bg-input));
  padding: 1px 4px;
  border-radius: 4px;
}

.zb-auth__steps { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.zb-auth__step { flex: 1; }
.zb-auth__step-top { display: flex; align-items: center; gap: 8px; }
.zb-auth__step-badge {
  height: 20px; width: 20px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600;
  background: hsl(var(--zb-bg-input)); color: hsl(var(--zb-text-muted));
}
.zb-auth__step.is-active .zb-auth__step-badge { background: hsl(var(--zb-accent)); color: white; }
.zb-auth__step-label { font-size: var(--text-xs); font-weight: 500; color: hsl(var(--zb-text-muted)); }
.zb-auth__step.is-current .zb-auth__step-label { color: hsl(var(--zb-text-primary)); }
.zb-auth__step-bar { margin-top: 6px; height: 4px; border-radius: 999px; background: hsl(var(--zb-bg-input)); }
.zb-auth__step.is-active .zb-auth__step-bar { background: hsl(var(--zb-accent)); }

.zb-auth__strength { display: flex; align-items: center; gap: 8px; }
.zb-auth__strength-bar { flex: 1; height: 4px; border-radius: 999px; background: hsl(var(--zb-bg-input)); overflow: hidden; }
.zb-auth__strength-fill { height: 100%; border-radius: 999px; transition: width var(--zb-dur-fast) var(--zb-ease); }

.zb-auth__success-icon {
  margin: 0 auto;
  height: 48px; width: 48px; border-radius: 999px;
  background: hsl(var(--zb-success) / 0.12);
  color: hsl(var(--zb-success));
  display: flex; align-items: center; justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  .zb-auth__wash-a, .zb-auth__wash-b, .zb-auth__card-mock, .zb-auth__glow,
  .zb-auth__pill, .zb-auth__panel-wash {
    animation: none !important;
  }
}
