/* ============================================================
   "Request a callback" modal (element 08)
   Site-wide callback form, opened from the bandEnquiry button.
   Layout/copy locked from 08-callback-form/element-handoff.md; skin
   translated to the main site's light design system.

   Authored MOBILE-FIRST: the base rules ARE the bottom-sheet state;
   the centred desktop modal applies from the site's 960px breakpoint
   up. Never build desktop then subtract.
   ============================================================ */

.ccb {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-family: Poppins, ui-sans-serif, system-ui, sans-serif;
}

.ccb[hidden] {
  display: none;
}

.ccb__scrim {
  position: absolute;
  inset: 0;
  background: rgba(27, 27, 28, 0.55);
  animation: ccbScrimIn 0.2s ease both;
}

/* ---- Shell: mobile bottom sheet ---- */
.ccb__shell {
  position: relative;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -18px 50px -12px rgba(27, 27, 28, 0.4);
  animation: ccbSheetIn 0.26s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* Scroll lives on an inner wrapper so the shell's rounded corners clip the
   scrollbar's square corners instead of the scrollbar squaring them off. */
.ccb__scroll {
  /* vh fallback; dvh tracks the visible viewport on iOS (toolbars). */
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  /* Top padding lives on notch + sticky head so scrolled content cannot
     peek above the close button. */
  padding: 0 20px calc(22px + env(safe-area-inset-bottom));
}

.ccb__notch {
  display: block;
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: #e2dad3;
  margin: 14px auto 14px;
}

/* ---- Header ---- */
.ccb__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1;
  background: #ffffff;
  /* Span full scroll width (cancel horizontal padding) so fields scroll under. */
  margin: 0 -20px 20px;
  padding: 0 20px 4px;
}

.ccb__tile {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: rgba(243, 162, 60, 0.13);
}

.ccb__tile-check {
  display: none;
}

.ccb__close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #e7e0db;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6e6e76;
  padding: 0;
  flex: 0 0 auto;
  transition: background 0.15s ease, color 0.15s ease;
}

.ccb__close:hover {
  background: #f6f1ed;
  color: #1b1b1c;
}

.ccb__close:focus-visible {
  border-color: #a23fb0;
  box-shadow: 0 0 0 3px rgba(162, 63, 176, 0.55);
  outline: none;
  color: #1b1b1c;
}

/* ---- Copy ---- */
.ccb__heading {
  margin: 0;
  font-weight: 700;
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #1b1b1c;
}

.ccb__subline {
  margin: 9px 0 0;
  font-weight: 400;
  font-size: 15.5px;
  line-height: 1.55;
  color: #6e6e76;
}

/* ---- Form ---- */
.ccb__form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 22px;
}

.ccb__field {
  display: flex;
  flex-direction: column;
}

/* Phone/email + date/time rows stack on mobile. */
.ccb__row {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ccb__row .ccb__field {
  flex: 1 1 0;
  min-width: 0;
}

.ccb__label {
  margin-bottom: 9px;
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4a4348;
}

.ccb__input {
  width: 100%;
  box-sizing: border-box;
  height: 52px;
  padding: 0 15px;
  border-radius: 13px;
  border: 1px solid #e5ded8;
  background: #ffffff;
  font-family: inherit;
  font-weight: 400;
  font-size: 16px;
  color: #1b1b1c;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ccb__input::placeholder {
  color: #6e6e76;
  opacity: 1;
}

.ccb__input:focus,
.ccb__input:focus-visible {
  outline: none;
  border-color: #a23fb0;
  box-shadow: 0 0 0 3px rgba(162, 63, 176, 0.55);
}

.ccb__input.ccb--error {
  border-color: #c2503a;
}

.ccb__textarea {
  height: auto;
  min-height: 112px;
  padding: 13px 15px;
  line-height: 1.5;
  resize: vertical;
}

/* Native select + custom caret. */
.ccb__select-wrap {
  position: relative;
}

.ccb__select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 44px;
  cursor: pointer;
}

/* iOS Safari gives date/time inputs an intrinsic min-width that ignores
   width: 100% and overflows the sheet. Reset appearance so they share the
   same box model as the other .ccb__input fields. Empty state uses the
   placeholder colour; :valid (filled) uses the standard input colour.
   JS toggles required while the schedule row is shown so empty matches
   :invalid for that switch — the form has novalidate so native constraint
   UI is not shown. */
.ccb__input[type="date"],
.ccb__input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  text-align: left;
  color: #6e6e76;
}

.ccb__input[type="date"]:valid,
.ccb__input[type="time"]:valid {
  color: #1b1b1c;
}

.ccb__input[type="date"]::-webkit-date-and-time-value,
.ccb__input[type="time"]::-webkit-date-and-time-value {
  text-align: left;
}

.ccb__input[type="date"]::-webkit-datetime-edit,
.ccb__input[type="time"]::-webkit-datetime-edit {
  color: inherit;
}

.ccb__select-caret {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.ccb__error {
  margin: 7px 0 0;
  font-weight: 400;
  font-size: 12.5px;
  line-height: 1.35;
  color: #b0472f;
}

.ccb__form-error {
  margin: 0;
  font-weight: 400;
  font-size: 12.5px;
  line-height: 1.35;
  color: #b0472f;
}

.ccb__form .cf-turnstile {
  width: 100%;
  max-width: 100%;
}

/* Scheduling reveal. */
.ccb__schedule {
  animation: ccbReveal 0.22s ease both;
}

/* ---- CTA ---- */
.ccb__cta {
  position: relative;
  width: 100%;
  height: 58px;
  border: none;
  border-radius: 14px;
  /* Site amber token (btn-yellow-arrow / reinforce-cta), dark text. */
  background: linear-gradient(180deg, #fecc66, #f7a547);
  color: #1b1b1c;
  font-family: inherit;
  font-weight: 600;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  margin-top: 4px;
  transition: filter 0.18s ease, opacity 0.18s ease;
}

.ccb__cta:hover {
  filter: brightness(1.03);
}

.ccb__cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(162, 63, 176, 0.55);
}

.ccb__cta-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(27, 27, 28, 0.28);
  border-top-color: #1b1b1c;
  animation: ccbSpin 0.7s linear infinite;
}

/* Submitting: swap arrow for spinner, dim + disable. */
.ccb.ccb--submitting .ccb__cta {
  opacity: 0.92;
  cursor: default;
}

.ccb.ccb--submitting .ccb__cta-arrow {
  display: none;
}

.ccb.ccb--submitting .ccb__cta-spinner {
  display: inline-block;
}

.ccb__footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 2px 0 0;
}

.ccb__footnote span {
  font-weight: 400;
  font-size: 13px;
  color: #6e6e76;
}

/* ---- Success ---- */
.ccb.ccb--success .ccb__tile {
  background: rgba(46, 158, 91, 0.12);
}

.ccb.ccb--success .ccb__tile-phone {
  display: none;
}

.ccb.ccb--success .ccb__tile-check {
  display: block;
}

.ccb__success-actions {
  border-top: 1px solid #efe9e4;
  margin-top: 26px;
  padding-top: 8px;
  display: flex;
  justify-content: center;
}

.ccb__text-btn {
  border: none;
  background: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  color: #1b1b1c;
  padding: 12px 22px;
  cursor: pointer;
  border-radius: 10px;
}

.ccb__text-btn:hover {
  background: #f6f1ed;
}

.ccb__text-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(162, 63, 176, 0.55);
}

/* ---- Desktop: centred modal (site <960px breakpoint) ---- */
@media (min-width: 960px) {
  .ccb {
    align-items: center;
    padding: 24px;
  }

  .ccb__shell {
    width: 480px;
    max-width: 100%;
    border-radius: 22px;
    box-shadow: 0 30px 70px -22px rgba(27, 27, 28, 0.42),
      0 8px 24px -10px rgba(27, 27, 28, 0.16);
    animation: ccbModalIn 0.2s ease both;
  }

  .ccb__scroll {
    max-height: 90vh;
    max-height: 90dvh;
    padding: 0 34px 26px;
  }

  .ccb__notch {
    display: none;
  }

  .ccb__head {
    margin: 0 -34px 20px;
    padding: 30px 34px 4px;
  }

  .ccb__row {
    flex-direction: row;
    gap: 16px;
  }
}

/* ---- Motion ---- */
@keyframes ccbScrimIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ccbSheetIn {
  from { transform: translateY(100%); }
  to { transform: none; }
}

@keyframes ccbModalIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes ccbReveal {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

@keyframes ccbSpin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .ccb__scrim,
  .ccb__shell,
  .ccb__schedule {
    animation: none !important;
  }

  .ccb__cta-spinner {
    animation: none !important;
  }
}
