/* backend/resources/static/foundation/ssr.css - the Foundation classes of the server-rendered card pages, as `lc-`
   classes scoped under `.lc-ssr` so they never leak into the public design around them (#16 task 4.1; #35 Phase 5: the
   site's standard). Pages: the sign-up cards inside a Local's site (themes/default/{auth,setup_pending}.html - the
   Local's colour, D18) and the app's message page (views/editor/message.html - the standard blue, it belongs to the app).
   The approved look: design/foundation/features/35-public-site.html (#register, #join, #activating, #messages).
   Every colour is a --lc-* token from ssr-tokens.css (load it first; inside the public design it follows that page's
   variables); tints are color-mix() of a token. Light / dark follow ssr-tokens.css (the public data-theme attribute,
   else the OS). Sizes: the Control Size Contract - 36 / 42 px controls, 48 px on the sign-up cards (-auth); pill
   buttons, 12 px fields, 18 px cards. Hindi / Telugu / Gujarati: no uppercase, letter-spacing only on ASCII codes,
   line-height >= 1.5 on text. */

/* ---- Variables ---- */
.lc-ssr {
  --lc-text-ui: 0.9375rem;
  --lc-radius-sm: 8px;
  --lc-radius-md: 10px;
  --lc-radius-lg: var(--lc-radius);
  --lc-radius-xl: 18px;
  --lc-control-sm: 36px;
  --lc-control: 42px;
  --lc-control-auth: 48px;
  --lc-duration: 160ms;
  --lc-copy: color-mix(in srgb, var(--lc-foreground) 80%, var(--lc-card));
  --lc-line-strong: color-mix(in srgb, var(--lc-border) 93%, var(--lc-foreground));
  --lc-shadow-sm: 0 1px 2px rgb(0 0 0 / .05);
  --lc-primary-hover: var(--accent-solid-hover, color-mix(in srgb, var(--lc-primary) 86%, #000));
  --lc-danger-bg: color-mix(in srgb, var(--lc-destructive) 10%, var(--lc-card));
  --lc-danger-line: color-mix(in srgb, var(--lc-destructive) 35%, var(--lc-card));
  font-family: var(--lc-font-sans);
  font-size: var(--lc-text-ui);
  line-height: 1.6;
  color: var(--lc-foreground);
  text-align: start;
}
:root[data-theme="dark"] .lc-ssr,
.dark .lc-ssr {
  --lc-copy: var(--lc-muted-foreground);
  --lc-shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
  --lc-primary-hover: var(--accent-solid-hover, color-mix(in srgb, var(--lc-primary) 88%, #fff));
  --lc-danger-bg: color-mix(in srgb, var(--lc-destructive) 16%, var(--lc-card));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .lc-ssr {
    --lc-copy: var(--lc-muted-foreground);
    --lc-shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
    --lc-primary-hover: var(--accent-solid-hover, color-mix(in srgb, var(--lc-primary) 88%, #fff));
    --lc-danger-bg: color-mix(in srgb, var(--lc-destructive) 16%, var(--lc-card));
  }
}

/* ---- Reset inside the scope (the public design styles bare h1 / p / button / a) ---- */
.lc-ssr *, .lc-ssr *::before, .lc-ssr *::after { box-sizing: border-box; }
.lc-ssr h1, .lc-ssr h2, .lc-ssr h3, .lc-ssr p, .lc-ssr ul, .lc-ssr form, .lc-ssr fieldset { margin: 0; }
.lc-ssr [hidden] { display: none !important; }
.lc-ssr :focus { outline: none; }
/* One focus ring for buttons and links: 2px, 2px off the edge (fields: their border, below). */
.lc-ssr :focus-visible { outline: 2px solid var(--lc-ring); outline-offset: 2px; }
.lc-ssr a:not(.lc-btn):focus-visible { border-radius: var(--lc-radius-sm); }

/* ---- Page layout ---- */
.lc-ssr.lc-page { padding: clamp(32px, 6vw, 64px) 16px; }
.lc-ssr.lc-screen { margin: 0; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--lc-background); }
.lc-ssr .lc-container { width: 100%; max-width: 28rem; margin-inline: auto; }
.lc-ssr .lc-stack { display: grid; gap: 16px; min-width: 0; }
.lc-ssr .lc-center { text-align: center; }
.lc-ssr .lc-muted { color: var(--lc-muted-foreground); }

/* ---- Card (the site's card: 18px, the hairline, the soft shadow) ---- */
.lc-ssr .lc-card {
  display: grid; gap: 20px; min-width: 0; padding: clamp(20px, 5vw, 28px);
  border: 1px solid var(--lc-border); border-radius: var(--lc-radius-xl);
  background: var(--lc-card); color: var(--lc-card-foreground); box-shadow: var(--lc-shadow-card);
}
.lc-ssr .lc-card-head { display: grid; justify-items: start; gap: 6px; }
.lc-ssr .lc-card-head > .lc-spinner, .lc-ssr .lc-card-head > .lc-icon-well { margin-bottom: 8px; }

/* ---- Type ---- */
/* No font-family: fonts.css gives Hindi / Telugu / Gujarati headings their own face. */
.lc-ssr .lc-title { font-size: 1.5rem; line-height: 1.3; font-weight: 700; letter-spacing: -0.02em; color: var(--lc-foreground); overflow-wrap: anywhere; }
.lc-ssr .lc-lead { font-size: var(--lc-text-ui); line-height: 1.6; color: var(--lc-copy); }
.lc-ssr .lc-text { font-size: 0.875rem; line-height: 1.6; }
.lc-ssr .lc-help { font-size: 0.875rem; line-height: 1.6; color: var(--lc-muted-foreground); }
.lc-ssr .lc-strong { font-weight: 600; }
/* A link is the colour as text on the page - the ink, not the fill. */
.lc-ssr .lc-link { color: var(--lc-primary-ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.lc-ssr .lc-link:hover { text-decoration-thickness: 2px; }

/* A label or a question between two lines ("Have an invitation code?"). */
.lc-ssr .lc-divider-text { display: flex; align-items: center; gap: 12px; font-size: 0.8125rem; font-weight: 500; line-height: 1.5; color: var(--lc-muted-foreground); text-align: center; }
.lc-ssr .lc-divider-text::before, .lc-ssr .lc-divider-text::after { content: ""; flex: 1 1 1.5rem; border-top: 1px solid var(--lc-border); }

/* ---- Buttons (the site's: pills, 42px, 15px semibold; 48px on the cards; hover lifts) ---- */
.lc-ssr .lc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--lc-control); padding: 0 20px; margin: 0;
  border: 1.5px solid transparent; border-radius: 999px;
  font: inherit; font-size: var(--lc-text-ui); font-weight: 600; line-height: 1.2; white-space: nowrap; text-align: center; text-decoration: none; user-select: none; cursor: pointer;
  background: var(--lc-primary); color: var(--lc-primary-foreground);
  transition: background-color var(--lc-duration), border-color var(--lc-duration), color var(--lc-duration), box-shadow var(--lc-duration), transform var(--lc-duration);
}
.lc-ssr .lc-btn:hover { background: var(--lc-primary-hover); color: var(--lc-primary-foreground); transform: translateY(-1px); box-shadow: var(--lc-shadow-card); }
.lc-ssr .lc-btn:active { transform: none; }
.lc-ssr .lc-btn:disabled, .lc-ssr .lc-btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.lc-ssr .lc-btn-primary { background: var(--lc-primary); color: var(--lc-primary-foreground); }
/* Outline: white, the strong line, ink (Use code, Admin sign in). */
.lc-ssr .lc-btn-outline { background: var(--lc-card); color: var(--lc-foreground); border-color: var(--lc-line-strong); box-shadow: var(--lc-shadow-sm); }
.lc-ssr .lc-btn-outline:hover { background: var(--lc-muted); color: var(--lc-foreground); border-color: var(--lc-input); box-shadow: var(--lc-shadow-sm); }
.lc-ssr .lc-btn-sm { height: var(--lc-control-sm); padding: 0 14px; font-size: 0.875rem; gap: 6px; }
.lc-ssr .lc-btn-auth { height: var(--lc-control-auth); padding: 0 24px; font-size: 1rem; }
.lc-ssr .lc-btn-block { display: flex; width: 100%; }

/* ---- Fields (42px, 12px corners, the #939393 outline; 48px on the cards; focus = the border in the ring colour with a
   faint glow) ---- */
.lc-ssr .lc-label { display: inline-flex; align-items: center; gap: 4px; font-size: 0.875rem; font-weight: 500; line-height: 1.5; color: var(--lc-foreground); }
.lc-ssr .lc-input {
  display: block; width: 100%; min-width: 0; margin: 0;
  height: var(--lc-control); padding: 0 14px;
  border: 1px solid var(--lc-input); border-radius: var(--lc-radius-lg);
  background: var(--lc-card); color: var(--lc-foreground);
  font: inherit; font-size: 1rem; line-height: 1.5;
  transition: border-color var(--lc-duration), box-shadow var(--lc-duration);
}
.lc-ssr .lc-input::placeholder { color: var(--lc-muted-foreground); opacity: 1; }
.lc-ssr .lc-input:hover { border-color: var(--lc-muted-foreground); }
.lc-ssr .lc-input:focus { border-color: var(--lc-ring); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--lc-ring) 15%, transparent); }
.lc-ssr .lc-input[aria-invalid="true"] { border-color: var(--lc-destructive); }
.lc-ssr .lc-input-auth { height: var(--lc-control-auth); }
/* The invitation code and Use code in one row; the code is ASCII, so it may be spaced and upper case. */
.lc-ssr .lc-code-row { display: flex; gap: 8px; min-width: 0; }
.lc-ssr .lc-code-row > .lc-input { flex: 1 1 auto; font-family: var(--lc-font-mono); letter-spacing: 0.12em; text-transform: uppercase; }
.lc-ssr .lc-code-row > .lc-input::placeholder { letter-spacing: 0.12em; }
.lc-ssr .lc-code-row > .lc-btn { flex: none; }

/* ---- Alerts (the site's: 14px corners, the tone's tint and line, an icon) ---- */
.lc-ssr .lc-alert {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 14px 16px;
  border: 1px solid var(--lc-border); border-radius: 14px;
  background: var(--lc-card); color: var(--lc-card-foreground);
  font-size: var(--lc-text-ui); line-height: 1.6; overflow-wrap: anywhere;
}
.lc-ssr .lc-alert > .icon { flex: none; width: 18px; height: 18px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lc-ssr .lc-alert-danger { background: var(--lc-danger-bg); border-color: var(--lc-danger-line); color: var(--lc-danger-foreground); }
.lc-ssr .lc-alert-info { background: color-mix(in srgb, var(--lc-info) 10%, var(--lc-card)); border-color: color-mix(in srgb, var(--lc-info) 35%, var(--lc-card)); color: var(--lc-info-foreground); }

/* ---- Working on it / waiting: a spinner in the colour, an icon on the colour's tint ---- */
.lc-ssr .lc-spinner { display: inline-block; width: 28px; height: 28px; border: 3px solid color-mix(in srgb, var(--lc-foreground) 12%, transparent); border-top-color: var(--lc-primary-ink); border-radius: 50%; animation: lc-ssr-spin 0.8s linear infinite; }
@keyframes lc-ssr-spin { to { transform: rotate(360deg); } }
.lc-ssr .lc-icon-well { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--lc-primary-ink) 10%, var(--lc-card)); color: var(--lc-primary-ink); }
.lc-ssr .lc-icon-well > .icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- The app's message page (signed out / no access / setting up): the LocalCen mark, one card, one button ---- */
.lc-ssr .lc-message { width: 100%; max-width: 28rem; }
.lc-ssr .lc-brand-mark { width: 40px; height: 40px; margin-bottom: 8px; color: var(--lc-brand-ink); }
.lc-ssr .lc-brand-mark svg { display: block; width: 100%; height: 100%; }

/* ---- Hindi / Telugu / Gujarati: no negative tracking, taller lines ---- */
.lc-ssr:lang(hi), .lc-ssr:lang(te), .lc-ssr:lang(gu) { line-height: 1.7; }
.lc-ssr:lang(hi) .lc-title, .lc-ssr:lang(te) .lc-title, .lc-ssr:lang(gu) .lc-title { letter-spacing: normal; line-height: 1.45; }
.lc-ssr:lang(hi) .lc-btn, .lc-ssr:lang(te) .lc-btn, .lc-ssr:lang(gu) .lc-btn { line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
  .lc-ssr *, .lc-ssr *::before, .lc-ssr *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .lc-ssr .lc-spinner { animation-duration: 2.4s !important; }
}
