:root {
  --bg-app: #F7F5FB;
  --bg-raised: #FFFFFF;
  --surface-lavender: #B8A6FF;
  --surface-sky: #9EC9F0;
  --surface-mint: #7DD4A8;
  --surface-peach: #FFB59E;
  --surface-pink: #F5B8D0;
  --surface-lemon: #F5D77A;
  --action-primary: #FF7A6B;
  --action-on: #FFFFFF;
  --text-strong: #2E2A3F;
  --text-muted: #6B6580;
  --border-color: #C9B5FF;
  --r-card: 28px;
  --r-button: 18px;
  --r-chip: 999px;
  --r-input: 16px;

  --shadow-white: 8px 8px 22px rgba(140,108,255,0.16), -8px -8px 20px rgba(255,255,255,0.85), inset 3px 3px 6px rgba(255,255,255,0.7), inset -5px -5px 10px rgba(140,108,255,0.10);
  --shadow-coral: 8px 8px 22px rgba(230,90,75,0.35), -6px -6px 18px rgba(255,255,255,0.6), inset 3px 3px 6px rgba(255,255,255,0.5), inset -5px -5px 10px rgba(230,90,75,0.30);
  --shadow-pressed: inset 4px 4px 8px rgba(140,108,255,0.20), inset -4px -4px 8px rgba(255,255,255,0.75);
  --shadow-sm: 4px 4px 12px rgba(140,108,255,0.18), -3px -3px 10px rgba(255,255,255,0.7);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

body {
  font-family: 'Quicksand', 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-strong);
  background: var(--bg-app);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  overflow-x: hidden;
}

.bg-fixed-layer {
  position: fixed;
  inset: 0;
  background-color: var(--bg-app);
  z-index: -2;
}
.overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 15%, rgba(184,166,255,0.22), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(158,201,240,0.22), transparent 45%);
  pointer-events: none;
  z-index: -1;
}

.box {
  width: 100%;
  max-width: 400px;
  background: var(--bg-raised);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-white);
  padding: 34px 28px;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  border-radius: var(--r-chip);
  background: var(--bg-app);
  box-shadow: var(--shadow-sm);
}
.logo-icon img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 50%;
}

#step2 { display: none; }

.box h2 {
  font-size: 1.7rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-strong);
}
.box h2 span { color: var(--action-primary); }

.box > div > p {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 6px 0 20px;
}

.box input {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 6px;
  border: none;
  border-radius: var(--r-input);
  background: var(--bg-app);
  box-shadow: var(--shadow-pressed);
  color: var(--text-strong);
  font-family: 'Quicksand', sans-serif;
  font-size: 16px;
  font-weight: 600;
  outline: none;
  transition: box-shadow 0.15s ease;
}
.box input::placeholder { color: var(--text-muted); font-weight: 500; }
.box input:focus {
  box-shadow: var(--shadow-pressed), 0 0 0 3px rgba(184,166,255,0.4);
}

.field-hint {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  min-height: 15px;
  margin: 0 2px 10px;
}
.field-hint.error { color: #dc2626; }
.field-hint.success { color: #059669; }

.box button:not(.resend-btn) {
  width: 100%;
  margin-top: 10px;
  padding: 15px 18px;
  border: none;
  border-radius: var(--r-button);
  background: var(--action-primary);
  color: var(--action-on);
  box-shadow: var(--shadow-coral);
  font-family: 'Quicksand', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.box button:not(.resend-btn):hover { transform: translateY(-2px); }
.box button:not(.resend-btn):active { transform: scale(0.97); box-shadow: var(--shadow-pressed); }
.box button:disabled { cursor: not-allowed; opacity: 0.6; transform: none; }

.turnstile-wrapper {
  display: flex;
  justify-content: center;
  margin: 12px 0 4px;
}

.msg {
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  min-height: 18px;
  margin-top: 12px;
}
.msg.error { color: #dc2626; }
.msg.success { color: #059669; }

.switch-link {
  display: block;
  text-align: center;
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}
.switch-link a {
  color: var(--action-primary);
  font-weight: 700;
  text-decoration: none;
}
.switch-link a:hover { text-decoration: underline; }

.resend-row {
  margin-top: 16px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}
.resend-btn {
  background: none;
  border: none;
  color: var(--action-primary);
  font-family: 'Quicksand', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.resend-btn:hover:not(:disabled) { text-decoration: underline; }
.resend-btn:disabled { color: #b8b2cc; cursor: not-allowed; }

.otp-boxes {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 18px;
}

.otp-digit {
  width: 46px;
  height: 56px;
  padding: 0;
  margin-bottom: 0;
  text-align: center;
  font-size: 1.45rem;
  font-weight: 700;
  border: none;
  border-radius: var(--r-input);
  background: var(--bg-app);
  box-shadow: var(--shadow-pressed);
  color: var(--text-strong);
  font-family: 'Quicksand', sans-serif;
  outline: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.otp-digit:focus {
  box-shadow: var(--shadow-pressed), 0 0 0 3px rgba(184,166,255,0.4);
}

.otp-digit.filled {
  box-shadow: var(--shadow-pressed), 0 0 0 2px rgba(255,122,107,0.35);
}

.otp-digit.shake {
  animation: otpShake 0.4s ease;
}

@keyframes otpShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@media (max-width: 380px) {
  .otp-boxes { gap: 7px; }
  .otp-digit { width: 40px; height: 50px; font-size: 1.25rem; }
}

@media (min-width: 769px) {
  .box { max-width: 420px; padding: 40px 34px; }
  .box h2 { font-size: 1.9rem; }
}