/*
 * Plans page redesign (/register/plan/<persona>), loaded after style_index_min.css.
 * Only visual: every rule is scoped to main.sd-plans and each persona sets its colour with
 * .sd-plans--clubs / --scouts / --coaches / --agents (same palette as the persona pages).
 */

/* ------------------------------------------------------------------ Page colours */

.sd-plans {
  --sd-text: #1B2333;
  --sd-muted: #435066;
  --sd-border: #E8ECF1;
  --sd-ground: #F2F4F7;
  --sd-green: #50D878;
  --sd-navy: #1F2A3D;
  position: relative;
  isolation: isolate;
  display: flow-root;
  overflow: clip;
  padding-bottom: 4rem;
  background: var(--sd-ground);
}

/* style_index_min.css gives every section a 100px bottom margin; the page padding replaces it */
.sd-plans > section:last-child {
  margin-bottom: 0;
}

.sd-plans--clubs { --sd-accent: #226F18; --sd-soft: #E3F1E0; --sd-deep: #1A5213; --sd-deep2: #133D0E; }
.sd-plans--scouts { --sd-accent: #136B6B; --sd-soft: #DDF3F3; --sd-deep: #0F4C4D; --sd-deep2: #0B3A3B; }
.sd-plans--coaches { --sd-accent: #1F55B8; --sd-soft: #E1EBFD; --sd-deep: #183F87; --sd-deep2: #122F66; }
.sd-plans--agents { --sd-accent: #611F69; --sd-soft: #F1E3F3; --sd-deep: #4A1850; --sd-deep2: #36113B; }

/*
 * Light band in the persona colour behind the title, the discount pill, the switch and the top of the cards.
 * It is drawn by the cards row and reaches upwards; main clips it at its top edge, so its height
 * never depends on how long the title is in each language.
 */
.sd-plans .row {
  position: relative;
}

.sd-plans .row::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: calc(100% - 7rem);
  width: 100vw;
  height: 200rem;
  transform: translateX(-50%);
  background-color: color-mix(in srgb, var(--sd-accent) 30%, #FFFFFF);
  background-image:
    radial-gradient(color-mix(in srgb, var(--sd-accent) 22%, transparent) 1px, transparent 1px),
    linear-gradient(180deg, color-mix(in srgb, var(--sd-accent) 18%, #FFFFFF) 0%, color-mix(in srgb, var(--sd-accent) 32%, #FFFFFF) 100%);
  background-size: 22px 22px, 100% 100%;
  background-position: center bottom;
}

/* ------------------------------------------------------------------ Header (dark text on the light band) */

.sd-plans h1.display-6 {
  color: var(--sd-text) !important;
  text-wrap: balance;
  letter-spacing: -0.01em;
}

/* Persona word of the title in the page colour, without the underline */
.sd-plans h1 .lp-underline {
  color: var(--sd-accent);
}

.sd-plans h1 .lp-underline::before {
  display: none;
}

.sd-plans .lead {
  color: var(--sd-text) !important;
}

/* ------------------------------------------------------------------ Discount pill and switch */

.sd-plans .discoutPills .badge {
  color: var(--sd-navy);
  background-color: var(--sd-green) !important;
  font-size: 0.8125rem;
  padding: 0.4375rem 0.875rem;
  letter-spacing: 0.02em;
}

.sd-plans .form-switch-inline ~ *,
.sd-plans .h5.mb-0 {
  color: var(--sd-text);
}

.sd-plans .form-check-input-plans {
  background-color: #C9D0DA;
  border-color: #C9D0DA;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
  cursor: pointer;
}

.sd-plans .form-check-input-plans:checked {
  background-color: var(--sd-green);
  border-color: var(--sd-green);
}

.sd-plans .form-check-input-plans:focus {
  border-color: var(--sd-green);
  box-shadow: 0 0 0 0.25rem rgba(80, 216, 120, 0.3);
}

/* ------------------------------------------------------------------ Cards */

.sd-plans .card {
  border: 1px solid var(--sd-border);
  border-radius: 1.25rem;
  background: #FFFFFF;
  box-shadow: 0 24px 48px -28px rgba(27, 35, 51, 0.45);
  overflow: hidden;
}

.sd-plans .card .card-body {
  padding: 2rem 1.5rem 1.5rem;
}

/* Coloured line on top of every card: page colour, green (highlighted) and navy (Enterprise) */
.sd-plans .card1 {
  border-top: 4px solid var(--sd-accent);
}

.sd-plans .card .card-title {
  font-size: 1.375rem;
  letter-spacing: -0.01em;
}

/* Plan name in the page colour on the light cards */
.sd-plans .card1 .card-title,
.sd-plans .card3 .card-title {
  color: var(--sd-accent) !important;
}

.sd-plans .card .h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Highlighted plan: page colour, darker persona line on top, slightly raised */
.sd-plans .card2 {
  border: 0;
  border-top: 4px solid var(--sd-deep2);
  background: linear-gradient(165deg, var(--sd-accent) 0%, var(--sd-deep) 100%) !important;
  box-shadow: 0 32px 64px -24px rgba(27, 35, 51, 0.6);
}

/* Enterprise: compact card instead of an empty full-height column */
.sd-plans .card3 {
  height: auto !important;
  border-top: 4px solid var(--sd-navy);
}

/* ------------------------------------------------------------------ Feature lists */

.sd-plans .list-group-item-plans {
  padding-left: 0;
  padding-right: 0;
  font-size: 0.9375rem;
}

.sd-plans .list-group-item-plans i:not(.fa-plus) {
  font-size: 1.25rem;
}

.sd-plans .card1 .card-body ul.list-group.list-group-flush {
  color: var(--sd-text);
}

.sd-plans .card1 .card-body ul.list-group.list-group-flush li.list-group-item.list-group-item-plans i.fa-circle-check {
  opacity: 1;
  color: var(--sd-accent);
}

.sd-plans .card1 .card-body ul.list-group.list-group-flush li.list-group-item.list-group-item-plans i.fa-circle-xmark {
  opacity: 1;
  color: #C9D0DA;
}

.sd-plans .card1 .card-body ul.list-group.list-group-flush li.list-group-item.list-group-item-plans .excludes {
  color: #8A94A6;
}

.sd-plans .card2 .card-body ul.list-group.list-group-flush li.list-group-item.list-group-item-plans i.fa-circle-check {
  opacity: 1;
  color: var(--sd-soft);
}

/* ------------------------------------------------------------------ Buttons */

/* Trial (primary) and Book a Demo (secondary) get their shape from buttons_redesign.css; on this page the
   primary colour is the persona colour instead of the brand green (green stays on the switch and the pill) */
.sd-plans {
  --sd-btn-primary-bg: var(--sd-accent);
  --sd-btn-primary-bg-hover: var(--sd-deep);
  --sd-btn-primary-color: #FFFFFF;
}

/* Highlighted plan sits on the persona colour: white trial button with persona-colour text */
.sd-plans .card2 {
  --sd-btn-primary-bg: #FFFFFF;
  --sd-btn-primary-bg-hover: var(--sd-soft);
  --sd-btn-primary-color: var(--sd-accent);
}

/* Enterprise sits on a white card: Book a Demo outlined in navy instead of the page colour */
.sd-plans .card3 {
  --sd-btn-secondary-color: var(--sd-navy);
}

/* Disabled monthly button of the Agents Connect plan stays visibly unavailable */
.sd-plans .card2 .btn-outline-900:disabled {
  color: rgba(255, 255, 255, 0.7);
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
}

/* ------------------------------------------------------------------ Small screens */

@media (max-width: 991.98px) {
  .sd-plans .card3 {
    height: 100% !important;
  }
}

@media (max-width: 575.98px) {
  .sd-plans .card .card-body {
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .sd-plans h1.display-6 {
    font-size: 1.75rem;
  }
}

/* ------------------------------------------------------------------ Plan cards on small screens (see plans_cards.js) */

/* The open/close button only exists for small screens */
.sd-plans .sd-plan-toggle {
  display: none;
}

@media (max-width: 991.98px) {
  /* Shorter header so the plans and their prices are visible straight away */
  .sd-plans > section:first-child > div {
    margin-top: 0 !important;
    padding-top: 2rem !important;
  }

  .sd-plans > section:first-child {
    margin-bottom: 0.5rem !important;
  }

  .sd-plans .discoutPills + div {
    margin-bottom: 1.75rem !important;
  }

  .sd-plans .row > [class*="col-"] {
    margin-bottom: 0.875rem !important;
  }

  /* Line breaks and invisible alignment spacers are only needed side by side */
  .sd-plans .card-body > br,
  .sd-plans .card .invisible {
    display: none;
  }

  .sd-plans .card .card-body {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 1.25rem 1.25rem 1rem;
  }

  .sd-plans .card .card-title {
    margin: 0;
    padding-right: 3rem;
  }

  .sd-plans .card .h1 {
    font-size: 2rem;
  }

  .sd-plans .card .d-grid {
    margin: 0.25rem 0 0 !important;
  }

  /* Closed card: plan name and price only */
  .sd-plans .sd-plan-collapsible {
    cursor: pointer;
  }

  .sd-plans .sd-plan-collapsible:not(.sd-plan-open) .card-body > span:not(.h1),
  .sd-plans .sd-plan-collapsible:not(.sd-plan-open) .monthly-subscription-plans > br,
  .sd-plans .sd-plan-collapsible:not(.sd-plan-open) ul.list-group {
    display: none;
  }

  /* Bootstrap's .d-grid is !important, so the trial button needs it too */
  .sd-plans .sd-plan-collapsible:not(.sd-plan-open) .d-grid {
    display: none !important;
  }

  .sd-plans .sd-plan-collapsible ul.list-group {
    padding-bottom: 0 !important;
  }

  /* Round chevron button in the top right corner, turned up when the card is open */
  .sd-plans .sd-plan-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--sd-accent);
    background: var(--sd-soft);
    transition: transform .25s ease;
  }

  .sd-plans .sd-plan-open .sd-plan-toggle {
    transform: rotate(180deg);
  }

  .sd-plans .card2 .sd-plan-toggle {
    color: var(--sd-accent);
    background: #FFFFFF;
  }

  .sd-plans .sd-plan-toggle:focus-visible {
    outline: 2px solid var(--sd-green);
    outline-offset: 2px;
  }
}

@media (max-width: 991.98px) and (prefers-reduced-motion: reduce) {
  .sd-plans .sd-plan-toggle {
    transition: none;
  }
}
