/* LTSM Mail Portal - Styles. Self-hosted only; no inline styles (CSP). */

/* ---------- Fonts ---------- */
/* Self-hosted (CSP font-src 'self'). Latin subset, wght 400-700. License: assets/fonts/OFL-GoogleSansFlex.txt */
@font-face {
  font-family: "Google Sans Flex";
  src: url("../fonts/google-sans-flex-latin-wght.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Brandbook 2026: Pantone 1795 C and Cool Gray 9 C */
  --brand-red: #b92c32;
  --brand-gray: #757679;

  --accent: var(--brand-red);
  --accent-hover: #a2262c;
  --accent-active: #8c2026;
  --focus-ring: rgba(185, 44, 50, .2);
  --paper: #fff;
  --surface: #fff;
  --ink: #1f2022;
  --text: #3a3b3e;
  --muted: var(--brand-gray);
  --placeholder: #9a9b9e;
  --border: #d4d5d7;
  --border-hover: #aeafb2;
  --hairline: #e6e7e8;
  --on-brand: #fff;

  /* Brand typeface Acumin is not licensed for web; Google Sans Flex (OFL) matches the logo lettering. */
  --font-sans: "Google Sans Flex", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Layout ---------- */
.portal {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

/* ---------- Form column ---------- */
.form-pane {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 1.5rem;
  background: var(--paper);
}

.form-pane-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

.pane-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 3rem;
}

/* Horizontal logo: minimum 85px wide per brandbook; shown only where the brand panel is below the fold. */
.logo-link { display: inline-block; line-height: 0; }
.logo { width: 180px; height: auto; }

.login { margin-bottom: auto; }

.login-title {
  font-size: 1.625rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

.login-sub {
  margin-top: 0.375rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.auth-form { margin-top: 2rem; }

.field + .field { margin-top: 1.25rem; }

.field-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.field-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.input::placeholder { color: var(--placeholder); }
.input:hover { border-color: var(--border-hover); }

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.input-wrap { position: relative; }
.input-with-action { padding-right: 5rem; }

.input-action {
  position: absolute;
  top: 0;
  right: 0;
  height: 48px;
  padding: 0 14px;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
}

.input-action:hover { color: var(--ink); }

/* Text buttons */
.link-button {
  padding: 0;
  font: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: none;
  border: 0;
  cursor: pointer;
}

.link-button:hover { text-decoration: underline; text-underline-offset: 3px; }

.link-button-accent {
  font-size: 0.8125rem;
  color: var(--accent);
}

/* Submit */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  margin-top: 1.75rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.btn-submit:hover { background: var(--accent-hover); }
.btn-submit:active { background: var(--accent-active); }
.btn-submit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-submit:disabled { cursor: progress; background: var(--accent-hover); }

.btn-text[hidden], .btn-loading[hidden] { display: none; }

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
}

/* Services */
.services {
  margin-top: 2rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--hairline);
}

.service-link {
  display: block;
  padding: 0.875rem 0;
  text-decoration: none;
}

.service-title {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
}

.service-glyph { color: var(--muted); }

.service-desc {
  display: block;
  font-size: 0.8125rem;
  color: var(--muted);
}

.service-link:hover .service-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pane-legal {
  max-width: 380px;
  width: 100%;
  margin: 2rem auto 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ---------- Brand panel ---------- */
.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.5rem;
  padding: clamp(2rem, 5vw, 4.5rem);
  color: var(--on-brand);
  background: var(--brand-red);
}


/* Vertical white logo: primary version, white on red. Minimum 141px wide with slogan. */
.brand-logo { width: 168px; height: auto; }

.brand-body, .brand-foot { max-width: 36rem; }

.brand-title {
  max-width: 18ch;
  font-size: clamp(2.1rem, 3.2vw, 3.1rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.brand-lead {
  max-width: 42ch;
  margin-top: 1.5rem;
  font-size: 1.0625rem;
  opacity: .9;
}

/* Information lists (shared by brand panel and modal) */
.info-list { margin: 0; }

.info-row {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(255, 255, 255, .28);
  font-size: 0.9375rem;
}

.info-row:last-child { border-bottom: 1px solid rgba(255, 255, 255, .28); }

.info-row dt { font-size: 0.875rem; opacity: .85; }
.info-row a { text-underline-offset: 3px; }

/* ---------- Support dialog ---------- */
.modal {
  width: calc(100% - 2rem);
  max-width: 440px;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 0;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(31, 32, 34, .18);
}

.modal::backdrop { background: rgba(31, 32, 34, .55); }

.modal-inner { padding: 1.5rem; }

.modal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}

.modal-close { flex: none; color: var(--muted); }

.modal-text {
  margin: 0.75rem 0 1.25rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.info-list-light .info-row {
  border-top-color: var(--hairline);
  grid-template-columns: 6rem 1fr;
}

.info-list-light .info-row:last-child { border-bottom-color: var(--hairline); }
.info-list-light .info-row dt { color: var(--muted); opacity: 1; }
.info-list-light .info-row a { color: var(--accent); }

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
  .portal { grid-template-columns: 44% 1fr; }

  .brand-panel {
    grid-column: 1;
    grid-row: 1;
    min-height: 100vh;
  }

  .form-pane {
    grid-column: 2;
    grid-row: 1;
    padding: 2rem clamp(2rem, 4vw, 4rem);
  }

  .form-pane-inner { max-width: 380px; }

  /* The brand panel carries the logo on desktop. */
  .logo-link { visibility: hidden; }

  .login {
    margin-top: auto;
    margin-bottom: 0;
  }

  .services { margin-bottom: auto; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }

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

  .brand-title,
  .brand-lead,
  .info-list {
    animation: rise 500ms var(--ease) both;
  }

  .brand-title { animation-delay: 60ms; }
  .brand-lead { animation-delay: 120ms; }
  .info-list { animation-delay: 180ms; }

  .spinner { animation: spin 700ms linear infinite; }

  .input,
  .input-action,
  .btn-submit,
  .link-button {
    transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease), background-color 150ms var(--ease), color 150ms var(--ease);
  }
}
