/* ==========================================
   MSR Digital Access – Form Styles
   Corrected for contactForm.php
   ========================================== */

/* ------------------------------------------------
   SECTION LAYOUT
   <section class="container grid grid-2">
   ------------------------------------------------ */

/* Mobile-first: stacked articles */
.container.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

/* Tablet & desktop: side by side */
@media (min-width: 768px) {
  .container.grid.grid-2 {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: start;
  }
}

/* Optional wider desktop balance */
@media (min-width: 1024px) {
  .container.grid.grid-2 {
    grid-template-columns: 3fr 2fr;
  }
}

/* Ensure articles size to content */
.container.grid > article {
  height: fit-content;
}

/* ------------------------------------------------
   FORM CONTAINER (inside article.card)
   ------------------------------------------------ */

.form-container {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1rem;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------
   BASE FORM STRUCTURE
   ------------------------------------------------ */

form {
  display: grid;
  gap: 1rem;
}

label {
  font-weight: 600;
}

/* ------------------------------------------------
   INPUTS
   ------------------------------------------------ */

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

textarea {
  min-height: 6rem;
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: var(--focus-width) solid var(--focus-color);
  outline-offset: var(--focus-offset);
}

/* ------------------------------------------------
   FIELDSETS & LEGENDS (GDS-aligned)
   ------------------------------------------------ */

serviccs-group {
  padding: 1.5rem 1.25rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 16px;
  background: var(--color-muted);

  outline: 2px solid rgba(145, 143, 146, 0.486);
  outline-offset: 6px;   /* creates the “ring” */
}


legend {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  max-width: 65ch;
  white-space: normal;
  padding: 0 0.5rem;
}

/* .services-group {
  position: relative;
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: 
    0 0 0 2px rgba(55, 5, 86, 0.25),
    0 0 0 6px rgba(55, 5, 86, 0.08);
  background: var(--color-surface);
} */



/* ------------------------------------------------
   CHECKBOX GROUP
   (matches .checkbox-grid in your markup)
   ------------------------------------------------ */

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr; /* mobile */
  gap: 0.6rem 1.2rem;
  width: 100%;
}

/* Checkbox item (label wraps input + text) */
.checkbox-grid label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
}

/* Checkbox control */
.checkbox-grid input[type="checkbox"] {
  margin-top: 0.25rem;
  transform: scale(1.3);
  accent-color: var(--color-primary);
  flex-shrink: 0;
}

/* Checkbox text */
.checkbox-grid span {
  font-size: 1rem;
  line-height: 1.4;
}

/* Focus handling (GDS-style) */
.checkbox-grid label:focus-within {
  outline: 3px solid var(--color-secondary);
  outline-offset: 3px;
  background: rgba(10, 81, 139, 0.08);
}

/* Tablet: two columns */
@media (min-width: 640px) {
  .checkbox-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Desktop: three columns */
@media (min-width: 960px) {
  .checkbox-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ------------------------------------------------
   FORM ACTIONS
   ------------------------------------------------ */

.form-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* ------------------------------------------------
   ERROR MESSAGES (GDS-compatible)
   ------------------------------------------------ */

.error-message {
  color: #a40000;
  font-weight: 600;
  margin-top: 0.25rem;
}

/* ------------------------------------------------
   REDUCED MOTION
   ------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
