/*
 * Components: the code versions of the repeated Figma pieces. Each one is shown on /styleguide.
 * Colour comes from tokens.css; a component never hard-codes a colour that has a token.
 */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px; /* text-only buttons match the height of ones with an icon circle */
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: filter 0.15s, background-color 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn--icon { padding-right: 12px; } /* the icon circle brings its own padding */
.btn--small { min-height: 0; padding: 8px 12px 8px 16px; font-size: 16px; }
.btn--block { width: 100%; }
.btn__icon { display: inline-flex; padding: 4px; border-radius: 30px; }

/* Variants: background, text, and the colours of the little icon circle. */
.btn--solid { background: var(--green-800); color: var(--green-100); }
.btn--solid .btn__icon { background: var(--green-100); color: var(--green-800); }

.btn--light { background: var(--green-100); color: var(--green-800); }
.btn--light .btn__icon { background: var(--green-800); color: var(--green-100); }

/* Dark frosted glass: a light tint made white text unreadable over bright art and photos. */
.btn--glass { background: rgb(from var(--green-975) r g b / 0.3); border-color: rgb(from var(--green-25) r g b / 0.3); color: var(--on-dark); backdrop-filter: blur(8px); }
.btn--glass:hover { background: rgba(255, 255, 255, 0.28); filter: none; }
.btn--glass .btn__icon { background: var(--green-50); color: var(--green-700); }

.btn--dark { background: var(--near-black); color: var(--page-bg); }
.btn--dark .btn__icon { background: var(--surface-tint); color: var(--green-700); }

.btn--outline { background: rgb(from var(--green-100) r g b / 0.5); border-color: rgb(from var(--green-975) r g b / 0.2); color: var(--green-900); }
.btn--outline .btn__icon { background: var(--green-700); color: var(--green-50); }

.btn--soft { background: linear-gradient(to right, rgb(from var(--green-25) r g b / 0.8), rgb(from var(--green-100) r g b / 0.8)); border-color: rgb(from var(--green-600) r g b / 0.5); color: var(--green-900); }
.btn--soft .btn__icon { background: var(--mint); color: var(--green-900); }

.btn--mint { background: var(--mint-cta); color: var(--near-black); }
.btn--mint .btn__icon { background: var(--near-black); color: var(--green-700); }


/* "Become a Radian-Led Practice" shows its columns icon bare, without a circle. */
.btn--bare-icon .btn__icon { background: none; color: currentColor; }
/* Small glass button on green ("Call Us") uses the pale circle like the dark one. */
.btn--glass.btn--small .btn__icon { background: var(--surface-tint); color: var(--green-700); }

/* ---------- Join choices ---------- */
/* "I'm a radiologist" / "I run a practice": rows in the nav's Join menu, big cards on /get-started. */
.join-choice {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "title arrow" "body arrow";
  gap: 4px 16px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-card);
  color: var(--green-975);
  line-height: 1.3;
  transition: background-color var(--dur-fast);
}
.join-choice:hover, .join-choice:focus-visible { background: var(--green-50); }
.join-choice__title { grid-area: title; font-size: 17px; }
.join-choice__body { grid-area: body; font-size: 14px; color: var(--ink-muted); }
.join-choice__arrow { grid-area: arrow; display: inline-flex; color: var(--green-800); transition: translate var(--dur) var(--ease-out); }
.join-choice:hover .join-choice__arrow { translate: 4px 0; }
.join-choice__icon { grid-area: icon; display: inline-flex; width: fit-content; margin-bottom: 40px; padding: 12px; border-radius: 50%; background: var(--green-100); color: var(--green-800); }
.join-choice--card {
  grid-template-areas: "icon icon" "title arrow" "body arrow";
  gap: 10px 24px;
  height: 100%;
  padding: 32px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card-lg);
  background: var(--card-bg);
}
.join-choice--card:hover { border-color: var(--green-800); }
.join-choice--card .join-choice__title { font-size: 30px; }
.join-choice--card .join-choice__body { font-size: 17px; }
/* On the green join band (Home, About): frosted rows instead of a form. */
.join-choice--glass {
  padding: 24px 28px;
  border: 1px solid rgb(from var(--green-25) r g b / 0.2);
  border-radius: var(--radius-card-lg);
  background: rgb(from var(--green-25) r g b / 0.1);
  color: var(--on-dark);
}
.join-choice--glass:hover, .join-choice--glass:focus-visible { background: rgb(from var(--green-25) r g b / 0.18); }
.join-choice--glass .join-choice__title { font-size: 24px; }
.join-choice--glass .join-choice__body { font-size: 16px; color: var(--on-dark-soft); }
.join-choice--glass .join-choice__arrow { padding: 10px; border-radius: 50%; background: var(--surface-tint); color: var(--green-800); }

/* ---------- Labels ---------- */
/* Outlined tag above headings, e.g. "Why Radian Exist?" */
.tag {
  display: inline-block;
  align-self: flex-start;
  padding: 8px 16px;
  border: 1px solid var(--green-800);
  border-radius: var(--radius-tag);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1;
  letter-spacing: -0.04em;
  text-box: trim-both cap alphabetic;
}
.tag--dark { border-color: var(--surface-tint); color: var(--on-dark); }

/* Monospace uppercase label, e.g. "WHO RADIAN HELPS" */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--eyebrow, var(--green-800));
}

/* Filled chip: specialities, "18 yrs exp" */
.chip {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius-tag);
  background: var(--green-100);
  color: var(--green-900);
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
}
a.chip:hover { background: var(--green-200); }
.chip--mint { padding: 4px 8px; background: var(--mint); color: var(--green-975); }

/* Underlined text link with an arrow, e.g. "Read more →" */
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--green-800); font-size: 16px; line-height: 1.3; }
.text-link::after { content: "→"; transition: translate 0.15s; }
.text-link:hover::after { translate: 3px 0; }

/* ---------- Section heading ---------- */
.section-heading { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: 746px; }
.section-heading:has(.tag) { gap: 36px; }
.section-heading--center { align-items: center; margin-inline: auto; text-align: center; }
.section-heading__title { font-size: 48px; line-height: 1.05; letter-spacing: 0.01em; color: var(--heading, var(--ink)); }
.section-heading__lede { max-width: 539px; font-size: 20px; line-height: 1.3; color: var(--lede, var(--ink-soft)); opacity: 0.85; }
.section-heading--dark { --heading: var(--surface-tint); --lede: var(--on-dark); --eyebrow: var(--mint); }

/* ---------- Cards ---------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 25px;
}
.glass-card {
  background: rgb(from var(--green-25) r g b / 0.15);
  border: 1px solid rgb(from var(--green-25) r g b / 0.3);
  border-radius: var(--radius-card);
  backdrop-filter: blur(10px);
  color: var(--on-dark);
}
.practice-logo {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
}
.practice-logo img { width: 57.29%; height: 57.29%; object-fit: contain; }

/* 32px round arrow on cards and rows. Turns down-right when its row is open. */
.icon-btn {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: rotate 0.2s, opacity 0.2s, background-color 0.2s;
}
.icon-btn .icon { width: 21px; height: 21px; }
.icon-btn--green { border: 1px solid var(--green-800); color: var(--green-800); opacity: 0.5; }
.icon-btn--light { background: rgba(255, 255, 255, 0.5); color: var(--green-25); }
a:hover .icon-btn--green, details[open]:not(.is-closing) .icon-btn--green { opacity: 1; }
a:hover .icon-btn--light { background: rgba(255, 255, 255, 0.75); color: var(--green-800); }

/* Round number badge */
.num-badge {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
}
.num-badge--green { background: var(--green-800); color: var(--surface-tint); font-size: 20px; }
.num-badge--glass { background: rgb(from var(--green-950) r g b / 0.2); border: 1px solid rgb(from var(--green-25) r g b / 0.25); color: var(--surface-tint); }

/* Translucent label floating over a photo */
.float-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-pill);
  background: rgb(from var(--green-700) r g b / 0.2);
  backdrop-filter: blur(6px);
  color: var(--green-25);
  font-size: 12.14px;
  line-height: 1.3;
  white-space: nowrap;
}
.float-chip--person { padding-left: 12px; color: var(--green-25); font-size: 17.34px; }
.float-chip img { width: 32px; height: 32px; border-radius: 50%; }

/* ---------- Booking card (mock of the Radian app) ---------- */
.booking-card {
  position: absolute;
  width: 378px;
  height: 221px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 13.87px;
  border: 0.87px solid var(--green-800);
  border-radius: 13.87px;
  background: linear-gradient(112deg, rgb(from var(--green-800) r g b / 0.8), rgb(from var(--green-900) r g b / 0.8));
  backdrop-filter: blur(50px);
  box-shadow: 0 24px 48px rgb(from var(--green-950) r g b / 0.18);
  color: var(--green-100);
  line-height: 1.3;
}
.booking-card__top, .booking-card__bottom { display: flex; align-items: center; justify-content: space-between; }
.booking-card__top { font-size: 13.87px; }
.booking-card__notify, .booking-card__practice { display: inline-flex; align-items: center; gap: 8.67px; font-size: 12.14px; }
.booking-card__time { font-size: 34.68px; }
.booking-card__divider { display: block; height: 1px; background: rgb(from var(--green-25) r g b / 0.5); }
.booking-card__avatar { width: 27.74px; height: 27.74px; border-radius: 50%; background: var(--green-500); }
.booking-card__accept { padding: 12px 16px; border: 1px solid rgb(from var(--green-25) r g b / 0.25); border-radius: var(--radius-pill); background: rgb(from var(--green-700) r g b / 0.25); color: var(--green-25); font-size: 17.34px; }
.booking-card--cta { right: var(--gutter); top: calc(50% - 110px); } /* right edge on the container's text margin, centred vertically */

/* Toggle switch (drawn in CSS so it can animate on) */
.toggle { position: relative; display: inline-block; width: 39.88px; height: 17.34px; border-radius: 20px; background: rgb(from var(--green-25) r g b / 0.3); transition: background-color 0.4s var(--ease-out); }
.toggle > span { position: absolute; top: 2.6px; left: 2.6px; width: 12.14px; height: 12.14px; border-radius: 50%; background: var(--green-25); transition: translate 0.4s var(--ease-out); }
.toggle.is-on, .booking-card.is-in .toggle { background: var(--green-500); }
.toggle.is-on > span, .booking-card.is-in .toggle > span { translate: 22.5px 0; }

/* ---------- Pill accordion (FAQ) ---------- */
.faq-item {
  border: 1px solid var(--card-border);
  border-radius: 25px;
  background: var(--card-bg);
  transition: background-color 0.5s var(--ease-in-out);
}
.faq-item[open]:not(.is-closing) { background: rgb(from var(--green-25) r g b / 0.75); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 0 24px;
  color: var(--green-900);
  font-size: 16px;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
/* Keyboard focus rings the whole pill, following its rounded corners, instead of a square box round the summary. */
.faq-item summary:focus-visible { outline: none; }
.faq-item:has(summary:focus-visible) { outline: 2px solid var(--green-700); outline-offset: 3px; }
.faq-item__icon { flex-shrink: 0; color: var(--green-800); }
.faq-item[open]:not(.is-closing) .faq-item__icon { rotate: 45deg; } /* + turns into × */
.faq-item__answer { max-width: 68ch; padding: 0 24px 20px; color: var(--ink-soft); font-size: 16px; line-height: 1.5; }

/* ---------- Expanding list row (subspecialties) ---------- */
.subspecialty {
  border: 1px solid rgb(from var(--green-800) r g b / 0.1);
  border-radius: var(--radius-card);
  background: rgb(from var(--green-100) r g b / 0.2);
  box-shadow: 0 2px 8px rgb(from var(--green-950) r g b / 0.04);
  transition: background-color 0.5s var(--ease-in-out), border-color 0.5s var(--ease-in-out);
}
.subspecialty[open]:not(.is-closing) { border-color: rgb(from var(--green-600) r g b / 0.2); background: rgb(from var(--green-200) r g b / 0.2); }
.subspecialty summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 32px 32px;
  cursor: pointer;
  list-style: none;
}
.subspecialty summary::-webkit-details-marker { display: none; }
/* Focus rings the whole card, following its corners, instead of a square box round the summary. */
.subspecialty summary:focus-visible { outline: none; }
.subspecialty:has(summary:focus-visible) { outline: 2px solid var(--green-700); outline-offset: 3px; }
.subspecialty__name { color: var(--green-900); font-size: 32px; line-height: 1.2; letter-spacing: -0.02em; opacity: 0.8; transition: opacity 0.5s var(--ease-in-out); }
.subspecialty[open]:not(.is-closing) .subspecialty__name { opacity: 1; }
.subspecialty .icon-btn { transition: rotate 0.5s var(--ease-in-out), opacity 0.3s; }
.subspecialty[open]:not(.is-closing) .icon-btn { rotate: 90deg; }
.subspecialty__body { display: grid; gap: 12px; margin-top: -20px; padding: 0 32px 32px; max-width: 380px; } /* tucks up under the title; the title row keeps one height, so opening is a single smooth slide */
.subspecialty__body p { color: rgb(from var(--green-975) r g b / 0.8); font-size: 16px; line-height: 1.4; }
.subspecialty:hover:not([open]) { background: rgb(from var(--green-100) r g b / 0.45); }

/* ---------- Form fields (on green, inside the join form) ---------- */
.field { display: grid; gap: 4px; }
.field input {
  width: 100%;
  height: 44px; /* same height as the submit button */
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: rgb(from var(--green-950) r g b / 0.28);
  transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
  color: var(--page-bg);
  font-size: 14px;
  line-height: 1;
}
.field input::placeholder { color: var(--page-bg); opacity: 0.85; }

/* Floating label: sits inside the pill like a placeholder, then slides up when the field is focused or filled,
   so the title is never lost while typing (and screen readers always hear it). */
.field--float { position: relative; }
.field--float input { height: 52px; padding: 18px 20px 0; }
.field--float input::placeholder { color: transparent; }
.field__label {
  position: absolute;
  left: 20px;
  top: 26px;
  translate: 0 -50%;
  color: var(--on-dark-soft);
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
  transition: top var(--dur) var(--ease-out), font-size var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.field__label small { font-size: inherit; color: var(--green-200); }
.field--float input:focus + .field__label,
.field--float input:not(:placeholder-shown) + .field__label { top: 14px; font-size: 11px; color: var(--on-dark-soft); }
.field input:hover, .field select:hover { background-color: rgb(from var(--green-950) r g b / 0.36); }
.field input:focus, .field select:focus { outline: none; border-color: rgb(from var(--green-25) r g b / 0.6); background-color: rgb(from var(--green-950) r g b / 0.4); }
.field [aria-invalid="true"] { border-color: var(--error-soft); }

/* Dropdown: same pill as the text fields, with the label always sitting at the top. */
.field select {
  appearance: none;
  width: 100%;
  height: 52px;
  padding: 18px 48px 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: rgb(from var(--green-950) r g b / 0.28) url("../icons/chevron-down-light.svg") no-repeat right 18px center / 20px;
  transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
  color: var(--page-bg);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.field select option { color: var(--ink); background: #fff; }
.field select:has(option[value=""]:checked) { color: var(--on-dark-soft); }
.field--select .field__label { top: 14px; font-size: 11px; }

/* Tick boxes (any number), e.g. Remote / In-practice. */
.field--checks { min-width: 0; margin: 0; padding: 8px 0 4px; border: 0; }
.field__legend { padding: 0 0 10px 20px; color: var(--on-dark-soft); font-size: 14px; }
.field__legend small { font-size: inherit; color: var(--green-200); }
.field__options { display: flex; flex-wrap: wrap; gap: 8px; }
.field__options label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: rgb(from var(--green-950) r g b / 0.28);
  color: var(--page-bg);
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.field__options label:hover { background: rgb(from var(--green-950) r g b / 0.36); }
.field__options label:has(:checked) { border-color: rgb(from var(--mint) r g b / 0.6); }
.field__options input {
  appearance: none;
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0; /* not the text-field padding */
  background: transparent;
  border: 1.5px solid rgb(from var(--green-25) r g b / 0.6);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color var(--dur-fast), border-color var(--dur-fast);
}
.field__options input::after { content: ""; width: 10px; height: 6px; margin-top: -3px; border: solid var(--green-975); border-width: 0 0 2px 2px; rotate: -45deg; opacity: 0; }
.field__options input:checked { border-color: var(--mint); background: var(--mint); }
.field__options input:checked::after { opacity: 1; }
.field__options input:focus-visible { outline: 2px solid var(--green-25); outline-offset: 2px; }
.field--checks[aria-invalid="true"] .field__options label { border-color: var(--error-soft); }
.field__error, .form-error { padding-left: 16px; color: var(--green-25); font-size: 13px; }
.form-error { padding: 0 0 8px; }

/* ---------- Carousel ---------- */
.carousel__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--card-width, 538px);
  gap: 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  /* A sideways-scrolling box clips vertically too, which cut off cards lifting on hover and their shadow.
     The padding gives them room; the matching negative margin keeps the layout where it was. */
  padding-block: 12px 48px;
  margin-block: -12px -44px;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__item { scroll-snap-align: start; }
.carousel__controls { display: flex; gap: 8px; margin-top: 18px; }
.carousel:not(.is-scrollable) .carousel__controls { visibility: hidden; }
.carousel__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.3px solid rgb(from var(--green-700) r g b / 0.15);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  color: var(--green-900);
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
}
.carousel__btn:hover:not(:disabled) { background: #fff; }
.carousel__btn:disabled { opacity: 0.4; cursor: default; }

@media (max-width: 760px) {
  .btn { font-size: 17px; }
  .btn--small { font-size: 15px; padding: 8px 12px 8px 16px; }
  .section-heading__title { font-size: 34px; }
  .section-heading__lede { font-size: 18px; }
  .subspecialty summary { padding: 22px; }
  .subspecialty__body { margin-top: -10px; padding: 0 22px 22px; }
  .subspecialty__name { font-size: 24px; }
  .carousel__track { grid-auto-columns: min(86vw, var(--card-width, 538px)); }
}
