:root {
  --black: #050608;
  --navy: #14294B;
  --navy-deep: #0B1A33;
  --gold: #D8AE45;
  --green: #5CD692;
  --blue: #4A8FE0;
  --white: #FFFFFF;
  --muted: #A9B3C4;
  --coral: #E48A76;
}

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

html, body { height: 100%; }

body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(92, 214, 146, 0.10), transparent 45%),
    radial-gradient(ellipse at 90% 10%, rgba(74, 143, 224, 0.10), transparent 40%),
    var(--black);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Low poly mountains along the bottom */
.mountains {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 38vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
}

.logo {
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 18px;
  color: var(--white);
  text-decoration: none;
}
.logo .accent { color: var(--green); }
.logo small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--gold);
  font-weight: 700;
}

main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 460px;
  background: rgba(20, 41, 75, 0.72);
  border: 1px solid rgba(216, 174, 69, 0.35);
  border-radius: 18px;
  padding: 40px 36px;
  backdrop-filter: blur(6px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: fadeUp 0.7s ease both;
}

.label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.label::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--gold);
}

h1 {
  font-weight: 800;
  font-size: 30px;
  line-height: 1.2;
  margin-bottom: 12px;
}

.lead {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 28px;
  font-size: 15px;
}

label.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

input[type="email"],
.code-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--navy-deep);
  color: var(--white);
  font-family: inherit;
  font-size: 16px;
  margin-bottom: 16px;
}
input[type="email"]:focus,
.code-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(216, 174, 69, 0.2);
}

.btn {
  width: 100%;
  padding: 15px 18px;
  border: none;
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy-deep);
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: wait; transform: none; }

.btn-ghost {
  width: auto;
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
}

.hint {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.message {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  display: none;
}
.message.show { display: block; }
.message.success {
  background: rgba(92, 214, 146, 0.12);
  border: 1px solid rgba(92, 214, 146, 0.45);
}
.message.error {
  background: rgba(228, 138, 118, 0.12);
  border: 1px solid rgba(228, 138, 118, 0.45);
}

.privacy {
  margin-top: 24px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
}

/* Dashboard */
.dashboard-main {
  align-items: flex-start;
  padding-top: 8vh;
}
.welcome {
  width: 100%;
  max-width: 760px;
  animation: fadeUp 0.7s ease both;
}
.welcome h1 { font-size: 40px; }
.welcome h1 .name { color: var(--gold); }
.welcome .lead { font-size: 17px; max-width: 560px; }

.loading {
  color: var(--muted);
  font-size: 15px;
}

footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 32px;
  background: rgba(11, 26, 51, 0.92);
  font-size: 13px;
  color: var(--muted);
}
footer .site { color: var(--gold); font-weight: 600; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
  .topbar { padding: 18px 20px; }
  .card { padding: 32px 22px; }
  h1 { font-size: 26px; }
  .welcome h1 { font-size: 30px; }
  footer { padding: 14px 20px; justify-content: center; text-align: center; }
}

/* Karl's badge, top left of the login page */
.logo-badge { display: block; width: 84px; border-radius: 50%; transition: transform 0.3s ease; }
.logo-badge:hover { transform: scale(1.04); }
.logo-badge img { display: block; width: 100%; height: auto; border-radius: 50%; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
@media (max-width: 600px) { .logo-badge { width: 64px; } }

/* Login code step */
.code-input { font-family: "JetBrains Mono", monospace; font-size: 24px; letter-spacing: 0.35em; text-align: center; }
.card .link-btn { display: block; margin: 14px auto 0; background: none; border: none; color: var(--muted, #9AA3B2);
  text-decoration: underline; font: inherit; font-size: 14px; cursor: pointer; }
.card .link-btn:hover { color: var(--gold, #D8AE45); }
