:root {
  --bg: #0f1c24;
  --bg-2: #163040;
  --panel: #f7f3ea;
  --ink: #132029;
  --muted: #5a6b75;
  --accent: #c45c26;
  --accent-ink: #fff8f2;
  --line: rgba(19, 32, 41, 0.12);
  --ok: #1f6b4a;
  --err: #8b2e2e;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --topbar-h: 56px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(196, 92, 38, 0.35), transparent 55%),
    radial-gradient(900px 500px at 90% 110%, rgba(90, 140, 160, 0.35), transparent 50%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
}

.auth-shell {
  width: min(420px, 100%);
  background: var(--panel);
  padding: 28px 22px 24px;
  box-shadow: var(--shadow);
  border-radius: 2px;
}

.brand {
  margin: 0 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

h1 {
  margin: 0 0 8px;
  font-family: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  font-weight: 600;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  letter-spacing: -0.02em;
}

.lede {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-form {
  display: grid;
  gap: 10px;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

input[type="password"],
input[type="search"] {
  font-size: 16px; /* avoids iOS zoom-on-focus */
}

input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px 12px;
  font: inherit;
  border-radius: 2px;
}

input[type="password"]:focus {
  outline: 2px solid rgba(196, 92, 38, 0.35);
  border-color: var(--accent);
}

button {
  margin-top: 8px;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  padding: 12px 14px;
  cursor: pointer;
  border-radius: 2px;
  min-height: 44px;
}

button:hover { filter: brightness(1.05); }

.hint {
  margin: 18px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.hint a { color: var(--ink); }

.message {
  padding: 10px 12px;
  margin: 0 0 14px;
  font-size: 0.92rem;
  border-radius: 2px;
}

.message.error {
  background: #f6e6e6;
  color: var(--err);
}

.message.success {
  background: #e4f2eb;
  color: var(--ok);
}

.report-page {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #e9eef2;
  overflow: hidden;
}

/* Appears only once the schedule is scrolled to the very bottom */
.logout-float {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  color: #f3f0e8;
  background: #102029;
  border: 1px solid rgba(243, 240, 232, 0.25);
  border-radius: 2px;
  box-shadow: 0 6px 18px rgba(16, 32, 41, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.logout-float:hover {
  background: #1a3444;
}

.logout-float.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: #102029;
  color: #f3f0e8;
  min-height: var(--topbar-h);
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
  color: #f7f3ea;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(243, 240, 232, 0.3);
  border-radius: 2px;
  min-height: 44px;
}

.search input[type="search"]::placeholder {
  color: rgba(243, 240, 232, 0.55);
}

.search input[type="search"]:focus {
  outline: 2px solid rgba(196, 92, 38, 0.55);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.14);
}

.count {
  font-size: 0.78rem;
  color: #9bb0bc;
  white-space: nowrap;
  min-width: 48px;
  text-align: right;
}

button.ghost.icon {
  padding: 0;
  width: 44px;
  height: 44px;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  font-size: 1.1rem;
}

button.ghost:disabled {
  opacity: 0.4;
  cursor: default;
}

a.ghost, button.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: transparent;
  color: #f3f0e8;
  border: 1px solid rgba(243, 240, 232, 0.35);
  padding: 8px 12px;
  font: inherit;
  font-size: 0.88rem;
  border-radius: 2px;
  cursor: pointer;
  min-height: 44px;
  margin: 0;
}

a.ghost:hover, button.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.report-frame-wrap {
  min-height: 0;
  overflow: hidden;
}

#report {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

@media (max-width: 640px) {
  .logout-float {
    display: none;
  }

  .topbar {
    gap: 6px;
    padding: 6px;
    padding-top: max(6px, env(safe-area-inset-top));
  }

  .search { gap: 4px; }

  .count {
    min-width: 34px;
    font-size: 0.72rem;
  }

  button.ghost.icon {
    width: 40px;
    height: 40px;
  }

  .search input[type="search"] {
    padding: 8px 10px;
    min-height: 40px;
  }

  .auth-shell {
    padding: 24px 18px 20px;
  }
}
