/* ---------- Sign-in pages ("gate"): the ForgeTraq split layout ----------
   Brand side: the sign-in title, tagline, the six characters (or the sign-in image) and what the
   admin promises. Form side: language and light/dark buttons, the card with the flame, the footer. */
:root {
  --fp-gate-ink: #1f2023;
  --fp-gate-muted: #8c8f96;
  --fp-gate-btn: #111111;
  --fp-gate-btn-text: #ffffff;
}
[data-theme="dark"] {
  --fp-gate-ink: #f2f3f5;
  --fp-gate-muted: #9aa0ab;
  --fp-gate-btn: #ffffff;
  --fp-gate-btn-text: #111111;
}
@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --fp-gate-ink: #f2f3f5;
    --fp-gate-muted: #9aa0ab;
    --fp-gate-btn: #ffffff;
    --fp-gate-btn-text: #111111;
  }
}

.fp-gate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; background: var(--fp-bg); }
.fp-gate.is-simple { grid-template-columns: minmax(0, 1fr); }

.fp-gate-brand { display: flex; align-items: center; justify-content: center; padding: 3rem clamp(1.5rem, 6vw, 5.5rem); background: var(--fp-surface); color: var(--fp-text); }
.fp-gate-brand-inner { display: flex; flex-direction: column; gap: 1.75rem; width: 100%; max-width: 34rem; margin-inline: auto; text-align: start; }
.fp-gate-heading { display: flex; flex-direction: column; gap: .5rem; }
.fp-gate-name { margin: 0; color: var(--fp-primary); font-family: var(--fp-font-head); font-size: clamp(2.4rem, 4.2vw, 3.4rem); font-weight: 700; line-height: 1.05; letter-spacing: -.01em; text-wrap: balance; overflow-wrap: anywhere; }
.fp-gate-tagline { margin: 0; color: var(--fp-text-2); font-family: var(--fp-font-head); font-size: 1.05rem; line-height: 1.5; max-width: 42ch; }

/* The six characters — cells match the files' 795×930 canvas. */
.fp-lottie-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; max-width: 32rem; }
.fp-lottie-cell { aspect-ratio: 795 / 930; max-width: 100%; overflow: hidden; border-radius: max(calc(var(--fp-radius, 10px) - .25rem), 2px); cursor: pointer; }
.fp-lottie-cell svg { width: 100% !important; height: 100% !important; opacity: 0; transition: opacity .45s ease; }
/* Each character shows once its whole first frame is drawn (login.js adds .is-ready), never half drawn. */
.fp-lottie-cell.is-ready svg { opacity: 1; }
.fp-gate-image { max-width: 100%; border-radius: var(--fp-radius-lg, 14px); }

.fp-gate-promises { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1.25rem; margin: 0; padding: 1.5rem 0 0; border-top: 1px solid var(--fp-border); list-style: none; }
.fp-gate-promises li { display: flex; align-items: center; gap: .6rem; min-width: 0; color: var(--fp-text-2); font-size: .85rem; font-weight: 600; }
.fp-gate-promises svg { flex: none; width: 1.25rem; height: 1.25rem; color: var(--fp-primary); }

.fp-gate-main { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4.5rem 1.25rem 1.5rem; background: var(--fp-surface-2); }
.fp-gate.is-simple .fp-gate-main { background: var(--fp-bg); }
.fp-gate-tools { position: absolute; top: 1rem; inset-inline-end: 1rem; display: flex; align-items: center; gap: .25rem; }

/* Languages side by side in the corner. */
.fp-gate-lang { display: inline-flex; align-items: center; margin-inline-end: .25rem; padding: 3px; border-radius: calc(var(--fp-radius, 10px) * .85); background: var(--fp-surface); }
.fp-gate-lang button { min-height: 2rem; padding: 0 .7rem; border: 0; border-radius: calc(var(--fp-radius, 10px) * .65); background: none; color: var(--fp-text-2); font: inherit; font-size: .8rem; cursor: pointer; }
.fp-gate-lang button:hover { color: var(--fp-text); }
.fp-gate-lang button[aria-pressed="true"] { background: var(--fp-surface-2); color: var(--fp-text); font-weight: 600; }
.fp-gate-icon-btn { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border: 0; border-radius: 50%; background: none; color: var(--fp-text-2); cursor: pointer; }
.fp-gate-icon-btn:hover { background: var(--fp-surface); color: var(--fp-text); }
.fp-gate-icon-btn svg { width: 1.2rem; height: 1.2rem; }
.fp-gate-icon-btn .is-sun { display: none; }
[data-theme="dark"] .fp-gate-icon-btn .is-sun { display: block; }
[data-theme="dark"] .fp-gate-icon-btn .is-moon { display: none; }
@media (prefers-color-scheme: dark) {
  [data-theme="system"] .fp-gate-icon-btn .is-sun { display: block; }
  [data-theme="system"] .fp-gate-icon-btn .is-moon { display: none; }
}

.fp-gate-card { display: flex; flex-direction: column; width: 100%; max-width: 31rem; padding: 3.25rem 3rem 3rem; border: 1px solid var(--fp-border); border-radius: calc(var(--fp-radius, 10px) * 2); background: var(--fp-surface); color: var(--fp-gate-ink); }
.fp-gate-card form { display: flex; flex-direction: column; }
.fp-gate-card > * { order: 3; }
.fp-gate-card > .fp-gate-mark { order: 0; }
.fp-gate-card > .fp-gate-title, .fp-gate-card > .fp-gate-sub { order: 1; }
/* The server's one-time message ("a reset link is on its way") under the title. */
.fp-gate-card > .fp-alert { order: 2; justify-content: center; margin: 0 0 1rem; padding: .6rem .8rem; border: 0; border-radius: max(calc(var(--fp-radius, 10px) - .25rem), 4px); font-size: .84rem; text-align: center; }
.fp-gate-card > .fp-alert svg { display: none; }
.fp-gate-card > .fp-alert-success { background: var(--fp-success-soft); color: var(--fp-success); }
.fp-gate-card > .fp-alert-danger { background: var(--fp-danger-soft); color: var(--fp-danger); }
.fp-gate-card > .fp-alert-warning { background: var(--fp-warning-soft); color: var(--fp-warning); }
.fp-gate-card > .fp-alert-info { background: var(--fp-info-soft); color: var(--fp-info); }
@media (max-width: 575.98px) { .fp-gate-card { padding: 2.25rem 1.5rem 2rem; } }

.fp-gate-mark { display: flex; justify-content: center; margin-bottom: 2rem; color: var(--fp-primary); }
.fp-gate-logo { width: 4.75rem; height: 4.75rem; object-fit: contain; }
.fp-gate-badge { display: inline-grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 50%; background: var(--fp-primary-soft); color: var(--fp-primary); }
.fp-gate-badge svg { width: 1.6rem; height: 1.6rem; }

/* The flame: a still mark with the animated one laid exactly over it while it plays. */
.fp-anim-mark { position: relative; display: block; height: 4.05rem; aspect-ratio: 1273 / 1779; margin-block: .35rem; }
.fp-anim-mark img { max-width: none; max-height: none; user-select: none; }
.fp-anim-still { display: block; width: 100%; height: 100%; }
.fp-anim-still.is-orange { display: none; }
[data-theme="dark"] .fp-anim-still.is-orange { display: block; }
[data-theme="dark"] .fp-anim-still.is-black { display: none; }
@media (prefers-color-scheme: dark) {
  [data-theme="system"] .fp-anim-still.is-orange { display: block; }
  [data-theme="system"] .fp-anim-still.is-black { display: none; }
}
.fp-anim-play { position: absolute; left: -1.21%; top: -31.906%; width: 106.614%; height: 131.906%; opacity: 0; pointer-events: none; }
.fp-anim-mark.is-playing .fp-anim-play { opacity: 1; }
.fp-anim-mark.is-playing .fp-anim-still { visibility: hidden; }
[data-motion="off"] .fp-anim-play { display: none; }

.fp-gate-title { margin: 0 0 .6rem; color: var(--fp-gate-ink); font-family: var(--fp-font-head); font-size: clamp(1.75rem, 4vw, 2.35rem); font-weight: 700; letter-spacing: -.01em; line-height: 1.15; text-align: center; text-wrap: balance; }
.fp-gate-sub { margin: 0 0 1.4rem; color: var(--fp-gate-muted); text-align: center; }

/* Line fields: the label sits on the line and rises when you type; while in use an accent line
   grows across from the start and the label and icon turn accent. */
.fp-float { position: relative; margin-top: 1rem; border-bottom: 1.5px solid var(--fp-gate-ink); }
.fp-float::after { content: ""; position: absolute; inset-inline: 0; bottom: -1.5px; height: 2px; background: var(--fp-primary); transform: scaleX(0); transform-origin: left; transition: transform .25s cubic-bezier(.22, 1, .36, 1); pointer-events: none; }
[dir="rtl"] .fp-float::after { transform-origin: right; }
.fp-float input { display: block; width: 100%; min-height: 3.5rem; padding: 1.45rem 0 .45rem; border: 0; border-radius: 0; outline: 0; background: transparent; color: var(--fp-gate-ink); font: inherit; font-size: 1rem; box-shadow: none; }
.fp-float.has-icon input { padding-inline-start: 1.9rem; }
.fp-float.has-eye input { padding-inline-end: 3rem; }
.fp-float label { position: absolute; top: 1.05rem; inset-inline-start: 0; color: var(--fp-gate-muted); font-size: 1rem; pointer-events: none; transition: top .15s ease, font-size .15s ease, color .15s ease; }
.fp-float.has-icon label { inset-inline-start: 1.9rem; }
.fp-float input:focus + label, .fp-float input:not(:placeholder-shown) + label, .fp-float input:-webkit-autofill + label { top: .45rem; font-size: .74rem; font-weight: 600; }
.fp-float-icon { position: absolute; top: 50%; inset-inline-start: 0; width: 1.15rem; height: 1.15rem; color: var(--fp-gate-muted); transform: translateY(-50%); pointer-events: none; transition: color .15s ease; }
.fp-float:focus-within::after { transform: scaleX(1); }
.fp-float:focus-within label, .fp-float:focus-within .fp-float-icon { color: var(--fp-primary); }
.fp-float input:-webkit-autofill { -webkit-text-fill-color: var(--fp-gate-ink); transition: background-color 9999s ease-out 0s; }
.fp-float.is-invalid { border-color: var(--fp-danger); }
.fp-float.is-invalid::after { background: var(--fp-danger); }
.fp-float.is-invalid label { color: var(--fp-danger); }
.fp-float-eye { position: absolute; top: 50%; inset-inline-end: -.4rem; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border: 0; border-radius: 50%; background: transparent; color: var(--fp-gate-muted); cursor: pointer; transform: translateY(-50%); }
.fp-float-eye:hover, .fp-float-eye:focus-visible { color: var(--fp-primary); }
.fp-float-eye svg { width: 1.25rem; height: 1.25rem; }
.fp-float-eye .is-hide, .fp-float-eye[aria-pressed="true"] .is-show { display: none; }
.fp-float-eye[aria-pressed="true"] .is-hide { display: block; }
.fp-float-error { margin: .35rem 0 0; color: var(--fp-danger); font-size: .8rem; }
.fp-float input.fp-code-input { font-size: 1.25rem; letter-spacing: .25em; text-align: center; }
.fp-float:has(.fp-code-input) label { inset-inline: 0; text-align: center; }

.fp-gate-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin: 1.5rem 0 2.25rem; font-size: .82rem; }
/* The tick box, drawn (never the browser's own). */
.fp-gate-check { display: inline-flex; align-items: center; gap: .6rem; font-weight: 500; cursor: pointer; user-select: none; }
.fp-gate-check input { appearance: none; -webkit-appearance: none; display: grid; place-items: center; flex: none; width: 1.15rem; height: 1.15rem; margin: 0; border: 1.5px solid var(--fp-gate-muted); border-radius: 5px; background: transparent; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.fp-gate-check input::after { content: ""; width: .6rem; height: .35rem; border: 2px solid var(--fp-gate-btn-text); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform .15s ease; }
.fp-gate-check input:checked { border-color: var(--fp-gate-btn); background: var(--fp-gate-btn); }
.fp-gate-check input:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.fp-gate-check input:focus-visible { outline: 2px solid var(--fp-primary); outline-offset: 2px; }
.fp-gate-link { color: var(--fp-gate-muted); white-space: nowrap; text-decoration: none; }
.fp-gate-link:hover { color: var(--fp-primary); }

/* Black (white in dark mode), turning to the brand colour on hover. */
.fp-gate-submit { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 3.35rem; border: 1px solid var(--fp-gate-btn); border-radius: var(--fp-radius, 10px); background: var(--fp-gate-btn); color: var(--fp-gate-btn-text); font-family: var(--fp-font-head); font-size: 1.05rem; font-weight: 600; cursor: pointer; transition: background-color .2s ease, border-color .2s ease, color .2s ease; }
.fp-gate-submit:hover:not(:disabled), .fp-gate-submit:focus-visible { border-color: var(--fp-primary); background: var(--fp-primary); color: var(--fp-on-primary); outline: 0; }
.fp-gate-submit:disabled { opacity: .7; cursor: progress; }
.fp-gate-card .fp-float + .fp-gate-submit, .fp-gate-card .fp-float-error + .fp-gate-submit { margin-top: 1.75rem; }
.fp-gate-arrow { width: 1.05rem; height: 1.05rem; }
[dir="rtl"] .fp-gate-arrow { transform: scaleX(-1); }
.fp-gate-back { margin: 1.25rem 0 0; text-align: center; font-size: .84rem; }
.fp-gate-back .fp-gate-link { display: inline-flex; align-items: center; gap: .35rem; }

.fp-gate-foot { margin-top: 2.5rem; color: var(--fp-text-2); font-family: var(--fp-font-head); font-size: .78rem; text-align: center; }

@media (max-width: 991.98px) {
  .fp-gate { grid-template-columns: minmax(0, 1fr); }
  .fp-gate-brand { display: none; }
}
@media (max-width: 26rem) { .fp-gate-promises { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .fp-float::after, .fp-float label, .fp-lottie-cell svg { transition: none; } }
