/*
 * Softside brand styling for the public (non-embedded) pages: the install
 * landing page and the shop-domain login screen.
 *
 * Brand tokens are taken from the storefront (Softside-web-next-js), which is
 * the canonical public expression of the brand:
 *   tailwind.config.js         → main: #D14B11
 *   styles/global.css          → --background: #FAF6EA
 *   src/components/ui/colors.tsx → charcoal, cream and tan named tokens
 *   src/components/ui/button.tsx → rounded-full, h-10, px-6, font-poppins
 *
 * Served as a static file rather than a bundled import: this app has no CSS
 * pipeline set up, and one landing page is not a reason to add one.
 */

@font-face {
  font-family: "Gliker";
  src: url("/fonts/Gliker-Bold.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Gliker";
  src: url("/fonts/Gliker-SemiBold.woff") format("woff");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("/fonts/Poppins-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("/fonts/Poppins-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --brand: #d14b11;
  --brand-hover: #b84010;
  --cream: #faf6ea;
  --cream-panel: #efe7d0;
  --tan: #e4d7b2;
  --charcoal: #3d3c3c;
  --ink: #1c1b1a;
  /* The brand's muted grey (#9E9E9D) only clears contrast on large hero text.
     For body copy on cream it lands near 2.5:1, so this warm dark grey (~7:1)
     is used instead. */
  --muted: #5a5854;
  --shadow-brutal: 4px 3px 0 var(--ink);
  /* The landing page and the login screen are one flow, so the card keeps the
     same footprint on both: the header stays put and only the body swaps.
     Sized to the taller of the two (the landing page's feature grid). */
  --card-width: 34rem;
  --card-min-height: 41rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background-color: var(--cream);
  font-family: "Poppins", ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--card-width);
  min-height: var(--card-min-height);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 1rem;
  box-shadow: var(--shadow-brutal);
  padding: clamp(1.75rem, 5vw, 2.75rem);
}

/* The body absorbs the difference in content height between the two pages, so
   the header sits at the top and the footer at the bottom on both. */
.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.wordmark {
  display: block;
  width: min(15rem, 70%);
  height: auto;
  /* The PNG carries generous internal padding, so the optical gap is larger
     than this value suggests. */
  margin: 0 auto clamp(0.25rem, 1vw, 0.5rem);
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-family: "Gliker", "Poppins", sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand);
  text-align: center;
}

.title {
  margin: 0 0 0.75rem;
  font-family: "Gliker", "Poppins", sans-serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 5vw, 2rem);
  line-height: 1.15;
  /* Two lines are reserved (2 × line-height) so a one-line title does not pull
     everything below it up — see the note on .lede. */
  min-height: 2.3em;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-align: center;
}

.lede {
  margin: 0 auto clamp(1.5rem, 4vw, 2rem);
  max-width: 30rem;
  /* Two lines are reserved so a shorter lede does not pull the body up: the
     whole heading block keeps its height from one page to the next. */
  min-height: calc(2 * 1.6 * 0.95rem);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

.features {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 clamp(1.5rem, 4vw, 2rem);
  padding: 0;
  list-style: none;
}

@media (min-width: 34rem) {
  .features {
    grid-template-columns: 1fr 1fr;
  }
}

/* Solid colour blocks rather than elevated cards — the storefront's feature
   tiles are flat fills that lean on colour contrast, not depth. */
.feature {
  border-radius: 0.75rem;
  padding: 1rem 1.1rem;
  background: var(--cream-panel);
}

.feature + .feature {
  background: var(--tan);
}

.feature h2 {
  margin: 0 0 0.35rem;
  font-family: "Gliker", "Poppins", sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.feature p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #4a4844;
}

/* --- Form (shop-domain login) ------------------------------------------- */

.form {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1rem;
  margin: 0;
  text-align: left;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field-label {
  font-family: "Gliker", "Poppins", sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Full-pill input, matching the storefront's newsletter field
   (`rounded-full h-12 pl-4`). */
.input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0 1.1rem;
  border: 2px solid var(--ink);
  border-radius: 9999px;
  background: #fff;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  transition: box-shadow 120ms ease;
}

.input::placeholder {
  color: #9b96a0;
}

.input:focus {
  outline: none;
  box-shadow: var(--shadow-brutal);
}

.input:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.error {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: #c22d0b;
}

/* Pushed to the bottom of the body on both pages, so the button — like the
   header and the footer — does not move when the content between them swaps. */
.cta-row {
  margin: auto 0 0;
  text-align: center;
}

/* Used for both the landing page's <a> and the login form's <button>, so it
   resets the button-specific defaults browsers apply. */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 2.75rem;
  padding: 0 2rem;
  cursor: pointer;
  appearance: none;
  border: 2px solid var(--ink);
  border-radius: 9999px;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-brutal);
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background-color 120ms ease;
}

.cta:hover {
  background: var(--brand-hover);
}

/* Presses into the page — the hard shadow collapsing is what makes the
   neo-brutalist treatment feel physical rather than decorative. */
.cta:active {
  transform: translate(4px, 3px);
  box-shadow: 0 0 0 var(--ink);
}

.cta:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.footer {
  margin: clamp(1.5rem, 4vw, 2rem) 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

.footer a {
  color: var(--ink);
  text-decoration-color: var(--brand);
  text-underline-offset: 2px;
}

.footer a:hover {
  color: var(--brand);
}

@media (prefers-reduced-motion: reduce) {
  .cta {
    transition: none;
  }
  .cta:active {
    transform: none;
  }
}
