/* The public pages' own base: the public site (the landing page and its sister pages) and
   the sign-in, sign-up and password pages. A reset (these pages do not load the app's
   Tailwind build), buttons, form fields, the alert and the logo. The colours and
   the font are the product's tokens, static/css/tokens.css, loaded before this file. Each
   page adds its own stylesheet after it: landing.css, or static/css/pages/auth.css. Classes
   are prefixed lp-.

   Motion rule: an element's plain style is its finished, visible state, and keyframes only
   describe where it comes from. So with animations off nothing is left hidden. */

/* --- Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--ui-bg);
    color: var(--ui-text);
    font-family: var(--ui-font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; }
em { font-style: normal; }
:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 3px; border-radius: 4px; }

.lp-skip {
    position: absolute; left: 16px; top: -56px; z-index: 100;
    padding: 8px 14px; border-radius: 8px;
    background: var(--ui-accent); color: var(--ui-accent-ink); font-weight: 500;
}
.lp-skip:focus { top: 12px; }
/* In the page for a screen reader, not on the screen. */
.lp-quiet { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* --- Buttons --------------------------------------------------------------- */
.lp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 34px; padding: 0 14px;
    border: 1px solid transparent; border-radius: 8px;
    font-size: .9rem; font-weight: 500; white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s;
}
.lp-btn-primary { background: var(--ui-primary); border-color: var(--ui-primary-line); color: var(--ui-primary-ink); }
.lp-btn-primary:hover { background: var(--ui-primary-hover); }
.lp-btn-ghost { background: var(--ui-surface-2); border-color: var(--ui-line-strong); }
.lp-btn-ghost:hover { background: var(--ui-hover); border-color: var(--ui-line-hover); }
.lp-btn-lg { height: 40px; padding: 0 18px; font-size: .95rem; }
.lp-btn i { font-size: .8em; transition: transform .2s var(--ui-ease); }
.lp-btn:hover .fa-arrow-right { transform: translateX(3px); }
.lp-btn:disabled { opacity: .55; cursor: not-allowed; }

/* --- Form fields ------------------------------------------------------------ */
/* A label over its box: the sign-in pages' forms and the enquiry form. */
.lp-field { display: grid; gap: 6px; }
.lp-field label { font-size: .875rem; font-weight: 500; color: var(--ui-text-2); }
.lp-field label span { margin-left: 4px; font-size: .78rem; font-weight: 400; color: var(--ui-text-3); }
.lp-field :is(input, select, textarea) {
    width: 100%; height: 44px; padding: 0 12px;
    border: 1px solid var(--ui-line-strong); border-radius: 8px;
    background: var(--ui-surface); color: var(--ui-text);
    font: inherit; font-size: .95rem;
    transition: border-color .15s, box-shadow .15s;
}
.lp-field textarea { height: auto; min-height: 132px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.lp-field :is(input, select, textarea):hover { border-color: var(--ui-line-hover); }
.lp-field :is(input, select, textarea):focus { outline: none; border-color: var(--ui-accent); box-shadow: 0 0 0 3px var(--ui-ring); }
.lp-field [aria-invalid="true"] { border-color: var(--ui-bad); }
.lp-field :disabled { background: var(--ui-inset); border-color: var(--ui-line); cursor: not-allowed; }
/* What is wrong with one field, under its box. */
.lp-error { margin: 0; font-size: .8125rem; font-weight: 500; color: var(--ui-bad); }

/* --- A heading redrawn letter by letter -------------------------------------- */
/* A sentence that changes (landing.js, [data-stagger]: it builds a <b> per letter with its
   place in --c, keeping each word whole so the line wraps between words). A letter rises into
   place after the one before it; the old sentence leaves as one. Used by the sign-in pages'
   heading, which do not load landing.css, so the rules live here. */
.lp-stagger { display: block; }
.lp-stagger i { display: inline-block; font-style: inherit; white-space: nowrap; }
.lp-stagger b {
    display: inline-block; font-weight: inherit;
    animation: lp-letter .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--c) * 18ms);
}
.lp-stagger.is-out { opacity: 0; transform: translateY(-.25em); transition: opacity .28s, transform .28s var(--ui-ease); }
/* The words in the accent colour inside such a sentence. */
.lp-hot { background: none; color: var(--ui-accent-text); }
@keyframes lp-letter { from { opacity: 0; transform: translateY(.55em) rotate(4deg); filter: blur(5px); } }

/* --- Alert: a message above a form. data-tone picks the colour --------------- */
.lp-alert {
    --tone: var(--ui-text-2);
    display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
    border: 1px solid var(--ui-line); border-radius: 10px;
    border-color: color-mix(in srgb, var(--tone) 35%, transparent);
    background: color-mix(in srgb, var(--tone) 7%, var(--ui-surface));
    font-size: .875rem; line-height: 1.5; color: var(--ui-text-2);
}
.lp-alert[data-tone="bad"] { --tone: var(--ui-bad); }
.lp-alert[data-tone="good"] { --tone: var(--ui-good); }
.lp-alert[data-tone="warn"] { --tone: var(--ui-warn); }
.lp-alert > i { margin-top: .2em; color: var(--tone); }
.lp-alert b { display: block; font-weight: 500; color: var(--ui-text); }

/* --- Logo ------------------------------------------------------------------ */
/* The mark is templates/components/logo_mark.html, which brings its own styles. */
.lp-logo { display: inline-flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
.lp-logo b { color: var(--ui-accent); font-weight: 700; }

@keyframes lp-rise { from { opacity: 0; transform: translateY(10px); } }

/* Reduced motion: everything in its finished state. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
