/* ============================================
   MOON KIDS STORE — Auth Styles
   auth/auth.css
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --cream:    #fdf8f3;
  --blush:    #f9e8e8;
  --rose:     #e8a0b0;
  --rose-deep:#c9637a;
  --plum:     #7c4d77;
  --plum-deep:#4a2d5e;
  --gold:     #e8c87a;
  --text:     #2a1f2d;
  --muted:    #8c7a8e;
  --white:    #ffffff;
  --shadow:   0 24px 64px rgba(76, 45, 94, 0.18);
  --radius:   20px;
  --trans:    0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
}

/* ── Background ── */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: floatBlob 12s ease-in-out infinite alternate;
}

.bg-blob-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #f4c2cf, #d9a0c0);
  top: -200px; left: -150px;
  animation-delay: 0s;
}
.bg-blob-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #c9a8d8, #8b5fa0);
  bottom: -180px; right: -120px;
  animation-delay: -4s;
}
.bg-blob-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #ffe8a3, #f5c870);
  top: 40%; left: 50%;
  animation-delay: -8s;
}

@keyframes floatBlob {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, 20px) scale(1.08); }
}

/* Stars */
.star {
  position: absolute;
  background: var(--gold);
  clip-path: polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
  opacity: 0;
  animation: twinkle var(--dur, 4s) var(--del, 0s) ease-in-out infinite;
}
@keyframes twinkle {
  0%,100% { opacity: 0; transform: scale(0.6) rotate(0deg); }
  50%      { opacity: 0.7; transform: scale(1) rotate(20deg); }
}

/* ── Card ── */
.auth-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-wrap.wide { max-width: 560px; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)  scale(1); }
}

.auth-card {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 0 1px rgba(200,170,215,0.3);
  overflow: hidden;
}

/* ── Header ── */
.auth-header {
  background: linear-gradient(145deg, var(--plum-deep) 0%, var(--plum) 50%, var(--rose-deep) 100%);
  padding: 40px 36px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.auth-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.auth-logo-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 18px;
}

.auth-logo {
  width: 72px; height: 72px;
  filter: brightness(0) invert(1);
  animation: moonFloat 3s ease-in-out infinite alternate;
  position: relative;
  z-index: 1;
}
@keyframes moonFloat {
  from { transform: translateY(0); }
  to   { transform: translateY(-6px); }
}

.auth-logo-glow {
  position: absolute;
  inset: -12px;
  background: radial-gradient(circle, rgba(255,255,255,0.2), transparent 70%);
  border-radius: 50%;
  animation: glowPulse 3s ease-in-out infinite alternate;
}
@keyframes glowPulse {
  from { transform: scale(1); opacity: 0.5; }
  to   { transform: scale(1.3); opacity: 1; }
}

.auth-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.3px;
  position: relative;
}

.auth-subtitle {
  font-size: 13.5px;
  color: rgba(255,255,255,0.75);
  margin-top: 6px;
  font-weight: 300;
  position: relative;
}

/* ── Body ── */
.auth-body {
  padding: 36px 36px 28px;
}

/* ── Alert ── */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 24px;
  animation: fadeIn 0.4s ease both;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }

.alert-success { background: #ecfdf5; color: #16a34a; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.alert-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ── Form ── */
.form-section {
  margin-bottom: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--plum-deep);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--rose);
  font-size: 14px;
  pointer-events: none;
  transition: color var(--trans);
}

.form-control {
  width: 100%;
  padding: 13px 14px 13px 40px;
  border: 1.5px solid #e8dcea;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: rgba(253,248,243,0.6);
  transition: border-color var(--trans), box-shadow var(--trans), background var(--trans);
  outline: none;
  -webkit-appearance: none;
}
.form-control::placeholder { color: #bfadc5; }

.form-control:focus {
  border-color: var(--plum);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(124,77,119,0.12);
}

.form-control:focus ~ .input-icon,
.input-wrap:focus-within .input-icon {
  color: var(--plum);
}

.input-wrap:focus-within .input-icon { color: var(--plum); }

/* toggle password */
.btn-toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  padding: 4px;
  transition: color var(--trans);
  line-height: 1;
}
.btn-toggle-pw:hover { color: var(--plum); }

/* password strength */
.strength-bar {
  height: 3px;
  background: #e8dcea;
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.4s ease, background 0.4s ease;
}
.strength-fill.weak   { width: 33%; background: #f87171; }
.strength-fill.medium { width: 66%; background: var(--gold); }
.strength-fill.strong { width: 100%; background: #34d399; }
.strength-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Extras ── */
.form-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.check-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.check-wrap input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 17px; height: 17px;
  border: 1.5px solid #d4c0d8;
  border-radius: 5px;
  cursor: pointer;
  transition: all var(--trans);
  position: relative;
  flex-shrink: 0;
}
.check-wrap input[type="checkbox"]:checked {
  background: var(--plum);
  border-color: var(--plum);
}
.check-wrap input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: 2px solid white;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}

.check-label {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.check-label a { color: var(--plum); text-decoration: none; font-weight: 500; }
.check-label a:hover { text-decoration: underline; }

.link-forgot {
  font-size: 12.5px;
  color: var(--rose-deep);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--trans);
}
.link-forgot:hover { color: var(--plum); }

/* ── Submit button ── */
.btn-submit {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--plum-deep) 0%, var(--plum) 50%, var(--rose-deep) 100%);
  color: var(--white);
  border: none;
  border-radius: 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform var(--trans), box-shadow var(--trans), opacity var(--trans);
  position: relative;
  overflow: hidden;
}
.btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
  opacity: 0;
  transition: opacity var(--trans);
}
.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(74,45,94,0.35);
}
.btn-submit:hover::before { opacity: 1; }
.btn-submit:active { transform: translateY(0); }

/* ripple */
.btn-submit .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ── Footer ── */
.auth-footer {
  text-align: center;
  padding: 18px 36px 28px;
  border-top: 1px solid rgba(200,170,215,0.2);
  font-size: 13.5px;
  color: var(--muted);
}
.auth-footer a {
  color: var(--plum);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--trans);
}
.auth-footer a:hover { color: var(--rose-deep); }

/* ── Back home ── */
.btn-back {
  position: fixed;
  top: 20px; left: 20px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  color: var(--plum);
  padding: 10px 18px;
  border-radius: 50px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 4px 16px rgba(124,77,119,0.15);
  transition: transform var(--trans), box-shadow var(--trans);
  z-index: 10;
}
.btn-back:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124,77,119,0.22);
  color: var(--rose-deep);
}

/* divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(200,170,215,0.4);
}

/* ── Responsive ── */
@media (max-width: 560px) {
  .auth-header { padding: 30px 24px 28px; }
  .auth-body   { padding: 26px 24px 20px; }
  .auth-footer { padding: 16px 24px 24px; }
  .form-row    { grid-template-columns: 1fr; gap: 0; }
  .auth-logo   { width: 58px; height: 58px; }
  .auth-title  { font-size: 22px; }
  .btn-back    { padding: 8px 14px; font-size: 12px; }
}