/*
 * Gibas Associates VA pages: shared styles for newsletter.html and index.html.
 *
 * Brand tokens. Navy and accent are sampled from the logo file; coral is the
 * call-to-action colour from gibasassociates.com.
 */
:root {
  --navy: #0E4A6E;
  --navy-deep: #0A3652;
  --accent: #2C8DC9;
  --ink: #10212E;
  --slate: #4A6380;
  --coral: #F76C5E;
  --coral-hover: #F2584A;
  --line: #DCE4EC;
  --field-line: #7D93AA;
  --mist: #F4F7FA;
  --focus: #1B7F99;
  --danger: #B3261E;

  --radius-field: 12px;
  --radius-card: 24px;
  --radius-pill: 999px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font: 400 1rem/1.6 "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-text-size-adjust: 100%;
}

h1, h2 {
  margin: 0;
  font-family: Montserrat, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--navy);
  letter-spacing: -0.022em;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap { max-width: 37rem; margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-head { border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; padding-block: 0.875rem; }
.site-head img { display: block; width: 148px; height: auto; }
@media (min-width: 30rem) { .site-head img { width: 168px; } }

main { padding-bottom: 3rem; }

/* Hero: team photo, headline, intro */
.hero { padding-top: 1.5rem; }
.hero-photo {
  display: block;
  width: 100%;
  /* height:auto is required, or the img height attribute wins and the crop goes tall. */
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center 36%;
  border-radius: var(--radius-card);
  background: var(--mist);
  box-shadow: 0 10px 30px rgba(16, 33, 46, 0.10);
  animation: photoReveal 950ms cubic-bezier(0.55, 0, 0.3, 1) both;
}

/* The photo lifts into view behind a mask and settles out of a slight zoom. */
@keyframes photoReveal {
  from { clip-path: inset(100% 0 0 0 round var(--radius-card)); transform: scale(1.06); }
  to { clip-path: inset(0 0 0 0 round var(--radius-card)); transform: scale(1); }
}
@media (min-width: 30rem) { .hero-photo { aspect-ratio: 16 / 8.5; } }

h1 {
  margin: 1.5rem 0 0;
  font-size: clamp(2.125rem, 8.6vw, 3.125rem);
  line-height: 1.03;
  font-weight: 700;
}
.intro { margin-top: 1rem; }
.intro p { margin: 0 0 1rem; font-size: 1.0625rem; color: var(--slate); }
.note {
  margin: 0;
  padding: 0.875rem 1.125rem;
  color: var(--ink);
  background: var(--mist);
  border-left: 4px solid var(--coral);
  border-radius: 0 12px 12px 0;
}

/* Progress: a pill label over five segments, one per step */
.progress { display: none; margin-top: 2.25rem; }
.js .progress { display: block; }
/* Status pill: step count, a separator and the section name, as the reference's header pill does. */
.pill {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4375rem;
  margin: 0;
  padding: 0.4375rem 0.9375rem 0.4375rem 0.75rem;
  font-family: Montserrat, system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  background: var(--navy);
  border-radius: var(--radius-pill);
  transition: opacity 130ms ease-out;
}
.pill.is-changing { opacity: 0.3; }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.pill-sep { opacity: 0.55; }

.bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0.75rem 0 0; padding: 0; list-style: none; }
.bars li { height: 4px; border-radius: var(--radius-pill); background: var(--line); transition: background-color 200ms; }
.bars li.is-done { background: var(--accent); }
.bars li.is-current { background: var(--coral); }

/* Steps. Without JavaScript every step shows and the form posts as one long page. */
.js .step { display: none; }
.js .step.is-active { display: block; animation: rise 220ms cubic-bezier(0.2, 0.7, 0.3, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

h2 {
  margin: 2rem 0 0.625rem;
  font-size: clamp(1.625rem, 6.2vw, 2.125rem);
  line-height: 1.1;
  font-weight: 700;
  outline: none;
}
.lead { margin: 0 0 2rem; color: var(--slate); }
.step + .step { margin-top: 3rem; }
.js .step + .step { margin-top: 0; }

/* Fields */
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.field { margin: 0 0 1.75rem; }
.label { display: block; margin: 0 0 0.4375rem; padding: 0; font-weight: 600; }
.req { color: var(--danger); }
.hint { margin: 0 0 0.625rem; font-size: 0.9375rem; color: var(--slate); }

.input {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.6875rem 0.875rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--field-line);
  border-radius: var(--radius-field);
  transition: border-color 120ms;
}
textarea.input { min-height: 7.5rem; resize: vertical; line-height: 1.55; }
.input:hover { border-color: var(--slate); }
.input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.error { margin: 0.4375rem 0 0; font-size: 0.9375rem; font-weight: 600; color: var(--danger); }

select.input {
  appearance: none;
  padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%234A6380' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}
select.input:invalid { color: var(--slate); }

/* Leave room for the sticky button bar when a field is scrolled into view. */
.input, .file, .chip input { scroll-margin-top: 1rem; scroll-margin-bottom: 7rem; }

.file {
  display: block;
  width: 100%;
  padding: 0.875rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--mist);
  border: 1.5px dashed var(--field-line);
  border-radius: var(--radius-field);
}
.file::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.5rem 0.9375rem;
  font: 600 0.875rem Montserrat, system-ui, sans-serif;
  color: var(--navy);
  background: #fff;
  border: 1.5px solid var(--navy);
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.file:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Tappable choices: job types and Yes/No */
.chips { display: flex; flex-wrap: wrap; gap: 0.625rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  line-height: 1.3;
  background: #fff;
  border: 1.5px solid var(--field-line);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 130ms, border-color 130ms, color 130ms;
}
.chip span:hover { border-color: var(--navy); }
.chip input:checked + span { color: #fff; background: var(--navy); border-color: var(--navy); }
.chip input:checked + span::before { content: "\2713"; font-weight: 700; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.sub { margin: 1.25rem 0 0; }

/*
 * Peach glow that tracks the pointer across the job chips. Pointer devices only:
 * most of this audience is on a phone and has no cursor at all.
 * Skipped on a chosen chip, where it would wash out the white-on-navy text.
 */
@media (hover: hover) and (pointer: fine) {
  .chip span { position: relative; isolation: isolate; overflow: hidden; }
  .chip span::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    /* Fills the whole chip, brightest where the pointer is. */
    background: radial-gradient(circle farthest-corner at var(--mx, 50%) var(--my, 50%),
                rgba(251, 183, 163, 1) 0%, rgba(251, 183, 163, 0.7) 45%, rgba(251, 183, 163, 0.5) 100%);
    opacity: 0;
    transition: opacity 220ms ease-out;
    pointer-events: none;
  }
  .chip input:not(:checked) + span:hover { border-color: var(--coral); }
  .chip input:not(:checked) + span:hover::after { opacity: 1; }
}

.check { display: flex; align-items: center; gap: 0.625rem; min-height: 2.75rem; margin-top: 0.25rem; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--navy); }

.row { display: grid; gap: 0 1.25rem; }
@media (min-width: 32.5rem) { .row { grid-template-columns: 1fr 1fr; align-items: start; } }

.fineprint { margin: 0 0 1rem; font-size: 0.9375rem; color: var(--slate); }

/* Actions: stay in reach at the bottom of the screen on a phone */
.actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 0.875rem 0 1rem;
  background: #fff;
  border-top: 1px solid var(--line);
}
.actions-plain { position: static; border-top: 0; padding-top: 0; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.5rem 1.5rem;
  font: 700 1rem Montserrat, system-ui, sans-serif;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 130ms;
}
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn-primary { flex: 1; color: var(--ink); background: var(--coral); border: 1.5px solid var(--coral); }
.btn-primary:hover { background: var(--coral-hover); border-color: var(--coral-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-back { color: var(--navy); background: #fff; border: 1.5px solid var(--navy); }
.btn-back:hover { background: var(--mist); }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Thank-you */
.done { padding-top: 2rem; }
.done-top { display: flex; flex-direction: column; align-items: flex-start; gap: 1.5rem; }
.done-text { flex: 1 1 auto; min-width: 0; }
.done h2 { margin-top: 0; }
.done p { margin: 1rem 0 0; }
/* She points left, so on a phone she sits to the right, under the message she points at. */
.done-photo {
  flex: 0 0 auto;
  width: 62%;
  max-width: 240px;
  height: auto;
  align-self: flex-end;
  border-radius: var(--radius-card);
  background: var(--mist);
  box-shadow: 0 10px 30px rgba(16, 33, 46, 0.10);
}
@media (min-width: 30rem) {
  .done-top { flex-direction: row; gap: 1.75rem; }
  .done-photo { width: 44%; max-width: 260px; align-self: auto; }
}
.proto { margin: 1.75rem 0 0; padding: 0.875rem 1.125rem; font-size: 0.9375rem; background: var(--mist); border: 1.5px dashed var(--field-line); border-radius: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
