/* Fratco App v6.10 - signin2.css: the three pages a visitor sees before signing in (index.html, register.html,
   reset.html), on top of css/base.css. No app frame here. Phones: the form comes first and fills the screen.
   Computers (900px and wider): the form on the left, the plant photo on the right.
   One painted sign per page carries the one heading. Tokens and components come from base.css; nothing here
   names the tools behind sign in (tests/scan-prelogin.mjs checks every file these pages load). */

/* ---------- Skip link: the first Tab stop ---------- */
.skip-link {
  position: absolute; z-index: 10; left: var(--sp-3); top: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-1);
  background: var(--surface); color: var(--ink); font-weight: 700;
  transform: translateY(-300%);
}
.skip-link:focus { transform: none; }

/* ---------- Frame ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
.auth-main { display: flex; justify-content: center; align-items: flex-start; min-width: 0; padding: var(--sp-6) var(--sp-5) var(--sp-7); }
.auth-main:focus { outline: none; }
.auth-col { display: flex; flex-direction: column; gap: var(--sp-5); width: 100%; max-width: 30rem; }

/* Logo on the left, Light / Dark on the right */
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.auth-top a { display: block; border-radius: var(--r-1); }
.auth-logo { width: 132px; height: auto; }
.auth-theme svg { width: 1.4em; height: 1.4em; }
.auth-theme .i-sun { display: none; }
html[data-theme="dark"] .auth-theme .i-sun { display: block; }
html[data-theme="dark"] .auth-theme .i-moon { display: none; }

/* ---------- The card: painted sign on top, the form under it ---------- */
.auth-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); }
.auth-card > .sign { border-radius: 0; }
.auth-body { display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-5); }
.auth-lead { color: var(--ink-2); max-width: 44ch; }
.auth-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.auth-form .btn-primary { width: 100%; margin-top: var(--sp-2); }
.auth-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-4); }

/* A text button that reads like a link (Forgot your password?, Back to sign in) */
.link-btn {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0; border: 0; background: none;
  color: var(--ink); font: inherit; font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; cursor: pointer;
}
@media (hover: hover) { .link-btn:hover { text-decoration-thickness: 2px; } }

/* Password box with its Show / Hide button (js/signin.js adds the button) */
.pw-wrap { display: flex; gap: var(--sp-2); }
.pw-wrap > .input { flex: 1 1 auto; min-width: 0; }
.pw-toggle { flex: none; min-width: 5.5em; }

/* Messages under the form: nothing shown until there is something to say */
.auth-msg { padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line-strong); border-radius: var(--r-1); background: var(--surface-2); color: var(--ink); line-height: 1.45; overflow-wrap: break-word; }
.auth-msg:empty { display: none; }
.auth-msg.err { border-color: var(--danger); background: var(--danger-bg); font-weight: 700; }
.auth-msg.ok { border-color: var(--ok); background: var(--ok-bg); }

/* Checking a reset link */
.auth-wait { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--tap); color: var(--ink-2); }

/* Under the card: the other way in, then the one help line */
.auth-alt { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-2); }
.auth-alt a { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 700; }
.auth-help { font-size: var(--fs-2); line-height: 1.5; color: var(--ink-2); }
.auth-help a { color: var(--ink); white-space: nowrap; }

/* ---------- Photo (computers only) ---------- */
.auth-photo { display: none; }
@media (min-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .auth-main { align-items: center; padding: var(--sp-7) var(--sp-6); }
  .auth-photo { position: sticky; top: 0; display: flex; flex-direction: column; height: 100dvh; margin: 0; background: var(--rail); color: var(--rail-ink); }
  .auth-photo img { flex: 1 1 auto; min-height: 0; width: 100%; height: auto; object-fit: cover; }
  .auth-photo p { flex: none; padding: var(--sp-4) var(--sp-5); font-weight: 700; line-height: 1.4; }
}

/* ---------- Phones ---------- */
@media (max-width: 599.98px) {
  .auth-main { padding: var(--sp-4) var(--sp-4) var(--sp-7); }
  .auth-col { gap: var(--sp-4); }
  .auth-body { padding: var(--sp-4); }
  .pw-toggle { min-width: 4.75em; }
}
/* v7.12: reset.html, the emailed-code box (Supabase Secure password change) */
#codeResend { justify-self: start; }
