/* ============================================
   MSR Digital Access — Unified Stylesheet
============================================ */

/* Root colors and variables */
:root {
  --color-primary: #370556;   /* Deep purple */
  --color-secondary: #0a518b; /* Sky blue */
  --color-accent1: #C7210F;   /* Coral */
  --color-accent2: #FFCA28;   /* Sunny yellow */
  --color-accent3: #028578;   /* Teal */
  --color-border-strong: #222;/* Borders */
  --color-bg: #FAFAFA;        /* Light background */
  --color-surface: #FFFFFF;   /* Cards */
  --color-text: #212121;      /* Body text */
  --color-muted: #555555;     /* Secondary text */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0,0,0,0.08);
  --shadow-sm: 0 4px 16px rgba(0,0,0,0.08);
  --container: 1300px;
}

/* Global layout */
html { scroll-behavior: smooth; }
body {margin: 0;background: var(--color-bg);color: var(--color-text);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}
.container { max-width: var(--container); margin-inline: auto; padding: 0 1.25rem; }

/* Skip link */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-200%);
  padding: 0.5rem 0.75rem;
  background: var(--color-secondary);
  color: #FFF;
  border-radius: 8px;
  z-index: 1000;
}

.skip-link:focus { transform: none; }

/* Header */
header {
  color: #fff;
  background:
    radial-gradient(1200px 300px at 80% -50%, rgba(255, 202, 40, 0.25), rgba(255,255,255,0) 60%),
    linear-gradient(135deg, var(--color-primary), var(--color-secondary));
}
.topbar { padding:0.5rem 0; font-size:0.95rem; opacity:0.95; }
nav { display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:1rem 0 1.25rem; }
.brand { display:flex; align-items:center; gap:0.75rem; color:#fff; text-decoration:none; }
.logo {
  width:40px; height:40px; border-radius:12px;
  background: conic-gradient(from 200deg, var(--color-accent1), var(--color-secondary), var(--color-primary));
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.25), var(--shadow-sm);
}
.brand span { font-weight:800; font-size:1.1rem; letter-spacing:.2px; }
/* -- FIX: Removing duplicate .menu gap property; using 0.75rem for consistency */
.menu { display:flex; gap:0.75rem; flex-wrap:wrap; }
.menu a {
  color:#fff;
  text-decoration-line: underline;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.6em;
  text-decoration-skip-ink: auto;
  outline: none;
  border-radius: 0.375rem;
  font-weight:500;
  padding:0.5rem 0.5rem;
  transition: text-decoration-thickness 120ms ease;
}
.menu a:hover { text-decoration-thickness: 0.16em; outline: auto; }
.menu a:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.menu .cta { background:#fff; color:var(--color-primary); }

/* Page intro */
.hero { padding: 3rem 0 2rem; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 2.6rem); line-height:1.1; margin: 0 0 .5rem; }
.hero p { margin: 0; color: #FFF; max-width: 62ch; text-shadow: 0 1px 2px rgba(0,0,0,.25); }

/* Content sections */
main section { padding: 2rem 0; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); margin: 0 0 0.75rem; }
.section-lead { color: var(--color-muted); margin-bottom: 1.25rem; }
ul li.no-dot { list-style-type: none !important;}
ul li.no-dot2 { list-style-type: none !important; margin-top: 2rem;}

/* Scope paragraph spacing to the form only */
.form-container p {
  margin-top: 0.4em;
  margin-bottom: 0.4em;
  margin-left: 2.2em;
}

/* Grid + Cards */
.grid { display:grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1.1fr .9fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--color-surface);
  border: 1px solid #eee;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

/* Form */
form { display:grid; gap: 0.85rem; }
label { font-weight: 700; }

.form-container {
  max-width: 650px;
  width: 100%;
  margin: 2em auto;
  padding: 1em 0.5em;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 10px #eee;
  box-sizing: border-box;
}

.form-container label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.4em;
  font-size: 1em;
}

.form-container small,
.form-container i {
  font-weight: normal;
  font-size: 0.80em;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="file"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 2px solid #e7e7e7;
  border-radius: 7px;
  padding: 0.7rem 0.8rem;
  background: #fff;
  font-size: 1em;
  display: block;
}

textarea { resize: vertical; min-height: 5em; }

/* Utilities for use anywhere (including inside the form when needed) */
p.thin { margin: 0.2em 0 0.2em 2.3em; }
p.thin1 { margin: 0.2em 0 0 0.3em; }

.emphasis-note { color: var(--color-muted); font-size: 0.95em; font-style: italic; }

/* Buttons */
.btn { display:inline-flex; align-items:center; gap:0.5rem; border-radius:12px; padding:0.85rem 1.1rem; font-weight:700; text-decoration:none; cursor:pointer; border:0; }
.btn-primary { background: var(--color-accent1); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary { background: var(--color-accent2); color:#212121; }
.actions { display:flex; gap:0.75rem; flex-wrap:wrap; }

/* Error summary */
#error-summary[hidden] { display:none; }
#error-summary { background:#FFF3CC; border:1px solid #E6CD6A; color:#473F09; border-radius:12px; padding:1rem; }
#error-summary h2 { margin-top:0; font-size:1.1rem; }

/* Footer */
.cta-band { background: linear-gradient(135deg, var(--color-accent3), var(--color-secondary)); color:#fff; border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
footer { background:#111; color:#ddd; padding:2rem 0; }
footer a { color:#fff; text-decoration:none; }

/* Accessibility helpers */
:focus-visible { outline: 3px solid var(--color-accent2); outline-offset: 3px; border-radius: 10px; }

/* ========= Checkbox Grid (merged & improved) ========= */
/* ======================================================*/
fieldset {
  border: 1px solid #888;
  padding: 0.75em;
  border-radius: 4px;
  min-width: 0;
  width: 100%;
  margin-bottom: 1em;
  box-sizing: border-box;
}
legend {
  padding: 0 0.25rem;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  width: 100%;
}


.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  border: 1.5px solid var(--color-border-strong);
  padding: 0.8rem;
  border-radius: 7px;
  width: 100%;
  max-width: 95%;
  height: auto;
}
.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  cursor: pointer;
}
.checkbox-grid input[type="checkbox"] {
  transform: scale(1.4);
  margin: 0.5em;
  accent-color: #250924;
  cursor: pointer;
}
.checkbox-grid input[type="checkbox"]:focus-visible + span,
.checkbox-grid label:focus-within {
  outline: 3px solid var(--color-secondary);
  outline-offset: 0.5em;
  border-radius: 1em;
}

/* ================= Responsive columns ================= */
@media (max-width: 800px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .checkbox-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .checkbox-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ========== Fieldset & Legend Base & Mobile Fixes ========== */
/* =========================================================== */
fieldset {
  border: 1px solid #888;
  padding: 0.5em;
  border-radius: 3px;
  width: 100%;
  margin-bottom: 1em;
  overflow-wrap: inherit;
  box-sizing: border-box;
}
legend {
  padding: 0.2rem;
  font-weight: 600;
  /* white-space: normal; */
  overflow-wrap: anywhere;
  width: 80%;
}
/* ========== Responsive fieldset for mobile ========== */
@media (max-width: 800px) {
  #services-group,
  .services-group {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
    overflow-wrap: anywhere;
  }
  #services-group legend,
  .services-group legend {
    display: block !important;
    width: 95% !important;
    height: auto;
    max-height: none !important;    
    align-items: center;
    margin-bottom: 0.5em !important;
    /* white-space: normal !important; */
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    font-size: 1.1em !important;
    clear: both;
  }
  #services-group .checkbox-grid,
  .services-group .checkbox-grid,
  #services-group .checkboxes,
  .services-group .checkboxes {
    display: block !important;
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    clear: both !important;
  }
   #services-group .checkbox-item,
  .services-group .checkbox-item {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 0 .6rem 0 !important;
    min-height: 2.8rem;
    background: transparent !important;
    float: none !important;
    position: static !important;
  }
  #services-group .checkbox-item input[type="checkbox"],
  .services-group .checkbox-item input[type="checkbox"] {
    /* inline-size: 1.2rem !important; */
    /* block-size: 1.2rem !important; */
    margin: 0 .5em 0 0 !important;
    flex: 0 0 auto !important;
  }
  #services-group .checkbox-item span,
  .services-group .checkbox-item span {
    font-size: 1rem !important;
    line-height: 1.3 !important;
    flex: 1 1 auto !important;
  }
}
