/* ══════════════════════════════════════
   DUFAN — Auth Page
   Carnival Maximalism · Full Redesign
══════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange:   #FF6B2B;
  --orange-l: #FF8F5E;
  --orange-d: #CC4A15;
  --yellow:   #FFD60A;
  --pink:     #FF4785;
  --blue:     #00B4FF;
  --green:    #22C55E;
  --purple:   #9B5DE5;
  --dark:     #1E1040;
  --cream:    #FFFBEF;
  --white:    #FFFFFF;
  --gray:     #F0EBD8;
  --muted:    #8B7355;
  --red:      #EF4444;
}

html, body {
  height: 100%; overflow: hidden;
  background: var(--cream);
  color: var(--dark);
  font-family: 'Nunito', sans-serif;
}

/* ══ CANVAS — subtle full-page background ══ */
#hero-canvas {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  opacity: .18;
}

/* ══ BACK BUTTON ══ */
.back-btn {
  position: fixed; top: 20px; left: 24px; z-index: 200;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px 9px 14px;
  background: rgba(255,255,255,.88);
  border: 1.5px solid rgba(255,107,43,.2);
  border-radius: 50px; text-decoration: none;
  backdrop-filter: blur(12px);
  box-shadow: 0 3px 14px rgba(30,16,64,.08);
  transition: all .25s;
  animation: fadeUp .5s ease both;
}
.back-btn:hover { border-color: var(--orange); box-shadow: 0 6px 20px rgba(255,107,43,.18); transform: translateX(-3px); }
.back-arrow { font-size: 15px; color: var(--orange); transition: transform .25s; }
.back-btn:hover .back-arrow { transform: translateX(-3px); }
.back-label { font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700; color: var(--muted); transition: color .25s; }
.back-btn:hover .back-label { color: var(--orange); }

/* ══ STAGE — centered single column ══ */
.stage {
  position: relative; z-index: 10;
  width: 100%; height: 100vh;
  display: flex;
  align-items: center; justify-content: center;
  overflow: hidden;
}

/* ══ HERO PANEL — hidden, canvas is the background now ══ */
.hero { display: none; }
.hero-content { position: relative; z-index: 1; max-width: 440px; }

.hero-brand {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 32px;
  animation: fadeUp .5s .1s ease both;
}
.hero-icon {
  font-size: 52px;
  filter: drop-shadow(0 4px 16px rgba(255,107,43,.5));
  animation: iconFloat 4s ease-in-out infinite;
}
@keyframes iconFloat {
  0%,100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-10px) rotate(2deg); }
}
.hero-logo {
  font-family: 'Fredoka One', cursive;
  font-size: 48px; letter-spacing: 4px;
  background: linear-gradient(135deg, var(--orange), var(--yellow));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(255,107,43,.3));
}

.hero-title {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(38px, 4.5vw, 56px);
  color: var(--dark); line-height: 1.1;
  margin-bottom: 18px;
  animation: fadeUp .6s .2s ease both;
}
.hero-accent {
  background: linear-gradient(135deg, var(--orange) 0%, var(--pink) 60%, var(--purple) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; background-size: 200% auto;
  animation: shimmer 4s linear infinite;
}
@keyframes shimmer { from { background-position: 0% } to { background-position: 200% } }

.hero-sub {
  font-size: 15px; font-weight: 600; color: var(--muted);
  line-height: 1.7; margin-bottom: 36px;
  animation: fadeUp .6s .3s ease both;
}

.hero-feats {
  display: flex; flex-direction: column; gap: 10px;
  animation: fadeUp .6s .4s ease both;
}
.hero-feat {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  background: rgba(255,255,255,.75);
  border: 1.5px solid rgba(255,107,43,.12);
  border-radius: 14px; backdrop-filter: blur(8px);
  transition: all .25s; cursor: default;
  animation: fadeUp .5s calc(var(--fd, .4s)) ease both;
}
.hero-feat:hover {
  background: white; border-color: rgba(255,107,43,.3);
  transform: translateX(5px);
  box-shadow: 0 4px 18px rgba(255,107,43,.1);
}
.hero-feat-icon {
  font-size: 20px; width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,107,43,.1); border: 1.5px solid rgba(255,107,43,.15);
  border-radius: 12px; flex-shrink: 0;
}
.hero-feat-title { font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 800; color: var(--dark); margin-bottom: 2px; }
.hero-feat-desc  { font-size: 12px; font-weight: 600; color: var(--muted); }

/* Floating badges */
.float-badge {
  position: absolute;
  padding: 8px 16px;
  background: white; border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 800; color: var(--dark);
  box-shadow: 0 6px 24px rgba(30,16,64,.12);
  border: 1.5px solid rgba(255,107,43,.1);
  white-space: nowrap;
  animation: badgeFloat 6s ease-in-out infinite;
  z-index: 2;
}
.float-badge--1 { bottom: 28%; right: 5%; animation-delay: 0s; }
.float-badge--2 { bottom: 18%; right: 12%; animation-delay: 1.5s; font-size: 12px; }
.float-badge--3 { bottom: 8%;  right: 4%;  animation-delay: 3s; }
@keyframes badgeFloat {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* ══ AUTH PANEL ══ */
.auth-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 24px 20px;
  overflow-y: auto;
  width: 100%;
}

.auth-card {
  width: 100%; max-width: 420px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 32px;
  padding: 36px 34px 32px;
  box-shadow: 0 24px 72px rgba(30,16,64,.13), 0 4px 16px rgba(30,16,64,.06), 0 0 0 1.5px rgba(255,107,43,.1);
  position: relative; overflow: hidden;
  animation: cardSlideIn .6s .1s cubic-bezier(.34,1.2,.64,1) both;
}
@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(32px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-card.tab-bounce { animation: tabBounce .35s cubic-bezier(.34,1.56,.64,1); }
@keyframes tabBounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.013); }
  100% { transform: scale(1); }
}

/* Decorative blobs */
.card-circle { position: absolute; border-radius: 50%; pointer-events: none; }
.card-circle--1 { width: 180px; height: 180px; top: -60px; right: -60px; background: radial-gradient(circle, rgba(255,107,43,.07) 0%, transparent 70%); }
.card-circle--2 { width: 120px; height: 120px; bottom: -40px; left: -40px; background: radial-gradient(circle, rgba(255,71,133,.06) 0%, transparent 70%); }

/* Rainbow top bar */
.auth-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, var(--orange), var(--yellow), var(--pink), var(--purple), var(--blue), var(--orange));
  background-size: 300% 100%;
  border-radius: 32px 32px 0 0;
  animation: rainbowSlide 5s linear infinite;
}
@keyframes rainbowSlide {
  0%   { background-position: 0% 0%; }
  100% { background-position: 300% 0%; }
}

/* ── Tabs ── */
.tab-row {
  display: flex; background: var(--gray);
  border-radius: 16px; padding: 4px;
  margin-bottom: 28px; position: relative;
}
.tab-slider {
  position: absolute; top: 4px; bottom: 4px;
  width: calc(50% - 4px); left: 4px;
  background: white; border-radius: 13px;
  box-shadow: 0 2px 12px rgba(30,16,64,.1), 0 0 0 1.5px rgba(255,107,43,.12);
  transition: transform .35s cubic-bezier(.34,1.2,.64,1);
}
.tab-slider.right { transform: translateX(calc(100%)); }
.tab-btn {
  flex: 1; z-index: 1; position: relative;
  padding: 11px 0; background: none; border: none;
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 800;
  color: var(--muted); cursor: pointer; border-radius: 13px; transition: color .25s;
}
.tab-btn.active { color: var(--orange); }

/* ── Form panels ── */
.form-panel.hidden { display: none; }
.card-title {
  font-family: 'Fredoka One', cursive;
  font-size: 27px; color: var(--dark); margin-bottom: 4px;
  animation: titleIn .4s ease both;
}
@keyframes titleIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card-sub { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 24px; }

/* ── Fields ── */
.field { margin-bottom: 14px; }
.field-row { display: grid; gap: 10px; margin-bottom: 14px; }
.field-row.col2 { grid-template-columns: 1fr 1fr; }
.fl { font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 800; color: var(--dark); margin-bottom: 6px; display: flex; align-items: center; gap: 3px; }
.req { color: var(--orange); }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 12px; font-size: 15px; pointer-events: none; z-index: 1; line-height: 1; }

.fi {
  width: 100%;
  padding: 11px 14px 11px 38px;
  background: var(--gray);
  border: 2px solid transparent;
  border-radius: 12px;
  color: var(--dark);
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 600;
  outline: none;
  transition: border-color .22s, background .22s, box-shadow .22s, transform .2s;
  -webkit-appearance: none;
}
.fi:focus {
  border-color: var(--orange); background: white;
  box-shadow: 0 0 0 4px rgba(255,107,43,.1);
  transform: translateY(-1px);
}
.fi.err { border-color: var(--red); background: rgba(239,68,68,.04); }
.fi::placeholder { color: rgba(139,115,85,.4); }

.pw-wrap .fi { padding-right: 40px; }
.pw-eye {
  position: absolute; right: 12px;
  background: none; border: none; cursor: pointer;
  font-size: 15px; color: var(--muted);
  transition: color .2s, transform .2s; padding: 2px; z-index: 1;
}
.pw-eye:hover { color: var(--orange); transform: scale(1.1); }

.ferr { font-size: 11px; font-weight: 700; color: var(--red); margin-top: 4px; display: none; font-family: 'Space Mono', monospace; }
.ferr.show { display: block; animation: errShake .3s ease; }
@keyframes errShake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-4px); }
  40%,80% { transform: translateX(4px); }
}

.forgot-link {
  display: block; text-align: right;
  font-size: 12px; font-weight: 700; color: var(--orange); opacity: .7;
  cursor: pointer; text-decoration: none;
  margin-top: -6px; margin-bottom: 16px; transition: opacity .2s;
}
.forgot-link:hover { opacity: 1; }

/* ── Submit button ── */
.btn-submit {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--orange) 0%, var(--pink) 100%);
  background-size: 200% 100%;
  color: white; border: none; border-radius: 14px;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 15px;
  cursor: pointer; margin-top: 4px;
  position: relative; overflow: hidden;
  transition: transform .3s cubic-bezier(.34,1.2,.64,1), box-shadow .3s;
  box-shadow: 0 5px 20px rgba(255,107,43,.35);
}
.btn-submit:hover { transform: translateY(-3px) scale(1.01); box-shadow: 0 10px 32px rgba(255,107,43,.45); }
.btn-submit:active { transform: translateY(0) scale(.99); }
.btn-submit:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-shine {
  position: absolute; top: 0; left: -100%; bottom: 0; width: 60%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
  transform: skewX(-20deg); transition: left .5s ease; pointer-events: none;
}
.btn-submit:hover .btn-shine { left: 150%; }

.ld { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: white; border-radius: 50%; animation: spin .5s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-switch { text-align: center; margin-top: 18px; font-size: 13px; font-weight: 700; color: var(--muted); }
.auth-switch span { color: var(--orange); cursor: pointer; margin-left: 4px; transition: all .2s; text-decoration: underline; text-decoration-color: transparent; }
.auth-switch span:hover { opacity: .8; text-decoration-color: var(--orange); }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: flex; align-items: center; gap: 10px; padding: 12px 22px;
  background: white; border: 1.5px solid rgba(255,107,43,.2); border-radius: 50px;
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700; color: var(--dark);
  box-shadow: 0 10px 36px rgba(30,16,64,.15);
  opacity: 0; pointer-events: none;
  transition: all .35s cubic-bezier(.4,0,.2,1);
  z-index: 999; white-space: nowrap;
}
.toast.show  { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(34,197,94,.3);  color: #166534; }
.toast.error   { border-color: rgba(239,68,68,.3);   color: #991B1B; }
.toast.info    { border-color: rgba(255,107,43,.3);   color: var(--orange-d, #CC4A15); }

.auth-wrap::-webkit-scrollbar { width: 4px; }
.auth-wrap::-webkit-scrollbar-track { background: transparent; }
.auth-wrap::-webkit-scrollbar-thumb { background: rgba(255,107,43,.2); border-radius: 4px; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══ RESPONSIVE ══ */
@media (max-width: 860px) {
  html, body { overflow-y: auto; }
  .auth-wrap { padding: 88px 20px 40px; min-height: 100vh; align-items: flex-start; }
  .auth-card { border-radius: 24px; }
  .field-row.col2 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .auth-wrap { padding: 80px 16px 32px; }
  .auth-card { padding: 28px 22px 24px; }
  .card-title { font-size: 23px; }
}