/* The sign-in and account pages: the door's look, one column in the middle
   of an otherwise empty page, with room for more than one question. Loaded
   after theme.css and style.css, and only by those two pages. */

.gate {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.2rem;
  padding: 3rem var(--gutter) 4rem;
  overflow: auto;
}

.gate form,
.gate section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(22rem, 100%);
}

.gate h2 {
  margin: 0;
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.3;
  text-align: center;
}

.gate h3 {
  margin: 0;
  font-weight: 400;
  font-size: 15px;
  color: var(--subtle);
}

.gate input {
  width: 100%;
  font: inherit;
  font-size: 16px;
  text-align: center;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 16px;
}

.gate input:focus {
  outline: 2px solid var(--iris);
  outline-offset: -1px;
}

/* A code is read in two groups of five, so it is set the way it is read. */
.gate input[name="code"] {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gate button {
  font: inherit;
  font-size: 14px;
  border: none;
  border-radius: 18px;
  padding: 10px 22px;
  background: var(--pine);
  color: var(--bg);
  cursor: pointer;
}

.gate button:hover { background: var(--foam); }
.gate button:disabled { opacity: 0.6; cursor: default; }

/* The quieter buttons: not the thing the page is for. */
.gate button.quiet {
  background: none;
  color: var(--subtle);
  border: 1px solid var(--line);
}

.gate button.quiet:hover { color: var(--text); border-color: var(--foam); }

.gate button.danger { background: var(--love); }

.gate p {
  margin: 0;
  max-width: 24rem;
  text-align: center;
  font-size: 13px;
  color: var(--subtle);
}

.gate .note { color: var(--love); }
.gate .said { color: var(--foam); }

.gate .or {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(22rem, 100%);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.gate .or::before,
.gate .or::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}

.gate .row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.gate a { color: var(--foam); }

.gate details { width: min(22rem, 100%); text-align: center; }
.gate details summary { cursor: pointer; color: var(--subtle); font-size: 13px; }
.gate details form { margin: 14px auto 0; }

/* My goals (public/account.js): their postcards' backs, small, two to a row
   where there is room; each a link to its conversation, with which and when
   under it, and the rest folded under "…". */
.gate #postcards { width: min(44rem, 100%); }
.gate .pc-collected { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px 24px; width: 100%; }
.gate .pc-item { display: flex; flex-direction: column; gap: 8px; width: min(20rem, 100%); }
.gate .pc-open { display: block; color: inherit; text-decoration: none; border-radius: 6px; }
.gate .pc-open:hover .pcard, .gate .pc-open:focus-visible .pcard { outline: 2px solid var(--foam); outline-offset: 3px; }
.gate .pc-under { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--subtle); }
.gate .pc-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gate .pc-label strong { font-weight: 400; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gate .pc-more { position: relative; width: auto; }
.gate .pc-more summary { list-style: none; padding: 0 6px; font-size: 18px; line-height: 1; letter-spacing: 0.1em; }
.gate .pc-more summary::-webkit-details-marker { display: none; }
/* Over the page, under the "…", so opening it moves nothing. */
.gate .pc-more div {
  position: absolute;
  z-index: 2;
  right: 0;
  top: calc(100% + 6px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.gate .pc-more button { padding: 5px 14px; }
.gate select {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 16px;
}

/* ---- the threshold pages -------------------------------------------------
   `signin.html` and `code.html` only, by the `threshold` class on their body.
   ⚠️ Not `body` on its own, which is what the visual work had: `account.html`
   loads this stylesheet too and is *inside* the product, where the warm world
   belongs rather than the waterfront on the way to it.

   The wash is two flat layers over the plate rather than a gradient: these
   pages are forms, and a form has to stay the thing being used. */
body.threshold {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(35, 33, 54, 0.76), rgba(35, 33, 54, 0.84)),
    url(brand/plate-login-transition-v2.webp);
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

/* A line under a form that is not an error and not a result: what the code
   does, which account is being set up, who this browser is already signed in
   as. Dimmer than the form's own text, and never the warning colour. */
.gate p.quiet {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

/* The ways out of a page, which are links rather than forms. Kept apart from
   the form above them so the page reads as one thing to do and two places to
   go, rather than three things to do. */
.gate p.ways {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--subtle);
}
.gate p.ways a { color: var(--foam); }

/* ⚠️ A filled-in field is painted by the browser, not by us, and the paint is
   opaque and light in both engines: a signed-in-before browser showed white
   boxes on a dark page (Robert, 2026-11-19). `background` is ignored for it,
   which is why this is not simply another rule above.

   Chromium honours an inset box-shadow, which is the long-standing way to
   cover the paint, and holds it only while the field is in the autofilled
   state, so the absurd transition delay keeps it from flashing back on
   focus. Firefox honours `:autofill` with the gradient turned off. Both are
   listed because neither selector matches in the other engine. */
.gate input:-webkit-autofill,
.gate input:-webkit-autofill:hover,
.gate input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}
.gate input:autofill {
  background-image: none;
  background-color: var(--surface);
  color: var(--text);
  filter: none;
}
