/* =============================================================================
   /signup/ — page-scoped stylesheet
   -----------------------------------------------------------------------------
   Ported from the reference design (intelio-signup-mockup.html). Every rule is
   namespaced with .su-* so nothing here can leak into the shared header/footer
   (which keep using /css/styles.css). Loaded AFTER /css/styles.css on purpose.

   Additions on top of the reference (the reference is a static mockup and has
   no server-error / loading / validation states):
     .su-errors / .su-error        — server error banner region
     .su-field-errors              — per-field error text
     input[aria-invalid="true"]    — invalid field state
     .su-btn[aria-busy] / spinner  — submit loading + disabled states
     .su-social-note               — "Google sign-in unavailable" notice
   ============================================================================= */

.su-page {
  --su-surface: #ffffff;
  --su-dark: #111921;
  --su-red: #c92f33;
  --su-red-dark: #b02529;
  --su-red-active: #9c2124;
  --su-red-disabled: #c98d8f;
  --su-red-soft: #f9eaea;
  --su-red-light: #e07070;
  --su-ink: #1b1b1b;
  --su-muted: #5a6572;
  --su-line: #dfe4ea;
  --su-placeholder: #9aa5b1;
  --su-sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --su-mono: "JetBrains Mono", ui-monospace, monospace;

  display: grid;
  grid-template-columns: 1fr 1fr;
  /* 81px = the shared site header height (kept intact above this block). */
  min-height: calc(100vh - 81px);
  background: #f1f4f7;
  color: var(--su-ink);
  font-family: var(--su-sans);
  line-height: 1.6;
  text-align: left;
}

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

/* --------------------------------------------------------------- form side */
.su-formside {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 64px;
  background: var(--su-surface);
}

.su-formside h1 {
  margin: 0 0 8px;
  padding: 0;
  font-family: var(--su-sans);
  font-size: 30px;
  /* line-height intentionally not set: the reference inherits 1.6 (=48px). */
  color: var(--su-ink);
}

.su-sub {
  margin: 0 0 32px;
  padding: 0;
  color: var(--su-muted);
  font-size: 15px;
  line-height: 1.6;
}

/* ------------------------------------------------------- server error banner */
.su-errors {
  margin: 0 0 22px;
}

.su-errors:empty {
  display: none;
}

.su-errors:focus-visible {
  outline: 2px solid var(--su-red);
  outline-offset: 2px;
}

/* Normalises whatever markup the controller emits into one styled alert. */
.su-errors > *,
.su-page .su-error {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--su-red-light);
  border-left: 3px solid var(--su-red);
  border-radius: 2px;
  background: var(--su-red-soft);
  color: #8f2124;
  font-family: var(--su-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.su-errors > * + * {
  margin-top: 10px;
}

.su-errors a {
  color: #8f2124;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ------------------------------------------------------------------- fields */
.su-field {
  margin-bottom: 18px;
}

.su-field label {
  display: block;
  margin: 0 0 7px;
  font-family: var(--su-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--su-muted);
}

.su-field input {
  width: 100%;
  margin: 0;
  font-family: var(--su-sans);
  font-size: 15px;
  /* "normal" matches the reference exactly (Chrome's UA value, not inherited
     1.6 from the page) — keeps the field at the reference height. */
  line-height: normal;
  padding: 13px 14px;
  border: 1px solid var(--su-line);
  border-radius: 2px;
  outline: none;
  color: var(--su-ink);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Focus ring per the reference: border turns Intelio red. */
.su-field input:focus {
  border-color: var(--su-red);
  box-shadow: 0 0 0 3px rgba(201, 47, 51, 0.1);
}

.su-field input::placeholder {
  color: var(--su-placeholder);
}

/* Invalid (server-rejected) field state. */
.su-field input[aria-invalid="true"] {
  border-color: var(--su-red);
  background: #fffafa;
}

/* Per-field error text (fragment emitted by the controller). */
.su-field-errors:empty {
  display: none;
}

.su-field-errors {
  margin-top: 7px;
}

.su-field-errors > *,
.su-page .su-field-error,
.su-field > p {
  margin: 0;
  padding: 0;
  font-family: var(--su-mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--su-red);
}

/* ------------------------------------------------------- password + toggle */
.su-passwrap {
  position: relative;
}

.su-passwrap input {
  padding-right: 46px;
}

.su-passtoggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #8b95a1;
  border-radius: 2px;
}

.su-passtoggle svg {
  width: 16px;
  height: 16px;
}

.su-passtoggle:hover {
  color: var(--su-red);
}

.su-passtoggle:focus-visible {
  outline: 2px solid var(--su-red);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ button */
.su-btn {
  display: block;
  width: 100%;
  padding: 15px;
  background: var(--su-red);
  color: #fff;
  border: none;
  font-family: var(--su-sans);
  font-size: 13px;
  font-weight: 700;
  line-height: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  margin-top: 8px;
  transition: background 0.15s ease;
}

.su-btn:hover:not(:disabled) {
  background: var(--su-red-dark);
}

.su-btn:active:not(:disabled) {
  background: var(--su-red-active);
}

.su-btn:focus-visible {
  outline: 2px solid var(--su-ink);
  outline-offset: 2px;
}

/* Disabled / loading state. */
.su-btn:disabled,
.su-btn[aria-busy="true"] {
  background: var(--su-red-disabled);
  cursor: progress;
}

.su-btn-label {
  display: inline;
}

.su-btn-loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
}

.su-btn[aria-busy="true"] .su-btn-label {
  display: none;
}

.su-btn[aria-busy="true"] .su-btn-loading {
  display: inline-flex;
}

.su-spinner {
  width: 14px;
  height: 14px;
  flex: none;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: su-spin 0.7s linear infinite;
}

@keyframes su-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .su-spinner {
    animation-duration: 1.8s;
  }
}

.su-note {
  margin: 16px 0 0;
  padding: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--su-muted);
  text-align: center;
}

.su-note a {
  color: var(--su-red);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.su-login {
  margin: 28px 0 0;
  padding: 0;
  text-align: center;
  font-size: 14px;
  color: var(--su-muted);
}

.su-login a {
  color: var(--su-red);
  font-weight: 600;
  text-decoration: none;
}

.su-login a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --------------------------------------------------------- divider / Google */
.su-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0;
  color: #9aa5a1;
  font-size: 12px;
}

.su-divider::before,
.su-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--su-line);
}

.su-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px;
  background: #fff;
  border: 1px solid var(--su-line);
  font-family: var(--su-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: normal;
  color: var(--su-ink);
  cursor: pointer;
  border-radius: 2px;
  transition: border-color 0.15s ease;
}

.su-google:hover {
  border-color: var(--su-ink);
}

.su-google:focus-visible {
  outline: 2px solid var(--su-red);
  outline-offset: 2px;
}

.su-google svg {
  flex: none;
}

.su-social-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--su-line);
  border-radius: 2px;
  background: #f7f9fb;
  color: var(--su-muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.su-social-note[hidden] {
  display: none;
}

/* -------------------------------------------------------------- benefits side */
.su-benefits {
  background: var(--su-dark);
  color: #fff;
  padding: 48px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.su-benefits .kicker {
  font-family: var(--su-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--su-red-light);
  margin-bottom: 14px;
}

.su-benefits h2 {
  margin: 0 0 14px;
  padding: 0;
  font-family: var(--su-sans);
  font-size: 26px;
  line-height: 1.25;
  color: #fff;
}

.su-benefits > p {
  color: var(--su-placeholder);
  font-size: 15px;
  margin: 0 0 34px;
  padding: 0;
  max-width: 420px;
}

.su-perk {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid #232c38;
}

.su-perk:first-of-type {
  border-top: none;
}

.su-perk-icon {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: #0c1219;
  border: 1px solid #232c38;
  display: flex;
  align-items: center;
  justify-content: center;
}

.su-perk-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--su-red-light);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.su-perk b {
  display: block;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.su-perk span {
  font-size: 13px;
  line-height: 1.6;
  color: var(--su-placeholder);
}

/* ------------------------------------------------------------- breakpoints */
/* Tablet + mobile: single column, benefits panel hidden (reference behaviour). */
@media (max-width: 900px) {
  .su-page {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 65px);
  }

  .su-benefits {
    display: none;
  }

  .su-formside {
    padding: 36px 22px;
    justify-content: flex-start;
  }

  .su-formside h1 {
    font-size: 24px;
    line-height: 1.25;
    margin-bottom: 6px;
  }

  .su-sub {
    font-size: 14px;
    margin-bottom: 26px;
  }
}

/* Small phones — keep the reference rhythm, just tighten the gutters. */
@media (max-width: 480px) {
  .su-formside {
    padding: 30px 18px;
  }

  .su-page {
    min-height: calc(100vh - 61px);
  }
}

/* ==========================================================================
   Heading typography override — MUST stay inside @layer base.
   --------------------------------------------------------------------------
   /css/styles.css (Tailwind v4) contains:
       @layer base { h1, h2, h3, h4, h5, h6 {
           font-family: var(--font-sans) !important;
           letter-spacing: -0.02em !important;
           font-weight: 600 !important; } }
   For !important author declarations the cascade REVERSES layer order, so a
   layered !important beats an unlayered !important no matter the specificity.
   Living in the same `base` layer means our higher-specificity selector wins
   deterministically and the headings render at the reference weights.
   ========================================================================== */
@layer base {
  .su-page .su-formside h1,
  .su-page .su-benefits h2 {
    font-family: var(--su-sans) !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
  }
}
