/* ============================================
   Global Styles - LifeIndex
   ============================================ */

:root {
  /* Colors - Professional, Authoritative, Timeless */
  --primary: #1e3a5f;
  --primary-dark: #0f1e35;
  --primary-light: #2d5a8c;
  --accent: #2d8659;
  --text-dark: #1a1a1a;
  --text-light: #505050;
  --text-muted: #808080;
  --bg-light: #f5f5f5;
  --bg-white: #ffffff;
  --border-color: #d0d0d0;
  --success: #2d8659;
  --neutral: #606060;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);

  /* Typography */
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-mono: "Courier New", monospace;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 300ms ease-in-out;
  --transition-slow: 500ms ease-in-out;
}

@font-face {
  font-family: "Atkinson";
  src: url("/fonts/atkinson-regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson";
  src: url("/fonts/atkinson-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: "Atkinson", var(--font-sans);
  color: var(--text-dark);
  background-color: var(--bg-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
}

main {
  flex: 1;
}

/* ============================================
   Typography
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

h1 {
  font-size: clamp(2rem, 8vw, 3.5rem);
}

h2 {
  font-size: clamp(1.5rem, 6vw, 2.75rem);
}

h3 {
  font-size: clamp(1.25rem, 4vw, 2rem);
}

.intake-form {
  margin-bottom: 2.5rem;
}
.honeypot {
  display: none;
}
.intake-submit {
  width: 100%;
  margin-top: 1.2rem;
}
.no-wearable {
  font-size: 0.98rem;
  color: #64748b;
  margin-top: 0.7rem;
}
.pdf-forward {
  font-size: 0.98rem;
  color: #64748b;
}

/* ============================================
  Assessment Page Form & Layout
  ============================================ */

.banner {
  border-radius: 8px;
  padding: 1.1rem 1rem;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}
.banner-paid {
  background: #e3f7d7;
  color: #256029;
  border: 1px solid #b6e2a1;
}
.banner-unpaid {
  background: #f3f4f6;
  color: #505050;
  border: 1px solid #e0e7ef;
}
.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1rem;
}
.cta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.cta-primary,
.cta-secondary,
button.cta-primary {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 32px;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s;
}
.cta-primary,
button.cta-primary {
  background: #ffb300;
  color: #1e3a5f;
  border: none;
}
.cta-primary:hover,
button.cta-primary:hover {
  background: #ffd54f;
  color: #1a1a1a;
}
.cta-secondary {
  background: #fff;
  color: #1e3a5f;
  border: 1px solid #cbd5e1;
}
.cta-secondary:hover {
  background: #e0e7ef;
}
.cta-microcopy {
  font-size: 0.98rem;
  color: #cbd5e1;
  margin-bottom: 1.5rem;
}
.form-group {
  margin-bottom: 1.1rem;
}
.form-row {
  display: flex;
  gap: 1rem;
}
.form-row {
  align-items: flex-start;
}
.form-row .form-group {
  flex: 1;
}
.compact-row .form-group {
  min-width: 0;
}
.input-compact {
  padding: 0.45rem;
  font-size: 0.95rem;
}

/* Disabled form visuals for assessment */
fieldset[disabled] {
  opacity: 1; /* keep container opacity so only controls look disabled */
}
fieldset[disabled] input,
fieldset[disabled] select,
fieldset[disabled] textarea {
  background: #f5f7f9;
  color: #6b7280;
  border-color: #e6e9ec;
}
fieldset[disabled] .locked-notice {
  background: #fff7ed;
  border: 1px solid #ffe4b5;
  color: #5b3e00;
  padding: 0.6rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}
fieldset[disabled] .intake-submit,
fieldset[disabled] .intake-submit:disabled {
  background: #d1d5db;
  color: #6b7280;
  cursor: not-allowed;
  box-shadow: none;
}

/* Consent checkbox styling */
.consent-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  justify-content: flex-start;
}
.consent-input {
  margin: 0;
  flex-shrink: 0;
  width: auto; /* Prevent global input 100% stretch */
  min-width: auto;
}
.consent-label {
  cursor: pointer;
  margin: 0;
  white-space: nowrap;
  display: inline-block; /* allow checkbox + text on same line */
}

.units-toggle {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.units-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-weight: 500;
}
.units-option input {
  margin: 0;
}
.units-label {
  font-weight: 600;
  margin-right: 0.5rem;
  color: var(--text-dark);
}

/* CSS-only show/hide of unit sections using radio state */
#units-us:checked ~ form .units-metric {
  display: none !important;
}
#units-us:checked ~ form .units-us {
  display: block !important;
}
#units-metric:checked ~ form .units-us {
  display: none !important;
}
#units-metric:checked ~ form .units-metric {
  display: block !important;
}
label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.3rem;
}
input,
select,
textarea {
  width: 100%;
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 1rem;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #ffb300;
  border-color: #ffb300;
}
.error {
  color: #c00;
  font-size: 0.97rem;
  margin-top: 0.2rem;
}
section {
  margin-bottom: 2.5rem;
}
h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #1e3a5f;
}
ul,
ol {
  margin-left: 1.2em;
}
.footer-small {
  text-align: center;
  font-size: 0.95rem;
  color: #64748b;
  margin-top: 2rem;
  margin-bottom: 1rem;
}
@media (max-width: 700px) {
  .container {
    max-width: 98vw;
    padding: 0 0.5rem;
  }
  .cta-row {
    flex-direction: column;
    gap: 0.7rem;
  }
}

/* Header styles (mirrors src/components/Header.astro) */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-dark);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  color: var(--text-dark);
  font-weight: 700;
}
.nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}
.nav a {
  color: var(--text-dark);
  text-decoration: none;
}
@media (max-width: 768px) {
  .header {
    padding: 0.75rem 0;
  }
  .header-container {
    padding: 0 1rem;
    gap: 0.5rem;
  }
  .nav {
    gap: 1rem;
    font-size: 0.9rem;
  }
}

/* Logo styles (from Logo.astro) */
.logo-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  user-select: none;
  background: transparent;
}
.logo-image {
  flex-shrink: 0;
  background: transparent;
}
.logo-text {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #000000;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, sans-serif;
}
.logo-text-accent {
  font-weight: 700;
  color: var(--primary-light);
}
.text-base {
  font-size: 1rem;
}
.text-xl {
  font-size: 1.25rem;
}
.text-2xl {
  font-size: 1.5rem;
}

/* Nav link styles to match HeaderLink.astro */
.nav a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #505050;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.5rem 0.25rem;
  min-height: 44px;
}
.nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: width 0.3s ease;
}
.nav a:hover {
  color: var(--primary);
}
.nav a:hover::after {
  width: 100%;
}

/* Footer styles (mirrors src/components/Footer.astro) */
.footer {
  background: var(--primary-dark);
  color: #d0d0d0;
  padding: 3rem 0 1rem;
  margin-top: 4rem;
  border-top: 1px solid var(--border-color);
}
.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-section h3 {
  color: white;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.footer-section p {
  line-height: 1.6;
  color: rgba(208, 208, 208, 0.8);
  margin: 0;
  font-weight: 400;
}
.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-section li {
  margin-bottom: 0.75rem;
}
.footer-section a {
  color: rgba(208, 208, 208, 0.8);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}
.footer-section a::before {
  content: "→";
  margin-right: 0.5rem;
  opacity: 0;
  transition: all 0.3s ease;
}
.footer-section a:hover {
  color: white;
}
.footer-section a:hover::before {
  opacity: 1;
  margin-right: 0.75rem;
}
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 2rem 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: rgba(208, 208, 208, 0.6);
  font-size: 0.85rem;
  line-height: 1.4;
}
.footer-bottom p {
  margin: 0;
}
@media (max-width: 768px) {
  .footer-container {
    padding: 0 1rem;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .footer-bottom {
    padding: 1.5rem 1rem 0;
  }
}

/* Intake form groups and hint styles */
.field-group {
  background: #fff;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid #eef2f6;
}
.group-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}
/* Place hint next to the label text (top-right of the label) */
.form-group {
  position: relative;
}
/* keep the label inline so the hint sits directly after the label text */
label {
  display: inline-block;
  position: static;
}
.hint {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 50%;
  background: #e6eef8;
  color: var(--primary);
  text-align: center;
  font-weight: 700;
  cursor: help;
  font-size: 0.75rem;
  position: relative;
  top: -4px;
  margin-left: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
/* give inputs a little extra room but not too much */
input,
select,
textarea {
  padding-right: 0.6rem;
}

@media (max-width: 700px) {
  .form-row {
    flex-direction: column;
  }
}

/* Match homepage hero title styling for page titles */
.page-title {
  font-size: 2.25rem;
  margin-bottom: 0.6rem;
  font-weight: 700;
  color: var(--primary);
  text-shadow: none;
}
.lead {
  font-size: 1.05rem;
  margin-bottom: 1rem;
  color: #475569;
}

.form-legend {
  font-size: 0.95rem;
  color: #475569;
  margin-bottom: 0.75rem;
}
.encouraged {
  display: inline-block;
  background: #eef6f1;
  color: var(--accent);
  border-radius: 6px;
  padding: 0.08rem 0.4rem;
  font-size: 0.75rem;
  margin-left: 0.5rem;
  font-weight: 600;
}
