/* ============================================================
   BoomChat — Auth experience (login / register / OTP)
   ============================================================ */

[hidden] { display: none !important; }

.auth-body {
  min-height: 100vh;
  min-height: 100dvh;
  background: #f6f7fc;
}

.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 0;
}

/* ------------------------------------------------------------
   Form side
   ------------------------------------------------------------ */
.auth-main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 30px clamp(20px, 4vw, 64px) 24px;
  background:
    radial-gradient(760px 520px at 100% -6%, #e9ebff 0%, transparent 58%),
    radial-gradient(640px 460px at -8% 104%, #e2fbff 0%, transparent 56%),
    linear-gradient(180deg, #fdfdff 0%, #f6f7fc 100%);
  overflow: hidden;
}

.auth-main::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(91, 91, 214, 0.13) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 78% 12%, #000, transparent 62%);
  -webkit-mask-image: radial-gradient(circle at 78% 12%, #000, transparent 62%);
  pointer-events: none;
}

.auth-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(24px, 4vh, 48px);
}

.logo-stack { display: flex; flex-direction: column; line-height: 1.15; }
.logo-stack b { font-size: 18px; letter-spacing: -0.4px; }
.logo-stack small {
  font-size: 9.5px;
  letter-spacing: 2.2px;
  color: var(--muted-2);
  font-weight: 500;
  direction: ltr;
  text-align: right;
}

.auth-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 6px 8px 6px 14px;
  backdrop-filter: blur(8px);
}
.auth-switch a {
  color: var(--brand-ink);
  font-weight: 600;
  background: #fff;
  border-radius: 99px;
  padding: 4px 12px;
  box-shadow: 0 2px 8px rgba(46, 48, 98, 0.08);
  transition: 0.16s ease;
}
.auth-switch a:hover { color: #fff; background: var(--grad); box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3); }

/* Card */
.auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 452px;
  margin: auto;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(232, 234, 243, 0.9);
  border-radius: 28px;
  padding: clamp(22px, 3.4vw, 38px);
  box-shadow:
    0 30px 80px -34px rgba(28, 31, 78, 0.28),
    0 8px 24px -16px rgba(28, 31, 78, 0.14);
  backdrop-filter: blur(14px);
  overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--grad);
  opacity: 0.9;
}
.auth-card::after {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1), transparent 70%);
  top: -150px;
  left: -90px;
  pointer-events: none;
}

/* Test mode banner */
.test-banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: linear-gradient(135deg, #fff8e8, #fff3d6);
  border: 1px dashed #f0c36c;
  color: #8a5a00;
  border-radius: 13px;
  padding: 10px 13px;
  font-size: 11.5px;
  line-height: 1.85;
  margin-bottom: 20px;
  animation: popIn 0.25s ease;
}
.test-banner .tb-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  margin-top: 7px;
  flex: none;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
  animation: pulseSoft 1.8s infinite;
}

.auth-intro { margin-bottom: 20px; }
.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand-ink);
  background: var(--brand-soft);
  border-radius: 99px;
  padding: 4px 11px;
  margin-bottom: 13px;
}
.auth-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}
.auth-intro h1 {
  font-size: clamp(24px, 2.7vw, 30px);
  letter-spacing: -0.9px;
  margin-bottom: 6px;
}
.auth-sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.95;
}

/* Steps */
.auth-steps {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0;
}
.auth-steps li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted-2);
  position: relative;
  min-width: 0;
}
.auth-steps li:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 1.5px;
  border-radius: 2px;
  background: var(--line);
  margin: 0 8px;
  transition: background 0.3s ease;
}
.auth-steps li span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  background: #f0f2f9;
  color: var(--muted-2);
  flex: none;
  transition: 0.25s ease;
}
.auth-steps li b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-steps li.active { color: var(--brand-ink); }
.auth-steps li.active span {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 14px rgba(99, 102, 241, 0.32);
}
.auth-steps li.done { color: var(--muted); }
.auth-steps li.done span { background: #e7f9f1; color: #0b8a5f; }
.auth-steps li.done:not(:last-child)::after { background: #bdeed8; }

body[data-auth-mode='login'] .auth-steps li[data-step-dot='profile'] { display: none; }
body[data-auth-mode='login'] .auth-steps li[data-step-dot='profile'].show { display: flex; }
.auth-steps.is-hidden { display: none; }

/* Alert */
.auth-alert {
  display: none;
  border-radius: 13px;
  padding: 11px 14px;
  font-size: 12.5px;
  line-height: 1.85;
  margin-bottom: 16px;
  border: 1px solid #fbd5d5;
  background: var(--danger-soft);
  color: #b3272d;
}
.auth-alert.show { display: block; animation: popIn 0.2s ease; }
.auth-alert.success { border-color: #bdeed8; background: var(--success-soft); color: #0b7f59; }

/* Steps content */
.auth-step { display: none; }
.auth-step.active { display: block; animation: stepIn 0.28s ease; }

.field { margin-bottom: 14px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11px; color: var(--muted-2); line-height: 1.7; }

.auth-step .input {
  background: #fbfbfe;
  padding: 12px 14px;
  border-radius: 13px;
  font-size: 14px;
}
.auth-step .input:hover { border-color: #dcdfec; }

/* Phone field */
.phone-field { position: relative; display: flex; align-items: stretch; }
.phone-field .input {
  padding-left: 14px;
  padding-right: 38px;
  letter-spacing: 0.14em;
  font-weight: 500;
  text-align: right;
}
.phone-check {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  opacity: 0;
  transform-origin: center;
  transition: 0.18s ease;
  pointer-events: none;
}
.phone-field.valid .phone-check { opacity: 1; transform: translateY(-50%) scale(1); }
.phone-field.valid .input { border-color: #b9ebd6; box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.09); }

/* Buttons */
.auth-submit { margin-top: 6px; position: relative; }
.auth-submit svg { width: 17px; height: 17px; }
.auth-step .btn-lg { padding: 13px 22px; font-size: 14.5px; border-radius: 13px; }
.auth-step .btn-block { margin-top: 4px; }
.btn-link {
  border: 0;
  background: none;
  color: var(--brand-ink);
  font-size: 12px;
  font-weight: 600;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-link:hover { text-decoration: underline; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 17px 0 13px;
  color: var(--muted-2);
  font-size: 11px;
}
.auth-divider::before,
.auth-divider::after { content: ''; height: 1px; background: var(--line); flex: 1; }

/* OTP */
.otp-target {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 16px;
  line-height: 2;
}
.otp-target b { color: var(--ink); direction: ltr; unicode-bidi: embed; letter-spacing: 0.06em; }
.otp-target .btn-link { margin-right: 6px; font-size: 11.5px; }

.otp-inputs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}
.otp-inputs input {
  width: 100%;
  max-width: 54px;
  height: 58px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fbfbfe;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  outline: none;
  transition: 0.16s ease;
  caret-color: var(--brand);
}
.otp-inputs input:focus {
  border-color: #a5a8f5;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
  transform: translateY(-1px);
}
.otp-inputs input.filled {
  border-color: #c7c9f7;
  background: linear-gradient(180deg, #fff, #f7f7ff);
  color: var(--brand-ink);
}
.otp-inputs.shake { animation: shake 0.34s ease; }

.otp-test {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fffaef;
  border: 1px dashed #f0c36c;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 11.5px;
  color: #8a5a00;
  margin-bottom: 14px;
}
.otp-test button {
  border: 0;
  background: #fff3d6;
  color: #7a4f00;
  border-radius: 7px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  direction: ltr;
  transition: 0.16s ease;
}
.otp-test button:hover { background: #f59e0b; color: #fff; }

.otp-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted-2);
  margin-bottom: 16px;
}
#resendBtn {
  border: 0;
  background: none;
  color: var(--brand-ink);
  font-weight: 600;
  font-size: 11.5px;
  padding: 2px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
#resendBtn:disabled { color: var(--muted-2); font-weight: 400; cursor: default; }
#resendBtn:not(:disabled):hover { text-decoration: underline; }
#resendTimer { font-variant-numeric: tabular-nums; }

/* Profile step */
.profile-note {
  font-size: 12px;
  color: var(--muted);
  background: #f7f8ff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 13px;
  line-height: 1.9;
  margin-bottom: 15px;
}

/* Password field eye */
.input-wrap { position: relative; }
.input-wrap .input { padding-left: 44px; }
.input-wrap .eye {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: var(--muted-2);
  padding: 5px;
  display: inline-flex;
  border-radius: 8px;
}
.input-wrap .eye:hover { color: var(--ink); background: #f2f3fa; }
.input-wrap .eye svg { width: 17px; height: 17px; }

/* Footer */
.auth-terms {
  font-size: 10.5px;
  color: var(--muted-2);
  text-align: center;
  margin-top: 18px;
  line-height: 1.95;
}
.auth-terms a { color: var(--brand-ink); font-weight: 500; }

.auth-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted-2);
  padding-top: 26px;
}
.auth-foot a { color: var(--muted); }
.auth-foot a:hover { color: var(--brand-ink); }

/* ------------------------------------------------------------
   Art / showcase side
   ------------------------------------------------------------ */
.auth-art {
  position: relative;
  align-self: start;
  height: calc(100vh - 28px);
  height: calc(100dvh - 28px);
  overflow: hidden;
  margin: 14px 0 14px 14px;
  border-radius: 34px;
  padding: clamp(28px, 4vw, 54px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background:
    radial-gradient(1000px 620px at 84% -14%, rgba(124, 58, 237, 0.85) 0%, transparent 58%),
    radial-gradient(820px 600px at -12% 108%, rgba(6, 182, 212, 0.55) 0%, transparent 56%),
    linear-gradient(155deg, #131331 0%, #191243 52%, #0a1029 100%);
  isolation: isolate;
}

.auth-art::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at 72% 26%, #000, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 72% 26%, #000, transparent 70%);
  opacity: 0.7;
  z-index: -1;
}

.art-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  z-index: -2;
  animation: orbFloat 14s ease-in-out infinite;
}
.art-orb.orb-a { width: 340px; height: 340px; background: #7c3aed; top: -100px; left: 5%; }
.art-orb.orb-b { width: 300px; height: 300px; background: #06b6d4; bottom: -110px; right: -60px; animation-delay: -5s; }
.art-orb.orb-c { width: 220px; height: 220px; background: #ec4899; top: 44%; left: 52%; opacity: 0.32; animation-delay: -9s; }

.art-top { position: relative; z-index: 2; }
.art-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 99px;
  padding: 6px 13px;
  backdrop-filter: blur(10px);
}
.art-pill .pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
  animation: pulseSoft 1.8s infinite;
}

.art-content {
  position: relative;
  z-index: 2;
  max-width: 470px;
  margin: 26px 0;
}
.art-content h2 {
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.42;
  letter-spacing: -0.9px;
  margin-bottom: 14px;
}
.art-content h2 .grad {
  background: linear-gradient(120deg, #a5b4fc, #67e8f9 60%, #f0abfc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.art-content > p {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13.5px;
  line-height: 2.05;
  margin-bottom: 26px;
  max-width: 420px;
}

/* Chat mock */
.art-chat {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.7);
  max-width: 400px;
  margin-bottom: 26px;
}
.art-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 2px;
}
.art-chat-head .chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: linear-gradient(135deg, #818cf8, #22d3ee);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}
.art-chat-head b { display: block; font-size: 12px; }
.art-chat-head small { font-size: 10px; color: rgba(255, 255, 255, 0.55); }
.art-chat-head .chat-live {
  margin-right: auto;
  font-size: 9.5px;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.24);
  border-radius: 99px;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.art-chat-head .chat-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #34d399;
}

.art-msg {
  max-width: 86%;
  font-size: 11.5px;
  line-height: 1.85;
  padding: 9px 13px;
  border-radius: 14px;
  border-top-right-radius: 5px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
}
.art-msg.out {
  align-self: flex-start;
  margin-right: auto;
  border-radius: 14px;
  border-top-right-radius: 14px;
  border-top-left-radius: 5px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent;
  box-shadow: 0 10px 24px -12px rgba(99, 102, 241, 0.9);
}
.art-msg small { display: block; font-size: 9px; opacity: 0.55; margin-top: 3px; }
.art-msg.otp {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255, 255, 255, 0.95);
  border-color: #fff;
  color: #1b1d3a;
  max-width: 100%;
}
.art-msg.otp code {
  direction: ltr;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: #5b5bd6;
  padding-right: 2px;
}
.art-msg.otp small { color: #7b8093; opacity: 1; }

/* Feature list */
.art-features { display: grid; gap: 10px; max-width: 430px; }
.art-feature {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.art-feature .af-ico {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.art-feature .af-ico svg { width: 17px; height: 17px; color: #c7d2fe; }
.art-feature b { display: block; font-size: 11.5px; }
.art-feature small { font-size: 10px; color: rgba(255, 255, 255, 0.55); }

.art-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.5);
  padding-top: 22px;
}
.art-foot .art-stats { display: flex; gap: 20px; flex-wrap: wrap; }
.art-foot b { display: block; font-size: 16px; color: #fff; letter-spacing: -0.3px; }
.art-foot span { font-size: 9.5px; }

/* ------------------------------------------------------------
   Animations
   ------------------------------------------------------------ */
@keyframes stepIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes orbFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-18px, 22px, 0) scale(1.08); }
}
@keyframes pulseSoft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-height: 940px) {
  .auth-art { padding: clamp(22px, 2.6vw, 34px); }
  .art-content { margin: 16px 0; }
  .art-content h2 { font-size: 26px; }
  .art-content > p { font-size: 12px; line-height: 1.9; margin-bottom: 16px; }
  .art-chat { gap: 7px; padding: 12px; margin-bottom: 16px; }
  .art-msg { font-size: 10.5px; padding: 7px 10px; }
  .art-feature { padding: 8px 10px; }
  .art-features { gap: 7px; }
  .art-foot { padding-top: 12px; }
}

@media (max-height: 820px) {
  .art-features { display: none; }
  .art-content h2 { font-size: 24px; }
  .art-content > p { margin-bottom: 12px; }
}

@media (max-width: 1080px) {
  .auth-page { grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); }
  .auth-art { padding: 30px; }
  .art-content h2 { font-size: 30px; }
}

@media (max-width: 940px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-main { min-height: 100vh; padding-top: 22px; }
  .auth-card { margin-top: 10px; margin-bottom: 10px; }
}

@media (max-width: 520px) {
  .auth-main { padding: 18px 16px 20px; }
  .auth-top { margin-bottom: 18px; }
  .auth-card {
    border-radius: 22px;
    padding: 22px 18px;
    box-shadow: 0 18px 44px -26px rgba(28, 31, 78, 0.3);
  }
  .auth-switch span { display: none; }
  .auth-switch { padding: 5px; }
  .auth-switch a { padding: 5px 11px; font-size: 12px; }
  .auth-steps li b { font-size: 10.5px; }
  .auth-steps li { flex: 1; gap: 5px; }
  .auth-steps li span { width: 20px; height: 20px; font-size: 10px; }
  .auth-steps li:not(:last-child)::after { margin: 0 6px; min-width: 10px; }
  .auth-step .input { font-size: 16px; }
  .otp-inputs { gap: 5px; }
  .otp-inputs input { height: 52px; border-radius: 12px; font-size: 19px; }
  .otp-test { flex-wrap: wrap; row-gap: 3px; }
  .auth-foot { justify-content: center; text-align: center; }
  .art-msg.otp { flex-direction: row; }
}

@media (max-width: 359px) {
  .auth-steps li b { display: none; }
  .auth-steps li { gap: 0; }
  .auth-steps li:not(:last-child)::after { min-width: 18px; }
}

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