@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --space-950: #050610;
  --space-900: #090b18;
  --space-850: #0e1021;
  --space-800: #13162b;
  --space-700: #232746;
  --moon-white: #f8f7ff;
  --moon-muted: #a6a5ba;
  --ultraviolet: #7657ff;
  --ultraviolet-2: #9c7dff;
  --solar-pink: #ff4f9a;
  --electric-cyan: #38d6ff;
  --moon-gold: #ffe59a;
  --danger: #ff647c;
  --success: #4de6a8;
  --warning: #ffc65c;
  --color-brand-primary: var(--ultraviolet);
  --color-label-primary: #171625;
  --color-label-secondary: #65647a;
  --surface-primary: #ffffff;
  --surface-secondary: #f5f3fb;
  --separator-default: rgba(25, 22, 50, .1);
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --shadow-orbit: 0 24px 80px rgba(9, 6, 33, .22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--moon-white);
  background: var(--space-950);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.hidden { display: none !important; }
.shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; }
.page-light { min-height: calc(100vh - 76px); background: #f5f3fb; color: #171625; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 0 19px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; text-decoration: none; cursor: pointer; transition: .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  color: white; background: linear-gradient(135deg, var(--solar-pink), var(--ultraviolet));
  box-shadow: 0 12px 32px rgba(118, 87, 255, .3);
}
.btn-secondary { color: #211e38; background: #fff; border-color: #ded9ee; }
.btn-ghost { color: inherit; background: transparent; border-color: rgba(255,255,255,.18); }
.btn-danger { color: #fff; background: var(--danger); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }

.field { display: grid; gap: 8px; }
.field label { font-size: 13px; font-weight: 700; color: #68667a; }
.input, .select, .textarea {
  width: 100%; border: 1px solid #ddd8eb; border-radius: 13px; background: #fff;
  color: #171625; padding: 12px 14px; outline: none; transition: .2s;
}
.textarea { min-height: 112px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--ultraviolet); box-shadow: 0 0 0 4px rgba(118,87,255,.12);
}

.card {
  background: rgba(255,255,255,.98); color: #171625; border: 1px solid #e6e1f1;
  border-radius: 22px; box-shadow: 0 14px 50px rgba(25,18,60,.08);
}
.eyebrow {
  margin: 0; font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ultraviolet-2); font-weight: 800;
}
.gradient-text {
  color: transparent; background: linear-gradient(90deg, #fff 10%, #ff99c5, #77e5ff);
  background-clip: text; -webkit-background-clip: text;
}
.empty-state { text-align: center; padding: 64px 24px; color: #777489; }

#moon-toast-container {
  position: fixed; top: 90px; right: 24px; z-index: 10000;
  display: grid; gap: 10px; width: min(380px, calc(100vw - 32px));
}
.moon-toast {
  color: #1a172c; background: white; border: 1px solid #e3deef; border-left: 4px solid var(--ultraviolet);
  border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-orbit);
  animation: toast-in .25s ease;
}
.moon-toast.error { border-left-color: var(--danger); }
.moon-toast.success { border-left-color: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } }

.login-modal {
  position: fixed; inset: 0; z-index: 12000; display: grid; place-items: center;
  padding: 20px; background: rgba(2,3,10,.76); backdrop-filter: blur(14px);
}
.login-card {
  position: relative; width: min(450px, 100%); padding: 34px; border-radius: 26px;
  background: #111326; border: 1px solid #34385d; box-shadow: 0 40px 120px rgba(0,0,0,.5);
}
.login-card h2 { font: 700 30px/1.1 var(--font-display); margin: 14px 0 8px; }
.login-card p { color: #abaac0; line-height: 1.55; }
.login-close {
  position: absolute; right: 18px; top: 18px; width: 36px; height: 36px; border: 0;
  border-radius: 50%; background: rgba(255,255,255,.08); color: white; cursor: pointer;
}
.login-card .input { color: white; background: #080a18; border-color: #303453; }
.login-error { margin: 12px 0; color: #ff8da1 !important; font-size: 13px; }
.code-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 22px 0; }
.code-input {
  width: 100%; aspect-ratio: 1; text-align: center; border-radius: 12px; border: 1px solid #34385d;
  background: #080a18; color: white; font-size: 23px; font-weight: 800; text-transform: uppercase;
}
.login-actions { display: flex; gap: 10px; margin-top: 18px; }
.login-actions .btn { flex: 1; }

.loading-overlay {
  position: fixed; inset: 0; z-index: 11000; display: grid; place-items: center;
  background: rgba(5,6,16,.56); backdrop-filter: blur(6px);
}
.loading-orbit { width: 46px; height: 46px; border: 3px solid rgba(255,255,255,.18); border-top-color: var(--solar-pink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 700px) {
  .shell { width: min(100% - 24px, 1240px); }
  .login-card { padding: 28px 22px; }
}
