/* ==========================================================================
   DEN — Premium Interactive Login Page
   Design tokens
   ========================================================================== */
:root {
  /* --- Color: deep night plum -> amber ember, warm honey bear --- */
  --bg-deep:      #170f28;
  --bg-mid:       #2c1a45;
  --bg-plum:      #3d2154;
  --glow-amber:   #ff9d6c;
  --accent:       #ff9d6c;
  --accent-deep:  #e8703a;
  --accent-soft:  #ffd7ad;

  --glass-bg:      rgba(255, 255, 255, 0.07);
  --glass-bg-2:    rgba(255, 255, 255, 0.11);
  --glass-border:  rgba(255, 255, 255, 0.22);
  --glass-shadow:  rgba(10, 4, 20, 0.55);

  --text-light:   #fdf6ec;
  --text-muted:   rgba(253, 246, 236, 0.62);
  --text-faint:   rgba(253, 246, 236, 0.38);

  /* --- Type --- */
  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  /* --- Layout --- */
  --card-radius: 28px;
  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   Reset
   ========================================================================== */
* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--text-light);
  overflow-x: hidden;
  background: var(--bg-deep);
}

a { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

button { font-family: inherit; }

/* ==========================================================================
   BACKGROUND SCENE
   ========================================================================== */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 90% at 20% -10%, rgba(255, 157, 108, 0.16), transparent 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(129, 79, 191, 0.28), transparent 60%),
    linear-gradient(155deg, var(--bg-deep) 0%, var(--bg-mid) 48%, var(--bg-plum) 100%);
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  will-change: transform;
}

.blob--one {
  width: 46vw;
  height: 46vw;
  top: -12%;
  left: -10%;
  background: radial-gradient(circle at 30% 30%, #ff9d6c, transparent 70%);
  animation: drift1 22s ease-in-out infinite;
}

.blob--two {
  width: 38vw;
  height: 38vw;
  bottom: -14%;
  right: -8%;
  background: radial-gradient(circle at 60% 40%, #8a5cff, transparent 70%);
  animation: drift2 26s ease-in-out infinite;
}

.blob--three {
  width: 26vw;
  height: 26vw;
  top: 38%;
  right: 18%;
  background: radial-gradient(circle at 50% 50%, #ffd39a, transparent 72%);
  opacity: 0.35;
  animation: drift3 18s ease-in-out infinite;
}

@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(4vw, 3vh) scale(1.08); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-3vw, -4vh) scale(1.05); }
}
@keyframes drift3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-2vw, 3vh) scale(0.95); }
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 100% at 50% 40%, transparent 40%, rgba(10, 5, 18, 0.55) 100%);
  pointer-events: none;
}

/* Floating particles */
.particle-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 231, 200, 0.9), rgba(255, 231, 200, 0));
  will-change: transform, opacity;
}

/* ==========================================================================
   STAGE / LAYOUT
   ========================================================================== */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 20px;
}

.mascot-card-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 400px;
}

/* ==========================================================================
   BEAR STAGE
   ========================================================================== */
.bear-stage {
  position: relative;
  width: 240px;
  height: 260px;
  margin-bottom: -78px; /* bear stands, feet tuck slightly behind card top */
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 22px 30px rgba(10, 4, 20, 0.45));
}

#bearSvg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ==========================================================================
   LOGIN CARD — glassmorphism
   ========================================================================== */
.login-card {
  position: relative;
  width: 100%;
  padding: 100px 36px 32px;
  border-radius: var(--card-radius);
  background: linear-gradient(180deg, var(--glass-bg-2), var(--glass-bg));
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow:
    0 30px 60px -20px var(--glass-shadow),
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  z-index: 1;
}

.login-card__glow {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 90px;
  background: radial-gradient(closest-side, rgba(255, 157, 108, 0.35), transparent);
  filter: blur(20px);
  pointer-events: none;
  z-index: -1;
}

.login-card__header {
  text-align: center;
  margin-bottom: 28px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.login-card__header h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--text-light);
}

.login-card__header p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   FORM FIELDS
   ========================================================================== */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field { display: flex; flex-direction: column; gap: 7px; }

.field label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.field__control {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 0 14px;
  transition: border-color 0.25s var(--ease-standard), background 0.25s var(--ease-standard), box-shadow 0.25s var(--ease-standard);
}

.field__control:focus-within {
  border-color: rgba(255, 157, 108, 0.75);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 4px rgba(255, 157, 108, 0.14);
}

.field__icon {
  color: var(--text-faint);
  flex-shrink: 0;
  transition: color 0.25s ease;
}

.field__control:focus-within .field__icon {
  color: var(--accent);
}

.field__control input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 13px 10px;
  min-width: 0;
}

.field__control input::placeholder {
  color: var(--text-faint);
}

.field__toggle {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 6px;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.field__toggle:hover { color: var(--accent-soft); background: rgba(255,255,255,0.06); }

/* row: remember + forgot */
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -4px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.checkbox input { display: none; }

.checkbox__box {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  display: inline-block;
  position: relative;
  transition: all 0.2s ease;
}

.checkbox input:checked + .checkbox__box {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox input:checked + .checkbox__box::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #241105;
  border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}

.link-muted {
  font-size: 13px;
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.2s ease;
}
.link-muted:hover { color: var(--accent-soft); }

.link-accent {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.link-accent:hover { color: var(--accent-soft); }

/* ==========================================================================
   PRIMARY BUTTON
   ========================================================================== */
.btn-primary {
  position: relative;
  border: none;
  border-radius: 14px;
  padding: 15px 20px;
  margin-top: 4px;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent) 55%, var(--accent-deep));
  color: #2b1607;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 14px 28px -10px rgba(232, 112, 58, 0.55);
  transition: transform 0.2s var(--ease-standard), box-shadow 0.2s var(--ease-standard);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px -10px rgba(232, 112, 58, 0.65);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary__spinner {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 2.5px solid rgba(43, 22, 7, 0.25);
  border-top-color: #2b1607;
}

.btn-primary.is-loading .btn-primary__label { opacity: 0; }
.btn-primary.is-loading .btn-primary__spinner {
  display: block;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.login-card__footer {
  text-align: center;
  margin: 20px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================================================
   Shake state for invalid submit (optional utility, triggered by JS)
   ========================================================================== */
.shake {
  animation: shakeField 0.42s var(--ease-standard);
}
@keyframes shakeField {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 480px) {
  .bear-stage { width: 190px; height: 210px; margin-bottom: -60px; }
  .login-card { padding: 84px 24px 26px; border-radius: 22px; }
  .login-card__header h1 { font-size: 22px; }
}

@media (max-height: 700px) {
  .stage { align-items: flex-start; padding-top: 28px; }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .blob, .particle { animation: none !important; }
}