/* srv1.unicorn.space — self-contained styles
   Fonts: Space Grotesk & Space Mono (SIL OFL 1.1), bundled in /fonts */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/space-grotesk-400.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/space-grotesk-500.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/space-grotesk-700.woff2") format("woff2");
}
@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/space-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/space-mono-700.woff2") format("woff2");
}

:root {
  --void: #14111e;
  --void-2: #1a1628;
  --surface: #1e1a30;
  --field: #262138;
  --field-focus: #2c2742;
  --line: #342e4c;
  --mist: #948eb4;
  --mist-dim: #6c668a;
  --pearl: #f2effb;

  --iris-a: #a78bfa; /* violet */
  --iris-b: #5ce1e6; /* cyan   */
  --iris-c: #ff9ec7; /* rose   */
  --iris: linear-gradient(105deg, var(--iris-a) 0%, var(--iris-b) 52%, var(--iris-c) 100%);

  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", monospace;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font-display);
  color: var(--pearl);
  background: var(--void);
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- Ambient night sky ---- */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
/* soft aurora bloom, drifting */
.sky::before {
  content: "";
  position: absolute;
  top: -30%;
  left: 50%;
  width: 130vmax;
  height: 130vmax;
  transform: translateX(-50%);
  background:
    radial-gradient(closest-side, rgba(167, 139, 250, 0.16), transparent 70%) 30% 20% / 60% 60% no-repeat,
    radial-gradient(closest-side, rgba(92, 225, 230, 0.12), transparent 70%) 72% 30% / 55% 55% no-repeat,
    radial-gradient(closest-side, rgba(255, 158, 199, 0.10), transparent 70%) 50% 68% / 60% 60% no-repeat;
  filter: blur(6px);
  animation: drift 26s var(--ease) infinite alternate;
}
@keyframes drift {
  from { transform: translateX(-52%) rotate(0deg) scale(1); }
  to   { transform: translateX(-48%) rotate(8deg)  scale(1.08); }
}
/* faint starfield via layered dots */
.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(242,239,251,0.7), transparent),
    radial-gradient(1px 1px at 82% 14%, rgba(242,239,251,0.5), transparent),
    radial-gradient(1px 1px at 65% 62%, rgba(242,239,251,0.6), transparent),
    radial-gradient(1px 1px at 28% 78%, rgba(242,239,251,0.45), transparent),
    radial-gradient(1px 1px at 45% 34%, rgba(242,239,251,0.5), transparent),
    radial-gradient(1px 1px at 92% 72%, rgba(242,239,251,0.4), transparent),
    radial-gradient(1px 1px at 8% 55%, rgba(242,239,251,0.5), transparent);
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle {
  from { opacity: 0.45; }
  to   { opacity: 0.9; }
}

/* ---- Card ---- */
.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, var(--surface), var(--void-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 34px 30px;
  box-shadow:
    0 1px 0 rgba(242, 239, 251, 0.04) inset,
    0 30px 80px -20px rgba(10, 8, 20, 0.8);
  animation: rise 0.7s var(--ease) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* iridescent hairline riding the top edge */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--iris);
  background-size: 200% 100%;
  opacity: 0.9;
  animation: shift 8s linear infinite;
}
@keyframes shift {
  to { background-position: 200% 0; }
}

/* ---- Header ---- */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 30px;
}
.horn { width: 30px; height: 46px; margin-bottom: 16px; display: block; }
.horn .spiral { animation: spin-shimmer 9s linear infinite; transform-origin: center; }
@keyframes spin-shimmer {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
.wordmark {
  font-weight: 700;
  font-size: 40px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.address {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--mist);
  margin-top: 8px;
  letter-spacing: 0.01em;
}
.address .dot { color: var(--iris-b); }

/* ---- Form ---- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--mist-dim);
}
.control { position: relative; }
.control input {
  width: 100%;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--pearl);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.control input::placeholder { color: var(--mist-dim); }
.control input:hover { border-color: #40395c; }
.control input:focus {
  outline: none;
  background: var(--field-focus);
  border-color: var(--iris-a);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.22);
}
.control input[type="password"] { padding-right: 48px; }

.reveal {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--mist);
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.reveal:hover { color: var(--pearl); background: rgba(242, 239, 251, 0.06); }
.reveal:focus-visible {
  outline: none;
  color: var(--pearl);
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.5);
}
.reveal svg { width: 18px; height: 18px; display: block; }
.reveal .eye-off { display: none; }
.reveal[aria-pressed="true"] .eye-on { display: none; }
.reveal[aria-pressed="true"] .eye-off { display: block; }

/* ---- Submit ---- */
.submit {
  position: relative;
  margin-top: 6px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  color: #171226;
  background: var(--iris);
  background-size: 160% 100%;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  overflow: hidden;
  transition: background-position 0.5s var(--ease), transform 0.06s var(--ease), box-shadow 0.3s var(--ease);
  box-shadow: 0 8px 24px -8px rgba(167, 139, 250, 0.5);
}
.submit:hover { background-position: 100% 0; box-shadow: 0 10px 30px -8px rgba(92, 225, 230, 0.5); }
.submit:active { transform: translateY(1px); }
.submit:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--void), 0 0 0 5px var(--iris-b); }

/* ---- Status banner ---- */
.status {
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(92, 225, 230, 0.06);
  padding: 14px 15px;
  display: none;
  align-items: flex-start;
  gap: 11px;
}
.status.show { display: flex; animation: pop 0.32s var(--ease) both; }
@keyframes pop {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.status .pulse {
  flex: none;
  width: 9px; height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--iris-b);
  box-shadow: 0 0 0 0 rgba(92, 225, 230, 0.6);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(92, 225, 230, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(92, 225, 230, 0); }
  100% { box-shadow: 0 0 0 0 rgba(92, 225, 230, 0); }
}
.status .msg { font-size: 13.5px; line-height: 1.5; }
.status .msg strong { font-weight: 700; }
.status .msg span { color: var(--mist); display: block; margin-top: 3px; }

/* ---- Footer ---- */
.foot {
  margin-top: 24px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mist-dim);
  letter-spacing: 0.04em;
}
.foot .live { color: #ffb15c; }

/* ---- Responsive ---- */
@media (max-width: 420px) {
  .card { padding: 32px 22px 26px; }
  .wordmark { font-size: 34px; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
