:root {
  /* Color */
  --navy-950: #0B1120;
  --navy-800: #16213E;
  --navy-700: #1D2B52;
  --gold-400: #E8B24D;
  --gold-300: #F2C97A;
  --coral-500: #FF6F5E;
  --ivory-50: #F7F5EF;
  --slate-400: #8B93A7;
  --slate-600: #5C6580;

  /* Type */
  --font-display: 'Baloo 2', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Layout */
  --radius-card: 20px;
  --radius-input: 12px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--navy-950);
  color: var(--ivory-50);
  font-family: var(--font-body);
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-3);
  position: relative;
  overflow-x: hidden;
}

/* Signature element: faint ledger/register ruling across the whole
   viewport, evoking the paper attendance register this app replaces.
   Kept quiet — a texture, not a decoration competing with the form. */
.ledger-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 43px,
    rgba(232, 178, 77, 0.06) 43px,
    rgba(232, 178, 77, 0.06) 44px
  );
  z-index: 0;
}

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--space-4);
  text-align: center;
}

.brand__mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--navy-800);
  border: 1px solid var(--navy-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--gold-400);
  margin-bottom: var(--space-2);
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.01em;
  margin: 0;
}

.brand__tagline {
  font-size: 14px;
  color: var(--slate-400);
  margin-top: 4px;
}

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  background: var(--navy-800);
  border: 1px solid var(--navy-700);
  border-radius: var(--radius-card);
  padding: var(--space-4) var(--space-3) var(--space-3);
}

.field {
  margin-bottom: var(--space-3);
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-400);
  margin-bottom: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field input {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-input);
  border: 1px solid var(--navy-700);
  background: var(--navy-950);
  color: var(--ivory-50);
  font-family: var(--font-body);
  font-size: 16px; /* 16px avoids iOS zoom-on-focus */
}

.field input:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 2px;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-input);
  border: none;
  background: var(--gold-400);
  color: var(--navy-950);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 120ms ease, transform 80ms ease;
}

.btn-primary:hover { background: var(--gold-300); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:focus-visible { outline: 2px solid var(--ivory-50); outline-offset: 2px; }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }

.error-banner {
  display: none;
  background: rgba(255, 111, 94, 0.12);
  border: 1px solid var(--coral-500);
  color: var(--coral-500);
  border-radius: var(--radius-input);
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: var(--space-3);
}

.error-banner.visible { display: block; }

.offline-banner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  background: var(--coral-500);
  color: var(--navy-950);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 8px;
}

.offline-banner.visible { display: block; }

.footnote {
  text-align: center;
  color: var(--slate-600);
  font-size: 12px;
  margin-top: var(--space-3);
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary { transition: none; }
}
