:root {
  --bg: #0e0f13;
  --card: #12141a;
  --muted: #9aa3b2;
  --text: #e8ecf1;
  --brand: #5b43ea; /* homepage brand purple */
  --brand-2: #7c5cf0; /* lighter */
  --ring: rgba(91, 67, 234, 0.25);
  --primary: var(--brand);
  --primary-fg: #0b1220;
  --border: #1e2230;
  --danger: #ef4444;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden]:not(#megaServices) { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Peyda", system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", sans-serif;
  background: #0f0c29;
  background: -webkit-linear-gradient(to right, #24243e, #302b63, #0f0c29);
  background: linear-gradient(to right, #24243e, #302b63, #0f0c29);
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 25% 25%, rgba(91, 67, 234, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 75% 75%, rgba(124, 92, 240, 0.03) 0%, transparent 40%),
    repeating-linear-gradient(45deg, transparent, transparent 80px, rgba(255, 255, 255, 0.008) 80px, rgba(255, 255, 255, 0.008) 82px),
    radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    radial-gradient(circle at 35% 45%, rgba(255, 255, 255, 0.08) 2px, transparent 2px),
    radial-gradient(circle at 55% 25%, rgba(255, 255, 255, 0.1) 1.5px, transparent 1.5px),
    radial-gradient(circle at 75% 35%, rgba(255, 255, 255, 0.06) 2.5px, transparent 2.5px),
    radial-gradient(circle at 85% 65%, rgba(255, 255, 255, 0.09) 1px, transparent 1px),
    radial-gradient(circle at 25% 75%, rgba(255, 255, 255, 0.07) 2px, transparent 2px),
    radial-gradient(circle at 65% 85%, rgba(255, 255, 255, 0.11) 1.8px, transparent 1.8px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 200px 200px, 300px 300px, 250px 250px, 350px 350px, 180px 180px, 280px 280px, 320px 320px;
  background-position: 0 0, 0 0, 0 0, 0 0, 50px 100px, 100px 50px, 150px 200px, 200px 150px, 250px 100px, 300px 250px;
  pointer-events: none;
  z-index: 0;
}

/* Ensure interactive elements inherit the brand font across browsers */
button, .btn, .back-shop, input, label, a { font-family: inherit; }

.auth-shell {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(91, 67, 234, 0.25) 0 6px, transparent 7px),
    radial-gradient(circle, rgba(124, 92, 240, 0.2) 0 4px, transparent 5px),
    radial-gradient(circle, rgba(91, 67, 234, 0.18) 0 8px, transparent 9px),
    radial-gradient(circle, rgba(124, 92, 240, 0.15) 0 5px, transparent 6px);
  background-repeat: no-repeat;
  background-position: 20% 30%, 70% 20%, 78% 76%, 32% 80%;
  opacity: 0.8;
  animation: floatLayerA 28s ease-in-out infinite alternate;
}

@keyframes floatLayerA {
  0%   { transform: translate3d(0, 0, 0); background-position: 20% 30%, 70% 20%, 78% 76%, 32% 80%; }
  50%  { transform: translate3d(14px, -10px, 0); background-position: 22% 33%, 68% 22%, 76% 73%, 35% 83%; }
  100% { transform: translate3d(0, 0, 0); background-position: 20% 30%, 70% 20%, 78% 76%, 32% 80%; }
}

.auth-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(124, 92, 240, 0.2) 0 4px, transparent 5px),
    radial-gradient(circle, rgba(91, 67, 234, 0.22) 0 6px, transparent 7px),
    radial-gradient(circle, rgba(124, 92, 240, 0.18) 0 4px, transparent 5px);
  background-repeat: no-repeat;
  background-position: 15% 70%, 85% 50%, 55% 15%;
  opacity: 0.7;
  animation: floatLayerB 32s ease-in-out infinite alternate;
}

@keyframes floatLayerB {
  0%   { transform: translate3d(0, 0, 0); background-position: 15% 70%, 85% 50%, 55% 15%; }
  50%  { transform: translate3d(-16px, 12px, 0); background-position: 13% 68%, 87% 53%, 57% 18%; }
  100% { transform: translate3d(0, 0, 0); background-position: 15% 70%, 85% 50%, 55% 15%; }
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(15, 12, 41, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 32px;
  backdrop-filter: blur(25px) saturate(140%);
  -webkit-backdrop-filter: blur(25px) saturate(140%);

  position: relative;
  z-index: 2;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(91,67,234,.3), rgba(124,92,240,.2), rgba(168,85,247,.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.back-shop {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  color: #ffffff;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

}
.back-shop:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-1px);
}
.back-shop:active { transform: translateY(0); }

.brand {
  display: grid;
  gap: 8px;
  justify-items: center;
  margin-bottom: 12px;
}
.brand-logo { width: 48px; height: 48px; border-radius: 12px; }
.title { font-size: 20px; margin: 0; }
.subtitle { margin: 0; color: var(--muted); font-size: 14px; }

.stack { display: grid; gap: 12px; }

.field { display: grid; gap: 8px; }
.label { font-size: 13px; color: var(--muted); }
input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
}
input::placeholder { color: rgba(255,255,255,0.5); font-family: inherit; }
/* Ensure placeholder follows our font across browsers */
input::-webkit-input-placeholder { font-family: inherit; }
input::-moz-placeholder { font-family: inherit; }
input:-ms-input-placeholder { font-family: inherit; }
textarea::placeholder { font-family: inherit; }
textarea::-webkit-input-placeholder { font-family: inherit; }
textarea::-moz-placeholder { font-family: inherit; }
textarea:-ms-input-placeholder { font-family: inherit; }
input:focus {
  border-color: rgba(91,67,234,0.6);
  background: rgba(255,255,255,0.12);
}

.btn {
  height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  font-size: 14px;
}
.btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(135deg, #5b43ea, #7c5cf0);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 16px rgba(91,67,234,0.3);
}
.btn.primary:hover {
  background: linear-gradient(135deg, #4f3bd8, #6b4de8);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(91,67,234,0.4);
}
.btn.ghost { 
  background: transparent; 
  border-color: rgba(255,255,255,0.15);
}
.btn.ghost:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.25);
}
.btn.ghost#back-shop { align-self: stretch; width: 100%; }
.btn.google {
  background: rgba(255,255,255,0.1);
  color: #ffffff;
  border-color: rgba(255,255,255,0.2);
}
.btn.google:hover { 
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
}
.btn.google .g { width: 20px; height: 20px; }

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin: 6px 0 10px;
}
.divider::before, .divider::after {
  content: "";
  height: 1px;
  background: var(--border);
}

.hint { margin: 0; color: var(--muted); font-size: 12px; }
.error { margin: 0; color: var(--danger); font-size: 13px; }
.success { margin: 0; color: #22c55e; font-size: 13px; }

.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.row.between { justify-content: space-between; }

.link { color: #8b75ff; text-decoration: none; font-size: 13px; }
.link:hover { text-decoration: underline; }

.step { margin-top: 14px; display: grid; gap: 12px; }
.step-title { margin: 0; font-size: 16px; }

.otp { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; direction: ltr; }
.otp-input {
  height: 52px;
  text-align: center;
  font-size: 20px;
  letter-spacing: 2px;
  direction: ltr;
}

.progress {
  position: relative;
  height: 8px;
  background: #0f1320;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.progress .bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transform-origin: left center;
  transition: width 1s linear;
}
.progress-label {
  position: absolute;
  top: -22px;
  left: 8px;
  font-size: 12px;
  color: var(--muted);
}

.foot-note { margin-top: 16px; color: var(--muted); text-align: center; font-size: 12px; }

@media (max-width: 400px) {
  .auth-card { padding: 18px; }
  .otp-input { height: 46px; font-size: 18px; }
}



