:root {
  color-scheme: light;
  --ink: #3a2814;
  --paper: #f3e7c9;
  --edge: #8b6a3e;
  --accent: #2f5d3a;
  --danger: #8a2925;
  font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: #efe2c0;
  background-image: url("paper.png"),
    radial-gradient(ellipse at 30% 25%, rgba(196,214,170,.35), transparent 65%),
    radial-gradient(ellipse at 80% 70%, rgba(214,186,128,.35), transparent 65%);
  background-size: 160px 160px, 100% 100%, 100% 100%;
}
.ftv-gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.ftv-gate-panel { width: min(100%, 320px); display: grid; justify-items: center; }
.ftv-gate-crest { display: block; width: clamp(150px, 26vh, 240px); max-width: 100%; height: auto; }
.ftv-gate-form { position: relative; width: min(100%, 320px); display: grid; gap: 12px; padding-block: 56px; }
.ftv-gate-input {
  width: 100%; min-height: 52px; padding: 12px 20px;
  border: 1px solid var(--edge); border-radius: 6px;
  background: rgba(255,251,237,.85); color: var(--ink);
  font: inherit; font-size: 18px; line-height: 1.5; text-align: center;
  box-shadow: 0 2px 12px rgba(58,40,20,.06);
}
.ftv-gate-input::placeholder { color: #6b5133; opacity: 1; }
.ftv-gate-input:focus-visible, .ftv-gate-submit:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 4px; border-color: var(--accent);
}
.ftv-gate-input[aria-invalid="true"] { border-color: var(--danger); }
.ftv-gate-error { position: absolute; inset: calc(50% + 38px) 0 auto; margin: 0; color: var(--danger); text-align: center; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.ftv-sr-only, .ftv-gate-submit:not(:focus-visible) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.ftv-gate-submit:focus-visible {
  position: absolute; inset: calc(50% + 38px) 0 auto;
  min-height: 48px; padding: 10px 16px; border: 1px solid var(--accent); border-radius: 6px;
  background: linear-gradient(135deg, #4b7954, var(--accent)); color: #fff;
  font: inherit; font-size: 16px; cursor: pointer;
  overflow: hidden;
}
.ftv-gate-submit:active { transform: translateY(1px); filter: brightness(1.06); }
.ftv-gate-submit::after { content: ""; position: absolute; inset: 0; border: 1px solid transparent; border-radius: inherit; pointer-events: none; }
.ftv-gate-form:has(.ftv-gate-submit:focus-visible) .ftv-gate-error { top: calc(50% + 100px); }
@media (prefers-reduced-motion: no-preference) {
  .ftv-gate-input { transition: border-color 140ms, background-color 140ms; }
  @media (hover: hover) and (pointer: fine) {
    .ftv-gate-submit:hover { animation: ftv-glow 1.8s ease-in-out infinite; }
    .ftv-gate-submit:hover::after { animation: ftv-glint 500ms ease-out forwards; }
  }
}
@keyframes ftv-glow { 50% { box-shadow: 0 7px 16px rgba(47,93,58,.24); } }
@keyframes ftv-glint { from { border-bottom-color: rgba(255,255,255,.65); } to { border-top-color: rgba(255,255,255,.65); border-right-color: rgba(255,255,255,.65); } }
