@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --bg: #071019;
  --bg-on: #0f2236;
  --ink: #f4f1ea;
  --muted: #9a9994;
  --hair: rgba(255, 255, 255, 0.1);
  --gold: #c9a24a;
  --gold-soft: rgba(201, 162, 74, 0.35);
  --danger: #e0785f;
  --glow-color: rgba(255, 200, 100, 0.32);
}

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

.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;
}

body {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body[data-on="true"] {
  background: var(--bg-on);
  transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 30% 38%, var(--glow-color), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

body[data-on="true"]::before {
  opacity: 1;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sr-only:focus {
  position: static;
}

.container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 7vw, 7rem);
  flex-wrap: wrap;
  width: 100%;
  max-width: 1080px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: auto;
  padding: 0 clamp(1rem, 4vw, 3rem);
  position: relative;
  z-index: 1;
}

/* Lamp — hangs from the top-left */

.lamp-col {
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 3vh, 2rem);
}

.lamp-wrapper {
  animation: lamp-sway 6.5s ease-in-out infinite;
  transform-origin: top center;
  position: relative;
  width: clamp(170px, 34vw, 250px);
  aspect-ratio: 220 / 380;
  flex-shrink: 0;
}

@keyframes lamp-sway {
  0%,
  100% {
    transform: rotate(-1.1deg);
  }
  50% {
    transform: rotate(1.1deg);
  }
}

.lamp-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.canopy {
  fill: #2b3037;
}

.chain {
  stroke: #3a3f47;
  stroke-width: 2;
}

.lamp-shade {
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}

.lamp-rim {
  fill: none;
  stroke: #ffd98a;
  stroke-width: 3.5;
  stroke-linecap: round;
  opacity: 0;
  filter: blur(2.5px) drop-shadow(0 0 8px rgba(255, 207, 107, 0.8));
  transition: opacity 0.1s ease;
}

[data-on="true"] .lamp-rim {
  opacity: 0.95;
  transition: opacity 0.18s ease;
}

.bulb {
  fill: #2a2d31;
  transition: fill 0.12s ease;
}

[data-on="true"] .bulb {
  fill: #fff3d0;
  transition: fill 0.18s ease;
  filter: drop-shadow(0 0 10px rgba(255, 224, 150, 0.9));
  animation: bulb-flicker 0.55s ease-out 1;
}

@keyframes bulb-flicker {
  0% {
    opacity: 0.2;
  }
  10% {
    opacity: 1;
  }
  18% {
    opacity: 0.5;
  }
  26% {
    opacity: 1;
  }
  36% {
    opacity: 0.75;
  }
  100% {
    opacity: 1;
  }
}

.bulb-glow {
  opacity: 0;
  filter: blur(10px);
  transition: opacity 0.1s ease;
}

[data-on="true"] .bulb-glow {
  opacity: 0.9;
  transition: opacity 0.16s ease;
  animation: bulb-flash 0.5s ease-out, glow-pulse 3.6s ease-in-out 0.5s infinite;
}

@keyframes glow-pulse {
  0%,
  100% {
    opacity: 0.82;
  }
  50% {
    opacity: 1;
  }
}

@keyframes bulb-flash {
  0% {
    opacity: 0;
  }
  14% {
    opacity: 1;
  }
  100% {
    opacity: 0.9;
  }
}

.light-cone,
.light-pool {
  opacity: 0;
  pointer-events: none;
  filter: blur(9px);
  transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-on="true"] .light-cone,
[data-on="true"] .light-pool {
  opacity: 0.6;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-on="true"] .light-pool {
  opacity: 0.7;
}

/* Stars — a still night sky while the light is off */

.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(140% 90% at 72% 0%, rgba(44, 78, 128, 0.3), transparent 55%),
    radial-gradient(120% 80% at 18% 8%, rgba(32, 54, 92, 0.28), transparent 60%);
  transition: opacity 0.6s ease;
}

body[data-on="false"] .stars {
  opacity: 1;
  transition: opacity 1.4s ease 0.3s;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #ffffff 0%,
    var(--star, #e6ecff) 45%,
    rgba(200, 215, 255, 0) 78%
  );
  box-shadow: 0 0 4px 1px rgba(205, 220, 255, 0.7);
  mix-blend-mode: screen;
  opacity: 0.2;
  will-change: opacity, transform;
  animation: star-twinkle var(--tw, 4s) ease-in-out var(--twDel, 0s) infinite;
}

.star--sm {
  box-shadow: 0 0 3px 1px rgba(205, 220, 255, 0.5);
}

.star--lg {
  box-shadow: 0 0 7px 2px rgba(215, 228, 255, 0.85);
}

.moon {
  position: absolute;
  top: 6%;
  right: 8%;
  width: clamp(84px, 13vw, 132px);
  height: clamp(84px, 13vw, 132px);
  filter: drop-shadow(0 0 16px rgba(200, 216, 255, 0.45));
  transform: rotate(-18deg);
  opacity: 0.9;
  animation: moon-drift 9s ease-in-out infinite;
}

@keyframes moon-drift {
  0%,
  100% {
    transform: rotate(-18deg) translateY(0);
    opacity: 0.82;
  }
  50% {
    transform: rotate(-18deg) translateY(-7px);
    opacity: 0.95;
  }
}

@keyframes star-twinkle {
  0%,
  100% {
    opacity: 0.12;
    transform: scale(0.85);
  }
  35% {
    opacity: 0.9;
    transform: scale(1.05);
  }
  60% {
    opacity: 0.35;
    transform: scale(0.95);
  }
  80% {
    opacity: 1;
    transform: scale(1.15);
  }
}

/* Pull cord */

.pull-cord {
  cursor: pointer;
  touch-action: none;
  outline: none;
  transform-box: fill-box;
  transform-origin: top center;
  animation: cord-sway 3.4s ease-in-out infinite;
}

.pull-cord.is-pulling {
  animation: none;
}

@keyframes cord-sway {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(2.5px);
  }
}

.cord-line {
  stroke: #5a5f66;
  stroke-width: 1.6;
}

.cord-bead {
  fill: var(--gold);
}

.pull-cord:focus-visible .cord-bead {
  stroke: #fff;
  stroke-width: 3;
}

.cord-hit {
  cursor: pointer;
  touch-action: none;
}

/* Login form — premium minimal */

.login-form {
  position: relative;
  align-self: center;
  width: min(380px, 100%);
  padding: clamp(2rem, 6vw, 3rem) clamp(1.5rem, 5vw, 2.7rem);
  border-radius: 3px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--hair);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(26px);
  transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1),
    transform 0.8s cubic-bezier(0.19, 1, 0.22, 1),
    visibility 0s linear 0.8s;
}

.login-form::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.7;
}

.login-form.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition-delay: 0s;
}

.brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin-bottom: 2.2rem;
}

.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(201, 162, 74, 0.3));
}

.brand-name {
  color: var(--ink);
  text-align: left;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: 0.01em;
  max-width: 12em;
}

.form-note {
  margin: -1rem 0 1.6rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--gold-soft);
  border-radius: 2px;
  background: rgba(201, 162, 74, 0.08);
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: center;
}

.field {
  margin-bottom: 1.5rem;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: color 0.25s ease;
}

.field:focus-within label {
  color: var(--gold);
}

.field .input-wrap {
  position: relative;
}

.field input {
  width: 100%;
  padding: 0.5rem 2rem 0.6rem 0;
  border: none;
  border-bottom: 1px solid var(--hair);
  background: transparent;
  color: var(--ink);
  font-size: 0.98rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s ease;
}

.field input:focus {
  border-bottom-color: var(--gold);
}

.field.error input {
  border-bottom-color: #e06a5a;
}

.field.error label {
  color: #e06a5a;
}

.field .msg {
  min-height: 1em;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  color: #e0785f;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.field.error .msg {
  opacity: 1;
}

.field .toggle {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: inline-flex;
  padding: 4px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  line-height: 0;
  transition: color 0.25s ease;
}

.field .toggle:hover,
.field .toggle:focus-visible {
  color: var(--gold);
  outline: none;
}

.field .toggle svg {
  width: 18px;
  height: 18px;
}

.field .toggle .slash {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.field .toggle[aria-pressed="true"] .slash {
  opacity: 1;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
}

.check input {
  accent-color: var(--gold);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.link {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.link:hover,
.link:focus-visible {
  color: var(--gold);
  border-color: var(--gold-soft);
  outline: none;
}

.btn {
  width: 100%;
  padding: 1.05rem;
  border: 1px solid var(--gold);
  border-radius: 2px;
  background: transparent;
  color: var(--gold);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease,
    opacity 0.35s ease;
}

.btn:hover:not(:disabled) {
  background: var(--gold);
  color: #14110b;
  box-shadow: 0 10px 30px rgba(201, 162, 74, 0.28);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn.done {
  background: var(--gold);
  color: #14110b;
}

@media (max-width: 820px) {
  .container {
    align-items: center;
    flex-direction: column;
    gap: clamp(1.5rem, 4vh, 2.5rem);
    padding-block: clamp(1.5rem, 5vh, 3rem);
  }

  .lamp-col {
    align-self: center;
  }

  .lamp-wrapper {
    width: clamp(150px, 40vw, 220px);
  }

  .login-form {
    align-self: center;
  }

  body::before {
    background: radial-gradient(circle at 50% 20%, var(--glow-color), transparent 58%);
  }
}

@media (max-width: 560px) {
  .container {
    gap: 1.5rem;
    padding: 1.25rem 1rem 2rem;
  }

  .lamp-wrapper {
    width: clamp(128px, 46vw, 180px);
  }

  .moon {
    top: 4%;
    right: 6%;
    width: clamp(64px, 20vw, 92px);
    height: clamp(64px, 20vw, 92px);
  }

  .login-form {
    width: 100%;
    padding: 1.9rem 1.35rem;
  }

  .brand {
    gap: 0.7rem;
    margin-bottom: 1.8rem;
  }

  .brand-logo {
    width: 46px;
    height: 46px;
  }

  .brand-name {
    font-size: 0.98rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01s !important;
    transition-delay: 0s !important;
  }
}