:root {
  --bg: #f7f8fc;
  --surface: rgba(255, 255, 255, 0.74);
  --text: #14121d;
  --muted: #676577;
  --line: rgba(26, 22, 48, 0.13);
  --accent: #7257ff;
  --accent-2: #d847dc;
  --shadow: 0 28px 80px rgba(48, 38, 86, 0.18);
}

[data-theme="dark"] {
  --bg: #070b18;
  --surface: rgba(14, 20, 39, 0.68);
  --text: #f7f8ff;
  --muted: #a7acc0;
  --line: rgba(226, 230, 255, 0.16);
  --accent: #8a76ff;
  --accent-2: #ee5cff;
  --shadow: 0 32px 100px rgba(0, 0, 0, 0.48);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: color .35s ease, background-color .35s ease;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 65%, transparent); outline-offset: 3px; }

.page-shell { position: relative; min-height: 100svh; overflow: hidden; isolation: isolate; }

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  padding: 18px clamp(20px, 5vw, 72px);
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font-weight: 750; letter-spacing: .02em; }
.brand-mark, .panel-mark { width: 18px; height: 25px; background: linear-gradient(155deg, #ff495f, #ffad33 24%, #63d85d 45%, #31b9ee 66%, #7057ff 82%, #dd48c9); clip-path: polygon(50% 0, 70% 47%, 100% 100%, 50% 77%, 0 100%, 30% 47%); }
.header-actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  position: relative;
  width: 64px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  cursor: pointer;
  box-shadow: inset 0 1px rgba(255,255,255,.08);
}

.theme-icon { position: absolute; top: 9px; z-index: 2; width: 18px; height: 18px; }
.theme-icon svg { width: 100%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.sun { left: 8px; color: #f5a623; }
.moon { right: 8px; color: #8d91a8; }
.toggle-knob { position: absolute; z-index: 3; top: 4px; left: 4px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 3px 12px rgba(12,12,25,.2); transition: transform .3s cubic-bezier(.2,.8,.2,1), background .3s; }
[data-theme="dark"] .toggle-knob { transform: translateX(26px); background: #2a3150; }

.login-button, .submit-button {
  border: 0;
  border-radius: 99px;
  padding: 11px 19px;
  font-weight: 700;
  color: white;
  background: linear-gradient(115deg, var(--accent), var(--accent-2));
  box-shadow: 0 9px 24px color-mix(in srgb, var(--accent) 30%, transparent);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.login-button:hover, .submit-button:hover { transform: translateY(-2px); box-shadow: 0 13px 28px color-mix(in srgb, var(--accent) 38%, transparent); }

.hero { position: relative; min-height: calc(100svh - 88px); display: grid; place-items: center; padding: 0 6vw 40px; }
.ambient-glow { position: absolute; inset: 5% 10% 0; z-index: -2; background: radial-gradient(circle at 58% 47%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 48%); filter: blur(20px); }
.unicorn-visual { position: absolute; z-index: -1; inset: 0; display: grid; place-items: center; pointer-events: none; }
.unicorn-visual img { display: block; width: min(78vw, 790px); height: min(78vh, 860px); object-fit: contain; filter: drop-shadow(0 25px 35px rgba(27, 22, 62, .12)); transition: opacity .24s ease; }
[data-theme="dark"] .unicorn-visual img { filter: drop-shadow(0 28px 42px rgba(0,0,0,.35)); }

.hero-copy { position: absolute; z-index: 2; left: clamp(24px, 7vw, 110px); top: 50%; max-width: 430px; transform: translateY(-50%); pointer-events: none; text-shadow: 0 1px 24px var(--bg); }
.eyebrow { margin: 0 0 18px; color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .19em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2.6rem, 5.8vw, 5.7rem); line-height: .94; letter-spacing: -.065em; }

.modal[hidden] { display: none; }
.modal { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(6, 8, 18, .38); backdrop-filter: blur(4px); cursor: default; animation: fade-in .25s ease both; }
.login-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  padding: 42px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, white 20%);
  border-radius: 28px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(135%);
  animation: panel-in .34s cubic-bezier(.2,.8,.2,1) both;
}
.close-button { position: absolute; top: 18px; right: 18px; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }
.close-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.panel-mark { width: 21px; height: 29px; margin-bottom: 28px; }
.panel-kicker { margin: 0 0 8px; color: var(--accent); font-size: .75rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.login-panel h2 { margin: 0; font-size: clamp(1.8rem, 6vw, 2.35rem); letter-spacing: -.045em; }
.panel-copy { margin: 10px 0 28px; color: var(--muted); line-height: 1.55; }
.login-panel form { display: grid; gap: 10px; }
.login-panel label { font-size: .88rem; font-weight: 680; }
.login-panel input[type="email"], .login-panel input[type="password"] { width: 100%; min-height: 50px; margin-bottom: 8px; padding: 0 15px; color: var(--text); border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--bg) 58%, transparent); transition: border-color .2s, box-shadow .2s; }
.login-panel input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 13%, transparent); outline: none; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 14px; font-size: .82rem; }
.remember { display: flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 500 !important; }
.remember input { accent-color: var(--accent); }
.form-row a { color: var(--accent); text-decoration: none; font-weight: 700; }
.submit-button { width: 100%; min-height: 50px; border-radius: 13px; }
.form-status { min-height: 1.2em; margin: 2px 0 0; color: var(--muted); font-size: .82rem; text-align: center; }
body.modal-open { overflow: hidden; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }

@media (max-width: 800px) {
  .site-header { min-height: 76px; }
  .hero { min-height: calc(100svh - 76px); align-items: end; padding-bottom: 115px; }
  .unicorn-visual { inset: -3% -24% 8%; opacity: .82; }
  .unicorn-visual img { width: min(112vw, 690px); height: 72vh; }
  .hero-copy { position: relative; left: auto; top: auto; align-self: end; max-width: 100%; transform: none; text-align: center; }
  .hero-copy { text-shadow: 0 0 18px var(--bg), 0 0 36px var(--bg); }
}

@media (max-width: 520px) {
  .brand span:last-child { display: none; }
  .theme-toggle { width: 58px; }
  [data-theme="dark"] .toggle-knob { transform: translateX(20px); }
  .login-button { padding-inline: 15px; }
  .login-panel { padding: 34px 24px 25px; border-radius: 22px; }
  .form-row { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
