/* Palette & type follow the Arete Care site: lavender canvas, deep-teal accents,
   midnight-violet headings, Fredoka display + Public Sans body. */
:root {
  --bg: #f6f1ff;
  --bg-glow: #fbe9ff;
  --surface: #ffffff;
  --ink: #190d39;
  --text: #67656e;
  --muted: #95949c;
  --teal-900: #054e60;
  --teal-500: #00b7cd;
  --teal-100: #d7f5fa;
  --purple-500: #8b6bd1;
  --purple-200: #dbd7fa;
  --border: #c9eef3;
  --field-border: #e3e0ef;
  --danger: #c2354f;
  --danger-bg: #fdeef1;
  --star: #f2b733;
  --radius-lg: 32px;
  --radius: 14px;
  --shadow: 0 20px 50px -25px rgba(25, 13, 57, 0.25);
  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Public Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 500px at 10% -10%, var(--bg-glow), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #eef9fc, transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header ---------- */
.site-header { padding: 22px 0; }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand { display: block; line-height: 0; }
.brand img { width: 120px; height: auto; }

.header-right {
  display: flex;
  align-items: center;
  gap: 32px;
}

/* Round pale-teal icon buttons, as on aretecare.com.au */
.social { display: flex; gap: 6px; }
.social a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--teal-100);
  border: 2px solid var(--border);
  color: var(--teal-900);
  transition: background 0.15s, color 0.15s;
}
.social a:hover { background: var(--teal-900); color: #fff; }
.social svg { width: 18px; height: 18px; fill: currentColor; }

.contact a { color: inherit; text-decoration: none; }
.contact a:hover { color: var(--teal-900); }

.contact {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text);
  font-weight: 400;
}
.contact li { display: flex; align-items: center; gap: 10px; }
.contact svg { width: 14px; height: 14px; fill: var(--purple-200); }

/* ---------- Hero ---------- */
.hero { padding: 28px 0 24px; }

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 400;
}

h1, h2, legend {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 400;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  line-height: 1.1;
}
h1 em { font-style: italic; font-weight: 600; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 3px; text-decoration-color: var(--teal-500); }

.lede { margin: 0 0 12px; font-size: 1.1rem; max-width: 68ch; }
.note { margin: 0; font-size: 0.9rem; color: var(--muted); }
.req { color: var(--danger); font-weight: 500; }

/* ---------- Progress ---------- */
.progress {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.progress-bar {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: var(--purple-200);
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal-500), var(--purple-500));
  transition: width 0.35s ease;
}
.progress-label { font-size: 0.85rem; color: var(--teal-900); font-weight: 500; min-width: 105px; text-align: right; }

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 40px 44px;
  margin-bottom: 48px;
}

.section {
  border: 0;
  margin: 0;
  padding: 0 0 32px;
  min-width: 0;
}
/* Divider drawn as a background: a fieldset border would run through its legend */
.section + .section {
  padding-top: 32px;
  background: linear-gradient(var(--field-border), var(--field-border)) top / 100% 1px no-repeat;
}

/* Floating the legend takes it out of the fieldset border area, so it lays out
   like a normal heading (no line through it, no phantom gap below). */
legend {
  float: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  margin: 0 0 22px;
  font-size: 1.6rem;
  line-height: 1.25;
}
legend + * { clear: both; }
.step {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--teal-100);
  border: 1px solid var(--border);
  color: var(--teal-900);
  font-size: 1rem;
  font-weight: 500;
  flex-shrink: 0;
}

.hint { margin: -8px 0 18px; font-size: 0.92rem; color: var(--muted); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

/* ---------- Fields ---------- */
.field { margin-bottom: 22px; }
/* Keep fields clear of the sticky progress bar when scrolled/focused into view */
.field, .rating { scroll-margin-top: 80px; }
.field:last-child { margin-bottom: 0; }

label, .label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 400;
  font-size: 1rem;
}
label.sub { font-size: 0.85rem; color: var(--text); margin-bottom: 6px; }

input[type="text"],
input[type="date"],
textarea {
  width: 100%;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: #fcfcff;
  border: 1.5px solid var(--field-border);
  border-radius: var(--radius);
  padding: 13px 16px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }

/* Mobile Safari renders date inputs short and centred; normalise them */
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  min-height: 52px;
  text-align: left;
}
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.6; }

input::placeholder, textarea::placeholder { color: #b5b3bd; }

input:hover, textarea:hover { border-color: var(--purple-200); }

input:focus, textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 4px var(--teal-100);
}

input:disabled { opacity: 0.5; cursor: not-allowed; }

.dates { margin-bottom: 10px; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 0;
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
}
.check input { width: 18px; height: 18px; accent-color: var(--teal-900); }

/* Errors */
.field.invalid input,
.field.invalid textarea {
  border-color: var(--danger);
  background: var(--danger-bg);
}
.error-msg {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--danger);
  font-weight: 400;
}

/* ---------- Star ratings ---------- */
.ratings { display: grid; gap: 10px; }

.rating {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "name  stars"
    "value stars"
    "error error";
  align-items: center;
  column-gap: 16px;
  padding: 12px 12px 12px 20px;
  border-radius: 20px;
  background: #faf8ff;
  border: 1.5px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
.rating.invalid { border-color: var(--danger); background: var(--danger-bg); }
.rating-name { grid-area: name; color: var(--ink); font-weight: 400; align-self: end; }
.rating .error-msg { grid-area: error; margin-top: 6px; }

.stars {
  grid-area: stars;
  position: relative;
  display: inline-flex;
  flex-direction: row-reverse; /* lets :hover ~ highlight preceding stars */
  justify-self: end;
  gap: 2px;
  padding: 4px 8px;
  border: 1.5px solid var(--field-border);
  border-radius: 99px;
  background: #fff;
}
.stars input { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.stars label {
  margin: 0;
  cursor: pointer;
  line-height: 0;
  padding: 3px;
  border-radius: 8px;
}
.stars svg { width: 28px; height: 28px; fill: #e6e3ef; transition: fill 0.12s, transform 0.12s; }
.stars label:hover svg { transform: scale(1.12); }

.stars input:checked ~ label svg,
.stars label:hover svg,
.stars label:hover ~ label svg { fill: var(--star); }
/* While previewing a new value, dim the current one (only when a star is actually hovered) */
.stars:has(label:hover) input:checked ~ label svg { fill: #e6e3ef; }
.stars:has(label:hover) label:hover svg,
.stars:has(label:hover) label:hover ~ label svg { fill: var(--star); }

.stars input:focus-visible + label { box-shadow: 0 0 0 3px var(--teal-100); outline: 2px solid var(--teal-500); }

.rating-value {
  grid-area: value;
  align-self: start;
  font-size: 0.8rem;
  color: var(--teal-900);
  font-weight: 400;
  white-space: nowrap;
}
.rating-value:empty { display: none; }
.rating:has(.rating-value:empty) .rating-name { align-self: center; grid-row: 1 / 3; }

/* ---------- Buttons ---------- */
.form-error {
  margin: 8px 0 20px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 400;
  font-size: 0.95rem;
}

.actions { display: flex; justify-content: flex-end; padding-top: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--teal-900);
  background: var(--teal-100);
  border: 2px solid var(--border);
  border-radius: 99px;
  padding: 14px 28px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn svg { width: 18px; height: 18px; transition: transform 0.15s; }
.btn:hover { background: var(--teal-900); color: #fff; border-color: var(--teal-900); box-shadow: 0 10px 24px -10px rgba(5, 78, 96, 0.6); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--teal-500); outline-offset: 3px; }

.btn-ghost { background: transparent; }

.btn:disabled { cursor: progress; opacity: 0.85; }
.btn:disabled:hover { background: var(--teal-100); color: var(--teal-900); border-color: var(--border); box-shadow: none; }
.btn .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Honeypot field: off-screen rather than display:none so naive bots still see it */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Success ---------- */
.success { text-align: center; padding: 56px 32px; }
.success:focus { outline: none; }
.success h2 { font-size: 2.4rem; margin: 16px 0 8px; }
.success p { max-width: 46ch; margin: 0 auto 28px; }
.success strong { color: var(--ink); font-weight: 500; }
.success-icon {
  display: inline-grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--teal-100);
  border: 2px solid var(--border);
  color: var(--teal-900);
}
.success-icon svg { width: 38px; height: 38px; }

/* ---------- Footer ---------- */
.site-footer { padding: 8px 0 48px; font-size: 0.9rem; color: var(--text); text-align: center; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.site-footer a { color: var(--teal-900); text-decoration: none; font-weight: 400; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .fine { margin: 0; font-size: 0.8rem; color: var(--muted); }

/* ---------- Responsive ---------- */
/* Tablet: contact details drop below the social icons */
@media (max-width: 860px) {
  .header-right { flex-direction: column-reverse; align-items: flex-end; gap: 10px; }
  .contact li { justify-content: flex-end; }
}

/* Phone */
@media (max-width: 720px) {
  .site-header { padding: 16px 0 4px; }
  .brand img { width: 88px; }
  .contact { display: none; }
  .social a { width: 38px; height: 38px; }

  .hero { padding: 16px 0 12px; }
  .lede { font-size: 1rem; }

  .card { padding: 24px 18px; border-radius: 24px; margin-bottom: 36px; }
  .section { padding-bottom: 26px; }
  .section + .section { padding-top: 26px; }
  legend { font-size: 1.3rem; gap: 10px; margin-bottom: 18px; }
  .step { width: 32px; height: 32px; font-size: 0.9rem; }
  .progress { gap: 10px; }
  .progress-label { min-width: 0; font-size: 0.78rem; }

  .grid-2 { grid-template-columns: 1fr; }
  .dates > div + div { margin-top: 12px; }

  .rating {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "name  name"
      "stars value"
      "error error";
    row-gap: 0; /* empty error row would otherwise still add a gap */
    column-gap: 12px;
    padding: 14px 14px 14px 16px;
  }
  .rating-name,
  .rating:has(.rating-value:empty) .rating-name { grid-row: auto; align-self: auto; }
  .rating { grid-template-columns: auto minmax(0, 1fr); }
  .stars { justify-self: start; margin-top: 8px; padding: 3px 6px; }
  .stars svg { width: 26px; height: 26px; }
  .rating-value { margin-top: 8px; }
  .rating-value { align-self: center; }

  .actions .btn { width: 100%; justify-content: center; }
}

/* Narrow phones: show just "Very good" next to the stars, not "4/5 · Very good" */
@media (max-width: 420px) {
  .rating-num { display: none; }
}

@media (max-width: 360px) {
  .stars svg { width: 22px; height: 22px; }
  .rating { padding: 12px; }
  .contact li { font-size: 0.75rem; }
}
