/* Portal homepage (CB-1). Hand-written, no bundler, matching the existing
   static files' style. Nothing here is load-bearing for authorization. */

:root {
  /* The tokens now live in `brand.css`, which every page loads first. These
     stay as local fallbacks so this sheet still renders if it is used alone. */
  --ink: #22292b;
  --paper: #f7f5f0;
  --leaf: #2f6b4f;
  --leaf-dark: #24523d;
  --muted: #6b7671;
  --slate: #444c4d;
}

* {
  box-sizing: border-box;
}

/* Same fix as admin.css: the site stylesheet overrides the UA [hidden] rule. */
[hidden] {
  display: none !important;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  /* `background-color`, not the `background` shorthand: the shorthand resets
     `background-image` and would wipe the hero `brand.css` puts behind every
     page. */
  background-color: transparent;
}

.masthead {
  padding: 1.5rem 2rem;
  background: var(--slate);
  color: var(--paper);
}

.wordmark {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tagline {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  opacity: 0.85;
}

.portal {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  /* The page itself never scrolls (see `body`); if the header/footer chrome
     leaves too little room for the title and card together on a short
     viewport, this region scrolls internally instead of silently clipping
     the form. */
  overflow-y: auto;
}

.portal h1 {
  margin: 0 0 2rem;
  max-width: 34rem;
  padding: 0.65rem 1.5rem;
  border-radius: 12px;
  background: rgb(20 24 22 / 38%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 1.3rem;
  letter-spacing: 0.05em;
  font-weight: 600;
  text-align: center;
}

.card {
  flex-shrink: 0;
  width: min(26rem, 100%);
  padding: 2.25rem 2rem;
  border-radius: 16px;
  background: #fff;
  box-shadow:
    0 24px 48px -20px rgb(20 24 22 / 35%),
    0 2px 6px rgb(20 24 22 / 8%);
}

@media (max-width: 32rem) {
  .card {
    padding: 1.75rem 1.5rem;
  }

  .portal h1 {
    font-size: 1.1rem;
    padding: 0.6rem 1.1rem;
  }
}

.card-mark {
  display: block;
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1.25rem;
}

.card form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--slate);
}

input {
  box-sizing: border-box;
  width: 100%;
  height: 2.6rem;
  padding: 0 0.75rem;
  border: 1px solid #d5cfc0;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: normal;
  line-height: normal;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
  outline: none;
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgb(47 107 79 / 15%);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--leaf-dark);
  outline-offset: 2px;
}

.btn-primary {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--leaf);
  color: #fff;
  letter-spacing: 0.02em;
}

.btn-primary:hover {
  background: var(--leaf-dark);
}

.btn-secondary {
  width: 100%;
  background: #fff;
  color: var(--slate);
  border: 1px solid #d5cfc0;
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--leaf);
  color: var(--leaf-dark);
}

.btn-secondary .icon {
  width: 15px;
  height: 15px;
  flex: none;
}

.btn-link {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
}

.btn-link:hover {
  color: var(--ink);
}

.voice {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  border: 1px solid #ece7d9;
  border-radius: 10px;
  background: var(--paper);
}

.voice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.voice-status {
  flex: none;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: #ece7d9;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.voice-status[data-ready="true"] {
  background: #dcede1;
  color: var(--leaf-dark);
}

.voice-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e3ddcf;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.status {
  margin: 1rem 0 0;
  min-height: 1.1em;
  font-size: 0.85rem;
  text-align: center;
}

.status[data-kind="error"] {
  color: #8c2f2f;
}

.portal-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid #dcd7cb;
}

/* The hero is unwashed, so anything sitting directly on it needs its own
   contrast rather than relying on a pale backdrop. The cards below carry solid
   backgrounds already; these two do not. */
.portal > h1 {
  color: #fff;
  text-shadow: 0 1px 3px rgb(0 0 0 / 55%);
}

/* Only the text sitting directly on the photograph -- text inside the card has
   a white panel behind it and must stay dark. */
.portal > .muted,
.portal-footer .muted,
.portal-footer a {
  color: #f2efe9;
  text-shadow: 0 1px 3px rgb(0 0 0 / 55%);
}
