:root {
  --night: #0c1c36;
  --dusk: #183763;
  --horizon: #2f5e96;
  --haze: #8fb3d9;
  --gold: #c9a262;
  --bronze: #a76b2d;
  --mist: #eef3f8;
  --mist-dim: rgba(238, 243, 248, 0.68);
  --error: #ffb4a8;
  --ok: #a9e3c0;
  --font: "Jost", "Futura", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--mist);
  background: var(--night);
  -webkit-font-smoothing: antialiased;
}

/* The sky: dark overhead, brightening to a glow on the horizon. */
.sky {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(2rem, env(safe-area-inset-top)) 1.25rem max(2rem, env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 55% at 50% 100%, rgba(143, 179, 217, 0.38) 0%, rgba(143, 179, 217, 0) 60%),
    linear-gradient(180deg, var(--night) 0%, var(--dusk) 55%, var(--horizon) 100%);
  overflow: hidden;
}

.sky::after {
  /* the horizon line, drawn in the logo's gold */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18vh;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold) 70%, transparent);
  opacity: 0.55;
  animation: dawn 1.6s ease-out both;
  pointer-events: none;
}

@keyframes dawn {
  from { opacity: 0; transform: scaleX(0.4); }
  to { opacity: 0.55; transform: scaleX(1); }
}

main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.logo {
  display: block;
  width: min(15rem, 70vw);
  height: auto;
  margin: 0 auto 2.5rem;
}

.logo--small { width: 9rem; margin-bottom: 0; }

h1 {
  font-weight: 300;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  margin: 0 0 1.5rem;
}

/* Sign-in and account panels */
.panel {
  width: 100%;
  text-align: left;
  background: rgba(12, 28, 54, 0.82);
  border-top: 2px solid var(--gold);
  border-radius: 2px 2px 10px 10px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 24px 60px -24px rgba(4, 10, 22, 0.8);
}

label {
  display: block;
  font-size: 0.875rem;
  color: var(--mist-dim);
  margin-bottom: 0.4rem;
}

.field + .field { margin-top: 1.1rem; }

input {
  width: 100%;
  font: inherit;
  color: var(--mist);
  background: rgba(238, 243, 248, 0.06);
  border: 1px solid rgba(238, 243, 248, 0.22);
  border-radius: 6px;
  padding: 0.7rem 0.85rem;
  transition: border-color 0.15s, background-color 0.15s;
}

input:hover { border-color: rgba(238, 243, 248, 0.38); }

input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(238, 243, 248, 0.09);
  box-shadow: 0 0 0 3px rgba(201, 162, 98, 0.28);
}

.hint { font-size: 0.8125rem; color: var(--mist-dim); margin: 0.4rem 0 0; }

button {
  font: inherit;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  border-radius: 6px;
}

.btn-primary {
  width: 100%;
  margin-top: 1.6rem;
  padding: 0.8rem 1rem;
  border: 0;
  color: var(--night);
  background: linear-gradient(180deg, #d8b678, var(--gold) 60%, #b98c4c);
}

.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }

button:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.message {
  min-height: 1.4em;
  margin: 1rem 0 0;
  font-size: 0.9rem;
}
.message[data-kind="error"] { color: var(--error); }
.message[data-kind="ok"] { color: var(--ok); }

a { color: var(--mist); text-underline-offset: 3px; text-decoration-color: rgba(201, 162, 98, 0.7); }
a:hover { text-decoration-color: var(--gold); }

/* Signed-in top bar */
.topbar {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 64rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar nav { display: flex; align-items: center; gap: 1.25rem; font-size: 0.9rem; }
.topbar .who { color: var(--mist-dim); }

.link-button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--mist);
  font-weight: 400;
  letter-spacing: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(201, 162, 98, 0.7);
}

/* Under construction */
.construction { max-width: 40rem; }

.construction h1 {
  font-size: clamp(2.6rem, 9vw, 5.25rem);
  line-height: 1.02;
  font-weight: 300;
  letter-spacing: 0.02em;
  margin: 0 0 1.25rem;
}

.construction p { color: var(--mist-dim); margin: 0; max-width: 34ch; }

footer {
  position: relative;
  z-index: 1;
  font-size: 0.8125rem;
  color: var(--mist-dim);
  text-align: center;
}

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

@media (max-width: 480px) {
  .panel { padding: 1.6rem 1.25rem 1.4rem; }
  .topbar .who { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sky::after { animation: none; }
  input { transition: none; }
}
