:root {
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-legacy: Arial, Helvetica, sans-serif;

  /* Core LymphAware brand colours taken directly from the approved logo. */
  --brand-green: #247a24;
  --brand-green-dark: #1f681f;
  --brand-green-action-top: #288628;
  --brand-green-light: #eef7f0;
  --brand-blue: #0053b7;
  --brand-blue-dark: #003f8a;
  --brand-blue-light: #eef6fb;
  --brand-multilingual: #237e7b;

  --green: var(--brand-green);
  --green-dark: var(--brand-green-dark);
  --green-light: var(--brand-green-light);

  --blue: var(--brand-blue);
  --blue-dark: var(--brand-blue-dark);
  --blue-light: var(--brand-blue-light);

  --text: #1f2933;
  --muted: #5b6873;
  --border: #dfe7eb;
  --background: #ffffff;
  --soft: #f7f9fa;
  --content-shadow: 0 8px 24px rgba(31, 47, 66, 0.06);
  --feature-shadow: 0 12px 32px rgba(31, 41, 51, 0.08);

  /* Shared button styling: keeps the established LymphAware colours while
     making actions feel more consistent and polished. */
  --button-primary: var(--brand-green);
  --button-primary-top: var(--brand-green-action-top);
  --button-primary-hover: var(--brand-green-dark);
  --button-focus-ring: rgba(0, 83, 183, 0.22);
  --button-shadow-rest: 0 3px 9px rgba(31, 47, 66, 0.12);
  --button-shadow: 0 7px 16px rgba(31, 47, 66, 0.14);
  --button-radius: 10px;

  /* Shared customer form controls */
  --field-border: #cbd5e1;
  --field-border-hover: #94a3b8;
  --field-background: #ffffff;
  --field-text: #1f2933;
  --field-placeholder: #7b8996;
  --field-focus: var(--brand-blue);
  --field-focus-ring: rgba(0, 83, 183, 0.16);
  --field-disabled: #f1f5f9;
  --field-radius: 10px;

  /* Shared spacing rhythm */
  --space-section: 72px;
  --space-section-mobile: 52px;
  --space-account-top: 60px;
  --space-account-bottom: 72px;
  --space-account-mobile-top: 36px;
  --space-account-mobile-bottom: 52px;
  --space-page-gutter: 20px;
  --space-page-gutter-mobile: 14px;
  --space-card-gap: 22px;
  --space-card-gap-mobile: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--background);
  line-height: 1.6;
}

/* Keep the internal administration interface unchanged by the public-site
   typography refinement. */
body:has(main.admin-page) {
  font-family: var(--font-legacy);
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

/* HEADER */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.header-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-logo {
  display: block;
  width: 440px;
  max-width: 100%;
  height: auto;
}

.header-wordmark {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
}

.lymph {
  color: var(--blue);
}

.aware {
  color: var(--green);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a:focus,
.main-nav a.active {
  color: var(--blue);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  white-space: nowrap;
  border-radius: var(--button-radius);
  border: 2px solid transparent;
  box-shadow: var(--button-shadow-rest);
  font-size: 1rem !important;
  line-height: 1.2 !important;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--button-shadow);
}

.button:active {
  transform: translateY(0);
  box-shadow: none;
}

.button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--button-focus-ring);
}

.button-primary {
  background: linear-gradient(180deg, var(--button-primary-top), var(--button-primary));
  border-color: var(--button-primary);
  color: white;
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--button-primary-hover);
  border-color: var(--button-primary-hover);
}

.button-secondary {
  border-color: var(--blue);
  color: var(--blue-dark);
  background: #f8fbfe;
}

.button-secondary:hover,
.button-secondary:focus-visible {
  background: var(--blue-light);
  border-color: var(--blue-dark);
  color: var(--blue-dark);
}

.button:disabled,
.button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

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

  .button:hover {
    transform: none;
  }
}

/* HOME HERO */

.hero {
  padding: 88px 0 74px;
  background:
    linear-gradient(
      135deg,
      rgba(36, 122, 36, 0.07),
      rgba(0, 83, 183, 0.05)
    );
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.65fr);
  align-items: center;
  gap: 45px;
}

.hero-logo {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
}

.hero-logo-image {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
}

.hero-wordmark {
  font-size: clamp(3rem, 6vw, 5.4rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -4px;
}

.hero h1 {
  margin: 0 0 24px;
  max-width: 900px;
  font-size: clamp(2.5rem, 3.25vw, 3.45rem);
  line-height: 1.15;
  letter-spacing: -1.5px;
}

.hero h1 span {
  display: block;
}

.hero-copy {
  max-width: 680px;
  margin: 0 0 32px;
  font-size: 1.18rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.concept-card {
  width: 100%;
  max-width: 380px;
  border-radius: 24px;
  padding: 32px;
  background: white;
  border: 1px solid var(--border);
  box-shadow: 0 18px 50px rgba(31, 41, 51, 0.09);
}

.concept-heading {
  margin: 0 0 18px;
  font-size: 1.2rem;
  font-weight: 700;
}

.profile-preview {
  border-radius: 18px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.profile-top {
  padding: 22px;
  background: linear-gradient(135deg, var(--green-light), var(--blue-light));
}

.profile-top strong {
  display: block;
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.profile-top span {
  color: var(--muted);
}

.profile-row {
  padding: 18px 20px;
  border-top: 1px solid var(--border);
}

.profile-row strong {
  display: block;
  margin-bottom: 3px;
}

.profile-row span {
  color: var(--muted);
  font-size: 0.96rem;
}

/* PAGE HERO */

.page-hero {
  padding: 82px 0 70px;
  background: linear-gradient(
    135deg,
    rgba(36, 122, 36, 0.07),
    rgba(0, 83, 183, 0.05)
  );
}

.page-hero-inner {
  max-width: 980px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green-dark);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.page-hero h1 {
  margin: 0 0 22px;
  max-width: 980px;
  font-size: clamp(2.6rem, 4.2vw, 4rem);
  line-height: 1.1;
  letter-spacing: -1.5px;
}

.page-hero p {
  margin: 0;
  max-width: 760px;
  font-size: 1.2rem;
  color: var(--muted);
}

/* CONTENT */

.content-section {
  padding: var(--space-section) 0;
}

.section-heading {
  max-width: 780px;
  margin: 0 auto 44px;
  text-align: center;
}

/* Public information pages follow the site's left-aligned heading system. */
main:not(.admin-page):not(.portal-page) .section-heading {
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}

.section-heading h2 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -1px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.info-card {
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: white;
  box-shadow: var(--content-shadow);
}

.step-number {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  margin-bottom: 20px;
  background: var(--brand-green);
  color: #ffffff;
  font-weight: 800;
}

.steps-grid .info-card:nth-child(even) .step-number {
  background: var(--brand-blue);
}

.info-card h3 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.info-card p {
  margin: 0;
  color: var(--muted);
}

.split-section,
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 54px;
  align-items: start;
}

.copy h2,
.split-copy h2 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -1px;
}

.copy p,
.split-copy p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 1.08rem;
}

.highlight-box {
  border-radius: 20px;
  padding: 34px;
  background: var(--green-light);
  box-shadow: var(--content-shadow);
}

.highlight-box h2,
.highlight-box h3 {
  margin-top: 0;
}

.highlight-box p {
  color: var(--muted);
}

.highlight-box p:last-child {
  margin-bottom: 0;
}

.privacy-section,
.principles-section {
  background: var(--soft);
}

.privacy-grid,
.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.privacy-card,
.principle-card {
  padding: 28px;
  border-radius: 18px;
  background: white;
  border: 1px solid var(--border);
  box-shadow: var(--content-shadow);
}

.privacy-card h3,
.principle-card h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.privacy-card p,
.principle-card p {
  margin: 0;
  color: var(--muted);
}

.trusted-resource-grid .privacy-card {
  display: flex;
  flex-direction: column;
}

.trusted-resource-grid .trusted-resource-action {
  width: 100%;
  margin-top: auto;
  padding-top: 18px;
}

.trusted-resource-grid .trusted-resource-action .button {
  display: inline-flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding-left: 16px;
  padding-right: 16px;
  text-align: center;
  white-space: normal;
}

.mission-box,
.cta-box {
  border-radius: 24px;
  padding: 48px 40px;
  background: linear-gradient(135deg, var(--green-light), var(--blue-light));
  text-align: left;
  box-shadow: var(--content-shadow);
}

.mission-box h2,
.cta-box h2 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -1px;
}

.mission-box p,
.cta-box p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
}

.cta-box .cta-text {
  margin: 0 0 28px;
}

.cta-section {
  padding: var(--space-section) 0;
}

/* FOOTER */

footer {
  border-top: 1px solid var(--border);
  padding: 38px 0 30px;
  background: white;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  align-items: flex-start;
}

.footer-brand {
  max-width: 420px;
}

.footer-logo {
  display: block;
  width: 220px;
  max-width: 100%;
  height: auto;
  margin-bottom: 14px;
}

.footer-brand p {
  margin-bottom: 0;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  font-size: 0.94rem;
}

.footer-note {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.founder-profile {
  margin: 0 0 28px;
  text-align: center;
}

.founder-photo {
  width: clamp(150px, 42vw, 190px);
  height: clamp(150px, 42vw, 190px);
  margin: 0 auto;
  border: 5px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 18%;
  box-shadow: 0 10px 24px rgba(31, 41, 51, 0.14);
}

.founder-profile figcaption {
  margin-top: 14px;
  line-height: 1.35;
}

.founder-profile figcaption strong,
.founder-profile figcaption span {
  display: block;
}

.founder-profile figcaption strong {
  color: var(--text);
  font-size: 1.12rem;
}

.founder-profile figcaption span {
  margin-top: 2px;
  color: var(--green-dark);
  font-size: 0.98rem;
  font-weight: 700;
}

/* RESPONSIVE */

@media (max-width: 980px) {
  .main-nav {
    display: none;
  }

  .hero-grid,
  .split-section,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    justify-content: flex-start;
  }

  .steps-grid,
  .privacy-grid,
  .principles-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 64px;
  }
}

@media (max-width: 680px) {
  .container {
    width: min(100% - 28px, 1180px);
  }

  .header-inner {
    min-height: 74px;
    gap: 12px;
  }

  .header-logo {
    width: 300px;
    max-width: calc(100vw - 150px);
    height: auto;
  }

  .header-wordmark {
    font-size: 1.45rem;
  }

  .header-actions .button-secondary {
    display: none;
  }

  .header-actions .button {
    min-height: 44px;
    padding: 0 14px;
    font-size: 1rem !important;
  }

  .hero {
    padding: 52px 0 58px;
  }

  .hero-logo {
    margin-bottom: 24px;
  }

  .hero-logo-image {
    width: 100%;
    max-width: 560px;
    height: auto;
  }

  .hero-wordmark {
    font-size: clamp(2.6rem, 11vw, 4rem);
    letter-spacing: -2px;
  }

  .hero h1 {
    font-size: 2.4rem;
  }

  .hero h1 span {
    display: inline;
  }

  .hero-copy {
    font-size: 1.06rem;
  }

  .page-hero {
    padding: 58px 0 54px;
  }

  .content-section {
    padding: var(--space-section-mobile) 0;
  }

  .footer-grid {
    flex-direction: column;
  }
}

/* MOBILE NAVIGATION */

.mobile-menu {
  display: none;
  position: relative;
}

.mobile-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid var(--blue);
  border-radius: 9px;
  background: white;
  color: var(--blue);
  font-size: 1rem !important;
  line-height: 1.2 !important;
  font-weight: 700;
  cursor: pointer;
}

.mobile-menu summary::-webkit-details-marker {
  display: none;
}

.mobile-menu summary::before {
  content: "☰";
  margin-right: 8px;
  font-size: 1.1rem;
}

.mobile-menu[open] summary::before {
  content: "×";
}

.mobile-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 200;
  width: calc(100vw - 32px);
  max-width: 420px;
  max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: white;
  box-shadow: 0 14px 35px rgba(31, 41, 51, 0.14);
}

.mobile-menu-panel a {
  display: block;
  padding: 11px 12px;
  border-radius: 8px;
  font-weight: 600;
}

.mobile-menu-panel a:hover,
.mobile-menu-panel a:focus {
  background: var(--soft);
  color: var(--blue);
}

.mobile-menu-panel .mobile-primary {
  margin-top: 8px;
  background: #247a24;
  color: white;
  text-align: center;
}

.mobile-menu-panel .mobile-primary:hover,
.mobile-menu-panel .mobile-primary:focus {
  background: #247a24;
  color: white;
}

/* MOBILE REFINEMENTS */

@media (max-width: 680px) {

  .main-nav,
  .header-actions {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  .header-inner {
    min-height: 74px;
  }

  .content-section {
    padding: var(--space-section-mobile) 0;
  }

  .section-heading {
    margin-bottom: 32px;
  }

  .section-heading h2,
  .copy h2,
  .split-copy h2 {
    font-size: 2rem;
    line-height: 1.15;
    letter-spacing: -0.6px;
  }

  .mission-box,
  .cta-box {
    padding: 38px 22px;
  }

  .mission-box h2,
  .cta-box h2 {
    font-size: 2rem;
    line-height: 1.2;
    letter-spacing: -0.6px;
  }
}

/* =========================================================
   ACCOUNT AREA CONSISTENCY
   Portal, Profile and Preview retain their own actions but use the same
   visual header system and heading scale as the rest of LymphAware.
   ========================================================= */

.portal-header .header-inner,
.profile-site-header .header-inner,
.preview-header .header-inner {
  width: min(1180px, calc(100% - 40px)) !important;
  max-width: 1180px !important;
  min-height: 92px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.portal-header .header-logo,
.profile-site-header .header-logo,
.preview-header .header-logo {
  width: 440px !important;
  max-width: 100% !important;
  height: auto !important;
}

.portal-header .header-actions,
.profile-site-header .header-actions,
.preview-header .header-actions {
  display: flex !important;
  align-items: center !important;
  margin-left: auto !important;
}

.portal-header .header-actions .button,
.profile-site-header .header-actions .button,
.preview-header .header-actions .button {
  min-height: 46px !important;
  padding: 0 20px !important;
  border-radius: 9px !important;
  white-space: nowrap !important;
  font-size: 1rem !important;
}

.portal-welcome h1,
.profile-header h1,
.preview-heading h1 {
  font-size: clamp(2rem, 3vw, 2.8rem) !important;
  line-height: 1.15 !important;
  letter-spacing: -1px !important;
}

.portal-option,
.profile-card {
  box-shadow: var(--content-shadow);
}

.patient-profile-preview {
  box-shadow: var(--feature-shadow) !important;
}

/* Scanner and preview profile logo: one centred size. */
.public-brand-logo {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

@media (max-width: 680px) {
  .portal-header .header-inner,
  .profile-site-header .header-inner,
  .preview-header .header-inner {
    width: min(100% - 28px, 1180px) !important;
    min-height: 74px !important;
    gap: 12px !important;
  }

  .portal-header .header-logo,
  .profile-site-header .header-logo,
  .preview-header .header-logo {
    width: 300px !important;
    max-width: calc(100vw - 150px) !important;
  }

  .portal-header .header-actions,
  .profile-site-header .header-actions,
  .preview-header .header-actions {
    display: flex !important;
  }

  .portal-header .header-actions .button,
  .profile-site-header .header-actions .button,
  .preview-header .header-actions .button,
  .portal-header .header-actions .button-secondary,
  .profile-site-header .header-actions .button-secondary,
  .preview-header .header-actions .button-secondary {
    display: inline-flex !important;
    min-height: 44px !important;
    padding: 0 14px !important;
    font-size: 1rem !important;
  }

  .portal-welcome h1,
  .profile-header h1,
  .preview-heading h1 {
    font-size: 2rem !important;
  }

  .public-brand-logo {
    max-width: 100% !important;
  }
}

/* =========================================================
   ADMIN AREA ISOLATION
   Admin pages are deliberately self-contained. The LymphAware mark remains
   visible as branding, but it is not a link to the public website.
   ========================================================= */

body:has(main.admin-page) .header-brand {
  display: none !important;
}

body:has(main.admin-page) .site-header .header-inner::before {
  content: "";
  display: block;
  flex: 0 1 390px;
  width: 390px;
  max-width: calc(100% - 170px);
  height: 72px;
  background: url("/assets/brand/LymphAwareID_Logo_20260921.svg") left center / contain no-repeat;
}

@media (max-width: 680px) {
  body:has(main.admin-page) .site-header .header-inner::before {
    flex-basis: 300px;
    width: 300px;
    max-width: calc(100vw - 140px);
    height: 58px;
  }

  body:has(main.admin-page) .header-actions {
    display: flex !important;
  }

  body:has(main.admin-page) .header-actions .button,
  body:has(main.admin-page) .header-actions .button-secondary {
    display: inline-flex !important;
  }
}

/* =========================================================
   CURRENT VISUAL REFINEMENTS
   Welcome letter spacing/punctuation and full-width profile branding.
   ========================================================= */

.letter-logo {
  margin-bottom: 18px !important;
}

.letter-motto span::after {
  content: ".";
}

main.page .brand {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

main.page .brand img {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.home-page .hero-phone-screen::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  width: 100%;
  height: 9%;
  pointer-events: none;
  background:
    #f5f8f7
    url("/assets/brand/LymphAwareID_Logo_20260921.svg")
    center center / 94% auto
    no-repeat;
}

/* LYMPHAWARE DESKTOP HEADER ACTION SIZE */
/* Keep the top-right customer/admin header action consistent between pages. */
@media (min-width: 901px) {
  .site-header .header-actions > .button {
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
    min-height: 56px !important;
    padding: 0 18px !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    white-space: nowrap !important;
  }
}


/* =========================================================
   CUSTOMER-FACING BUTTON CONSISTENCY
   Keep public, sign-up, portal, profile and preview actions visually
   consistent without changing specialist admin workflow controls.
   ========================================================= */

:where(.home-page, body:has(.secondary-header), body:has(main.page)) .button:not(.button-danger) {
  min-height: 48px !important;
  padding: 0 22px !important;
  border-radius: var(--button-radius) !important;
  box-shadow: var(--button-shadow-rest) !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease !important;
}

:where(.home-page, body:has(.secondary-header), body:has(main.page)) .button:not(.button-danger):hover {
  transform: translateY(-1px);
  box-shadow: var(--button-shadow) !important;
}

:where(.home-page, body:has(.secondary-header), body:has(main.page)) .button:not(.button-danger):active {
  transform: translateY(0);
  box-shadow: var(--button-shadow-rest) !important;
}

:where(.home-page, body:has(.secondary-header), body:has(main.page)) .button:not(.button-danger):focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 4px var(--button-focus-ring) !important;
}

:where(.home-page, body:has(.secondary-header), body:has(main.page)) .button-primary {
  background: linear-gradient(180deg, var(--button-primary-top), var(--button-primary)) !important;
  border-color: var(--button-primary) !important;
  color: #ffffff !important;
}

:where(.home-page, body:has(.secondary-header), body:has(main.page)) .button-primary:hover,
:where(.home-page, body:has(.secondary-header), body:has(main.page)) .button-primary:focus-visible {
  background: var(--button-primary-hover) !important;
  border-color: var(--button-primary-hover) !important;
  color: #ffffff !important;
}

:where(.home-page, body:has(.secondary-header), body:has(main.page)) .button-secondary {
  background: #f8fbfe !important;
  border-color: var(--blue) !important;
  color: var(--blue-dark) !important;
}

:where(.home-page, body:has(.secondary-header), body:has(main.page)) .button-secondary:hover,
:where(.home-page, body:has(.secondary-header), body:has(main.page)) .button-secondary:focus-visible {
  background: var(--blue-light) !important;
  border-color: var(--blue-dark) !important;
  color: var(--blue-dark) !important;
}

/* The homepage account button is intentionally a primary action even though
   it predates the shared button-primary class. */
.home-page .home-account-button {
  background: linear-gradient(180deg, var(--button-primary-top), var(--button-primary)) !important;
  border: 2px solid var(--button-primary) !important;
  color: #ffffff !important;
  box-shadow: var(--button-shadow-rest) !important;
}

.home-page .home-account-button:hover,
.home-page .home-account-button:focus-visible {
  background: var(--button-primary-hover) !important;
  border-color: var(--button-primary-hover) !important;
  color: #ffffff !important;
}

/* Match the primary action inside the mobile menu to the same visual system. */
.mobile-menu-panel .mobile-primary {
  border-radius: var(--button-radius) !important;
  background: linear-gradient(180deg, var(--button-primary-top), var(--button-primary)) !important;
  box-shadow: var(--button-shadow-rest);
  color: #ffffff !important;
  font-weight: 700;
}

.mobile-menu-panel .mobile-primary:hover,
.mobile-menu-panel .mobile-primary:focus-visible {
  background: var(--button-primary-hover) !important;
  color: #ffffff !important;
}

/* Sign out remains secondary rather than competing with the main CTA. */
.home-page .mobile-sign-out-button {
  border: 2px solid var(--blue) !important;
  border-radius: var(--button-radius) !important;
  background: #f8fbfe !important;
  box-shadow: var(--button-shadow-rest);
  color: var(--blue-dark) !important;
}

.home-page .mobile-sign-out-button:hover,
.home-page .mobile-sign-out-button:focus-visible {
  background: var(--blue-light) !important;
  border-color: var(--blue-dark) !important;
  outline: none;
  box-shadow: 0 0 0 4px var(--button-focus-ring);
}

@media (max-width: 680px) {
  :where(.home-page, body:has(.secondary-header), body:has(main.page)) .button:not(.button-danger) {
    min-height: 50px !important;
  }

  /* Compact header/navigation actions retain their established geometry. */
  .secondary-header .header-actions > .button,
  .portal-header .header-actions .button,
  .profile-site-header .header-actions .button,
  .preview-header .header-actions .button {
    min-height: 44px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  :where(.home-page, body:has(.secondary-header), body:has(main.page)) .button:not(.button-danger) {
    transition: none !important;
  }

  :where(.home-page, body:has(.secondary-header), body:has(main.page)) .button:not(.button-danger):hover {
    transform: none;
  }
}


/* =========================================================
   CUSTOMER FORM & CONTROL REFINEMENT
   Sign-up, authentication, portal, profile and contact forms.
   ========================================================= */

/* Text fields, selects and textareas.
   Number, file, checkbox and radio controls are deliberately handled
   separately so compact portal controls keep their existing geometry. */
body:has(.secondary-header) main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="number"]),
body:has(.secondary-header) main select,
body:has(.secondary-header) main textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--field-border);
  border-radius: var(--field-radius);
  background: var(--field-background);
  color: var(--field-text);
  font: inherit;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(31, 47, 66, 0.035);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

body:has(.secondary-header) main textarea {
  min-height: 118px;
  resize: vertical;
}

body:has(.secondary-header) main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="number"]):hover,
body:has(.secondary-header) main select:hover,
body:has(.secondary-header) main textarea:hover {
  border-color: var(--field-border-hover);
}

body:has(.secondary-header) main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="number"]):focus,
body:has(.secondary-header) main select:focus,
body:has(.secondary-header) main textarea:focus {
  outline: none;
  border-color: var(--field-focus);
  box-shadow: 0 0 0 4px var(--field-focus-ring);
}

body:has(.secondary-header) main input::placeholder,
body:has(.secondary-header) main textarea::placeholder {
  color: var(--field-placeholder);
  opacity: 1;
}

body:has(.secondary-header) main input:disabled,
body:has(.secondary-header) main select:disabled,
body:has(.secondary-header) main textarea:disabled {
  border-color: #d8e0e7;
  background: var(--field-disabled);
  color: #7a8793;
  cursor: not-allowed;
  opacity: 1;
}

/* Clear, consistent form labels without making compact checkbox copy too bold. */
body:has(.secondary-header) main .form-group > label,
body:has(.secondary-header) main .contact-field > label,
body:has(.secondary-header) main .language-choice > label,
body:has(.secondary-header) main .delivery-choice > label,
body:has(.secondary-header) main .additional-language-box > label {
  margin-bottom: 8px;
  color: #263746;
  font-weight: 750;
}

/* Native checkboxes/radios keep familiar behaviour but use the brand blue. */
.join-page input[type="checkbox"],
.join-page input[type="radio"],
.portal-page input[type="checkbox"],
.portal-page input[type="radio"],
.profile-page input[type="checkbox"],
.profile-page input[type="radio"] {
  accent-color: var(--blue);
}

.join-page input[type="checkbox"]:focus-visible,
.join-page input[type="radio"]:focus-visible,
.portal-page input[type="checkbox"]:focus-visible,
.portal-page input[type="radio"]:focus-visible,
.profile-page input[type="checkbox"]:focus-visible,
.profile-page input[type="radio"]:focus-visible {
  outline: 3px solid var(--field-focus-ring);
  outline-offset: 3px;
}

/* Registration package and term cards: a cleaner selected and keyboard state. */
.join-page .choice-card input:checked + .choice-card-body {
  border-color: var(--blue);
  box-shadow:
    0 0 0 3px var(--field-focus-ring),
    0 10px 24px rgba(31, 47, 66, 0.09);
}

.join-page .choice-card input:focus-visible + .choice-card-body {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--field-focus-ring);
}

/* Portal package/term choices now read clearly as selectable controls. */
.portal-page .package-option,
.portal-page .membership-duration-option,
.profile-page .assistance-option,
.profile-page .information-resource-option {
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.15s ease;
}

.portal-page .package-option:hover,
.portal-page .membership-duration-option:hover,
.profile-page .assistance-option:hover,
.profile-page .information-resource-option:hover {
  border-color: #9ab7c9;
}

.portal-page .package-option:has(input:checked),
.portal-page .membership-duration-option:has(input:checked),
.profile-page .assistance-option:has(input:checked),
.profile-page .information-resource-option:has(input:checked) {
  border-color: var(--blue);
  background: #f2f8fc;
  box-shadow: 0 0 0 3px var(--field-focus-ring);
}

.portal-page .package-option:has(input:focus-visible),
.portal-page .membership-duration-option:has(input:focus-visible),
.profile-page .assistance-option:has(input:focus-visible),
.profile-page .information-resource-option:has(input:focus-visible) {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--field-focus-ring);
}

/* Compact quantity inputs remain compact, but use the same visual language. */
.portal-page .quantity-control input[type="number"] {
  min-height: 46px;
  border: 1px solid var(--field-border);
  border-radius: var(--field-radius);
  background: var(--field-background);
  color: var(--field-text);
  box-shadow: 0 1px 2px rgba(31, 47, 66, 0.035);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.portal-page .quantity-control input[type="number"]:focus {
  outline: none;
  border-color: var(--field-focus);
  box-shadow: 0 0 0 4px var(--field-focus-ring);
}

/* Error states can opt in through aria-invalid without colouring untouched fields. */
body:has(.secondary-header) main [aria-invalid="true"] {
  border-color: #c2413b !important;
  box-shadow: 0 0 0 4px rgba(194, 65, 59, 0.11) !important;
}

@media (max-width: 680px) {
  body:has(.secondary-header) main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="number"]),
  body:has(.secondary-header) main select {
    min-height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body:has(.secondary-header) main input,
  body:has(.secondary-header) main select,
  body:has(.secondary-header) main textarea,
  .join-page .choice-card-body,
  .portal-page .package-option,
  .portal-page .membership-duration-option,
  .profile-page .assistance-option,
  .profile-page .information-resource-option {
    transition: none !important;
  }
}
