.screen-choice-page {
  max-width: 880px;
}

.screen-choice-page > .form {
  max-width: none;
}

.screen-choice-page__title {
  font-family: var(--font-family-bricolage);
}

.screen-choice-page__subtitle {
  margin: 0;
}

.screen-choice {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2xs);
}

/* On a phone each option stacks its screen over its text, large enough to read the markers. */
.screen-choice__option {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 16px;
  background: white;
  box-shadow: 0 0 0 1px var(--color-border-neutral), 2px 4px 7.2px 0 rgb(0 0 0 / 2%);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.screen-choice__option:hover {
  border-color: var(--sky-border);
}

/* Picked the way the design system's radio button group marks its choice. */
.screen-choice__option:has(.screen-choice__input:checked) {
  border-color: var(--sky-border);
}

.screen-choice__option:has(.screen-choice__input:checked) .screen-choice__text {
  background: var(--sky-gradient);
}

.screen-choice__option:has(.screen-choice__input:focus-visible) {
  outline: 2px solid var(--sky-border);
  outline-offset: 2px;
}

.screen-choice__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.screen-choice__panel {
  display: flex;
  justify-content: center;
  padding: var(--spacing-xl) var(--spacing-md) var(--spacing-md);
  overflow: hidden;
}

/* The guest screens are drawn at their real width and shrunk as a whole. */
.screen-choice__panel--a {
  background: #eef7e6;
}

.screen-choice__panel--b {
  background: #e6f3fb;
}

.screen-choice__zoom {
  display: block;
  zoom: 0.75;
  pointer-events: none;
}

.screen-choice__screen {
  display: flex;
  flex-direction: column;
  width: 340px;
  box-shadow: 0 2px 6px rgb(0 0 0 / 6%), 0 12px 28px rgb(22 51 0 / 16%);
}

.screen-choice__screen .pots__pot-card__header {
  min-height: 40px;
}

.screen-choice__screen .pots__pot-card__content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  padding-top: var(--spacing-md);
}

/* Screen B's fee part, set off like screen A's contribution. */
.screen-choice__fee {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  padding-top: var(--spacing-xs);
  border-top: 1px solid var(--color-border-soft);
}

.screen-choice__other {
  --btn-font-size: var(--font-sm);
  --btn-padding-block: var(--spacing-2xs);
}



.screen-choice__screen .dark-pattern-recap__card,
.screen-choice__screen .dark-pattern-recap__contribution {
  display: flex;
  flex-direction: column;
}

/* Both screens open on the same row at the same height. */
.screen-choice__screen .dark-pattern-recap__card {
  padding: 0;
}

.screen-choice__screen .btn {
  display: flex;
}

/* The part of the screen each option is about, outlined and labelled. */
.screen-choice__screen .screen-choice__marked {
  position: relative;
  margin-inline: calc(-1 * var(--spacing-xs));
  padding: var(--spacing-xs);
  border-top-color: transparent;
  border-radius: var(--rounded-xs);
  outline: 2px dashed var(--interactive-primary);
  outline-offset: -2px;
  background: rgb(159 232 112 / 14%);
}

.screen-choice__marker {
  position: absolute;
  top: -11px;
  right: var(--spacing-xs);
  padding: 3px 9px;
  border-radius: var(--rounded-full);
  background: var(--interactive-accent);
  color: var(--interactive-primary);
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.screen-choice__text {
  --screen-choice-check-size: 22px;
  --screen-choice-heading-gap: var(--spacing-2xs);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2xs);
  padding: var(--spacing-md);
}

.screen-choice__heading {
  display: flex;
  align-items: center;
  gap: var(--screen-choice-heading-gap);
}

/* Lined up under the title, past the check. */
.screen-choice__details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-2xs);
  padding-left: calc(var(--screen-choice-check-size) + var(--screen-choice-heading-gap));
}

.screen-choice__description {
  font-weight: var(--font-weight-semibold);
  line-height: 1.4;
}

.screen-choice__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--spacing-4xs);
  padding: 4px 10px 4px 8px;
  border-radius: var(--rounded-full);
  background: var(--interactive-accent);
  color: var(--interactive-primary);
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.screen-choice__badge .icon {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
}

.screen-choice__context,
.screen-choice__note {
  font-size: var(--font-sm);
  line-height: 1.5;
}

.screen-choice__note {
  color: var(--text-secondary);
}

.screen-choice__learn-more {
  padding: 0;
  border: none;
  background: none;
  color: var(--interactive-primary);
  font: inherit;
  font-weight: var(--font-weight-semibold);
  text-decoration: underline;
  white-space: nowrap;
  cursor: pointer;
}

/* Opens the option's screen, full size, in the modal. */
.screen-choice__expand {
  position: absolute;
  top: var(--spacing-2xs);
  right: var(--spacing-2xs);
  z-index: 1;
  box-shadow: 0 1px 4px rgb(0 0 0 / 12%);
}

.screen-choice__check {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid #cfcfcf;
  border-radius: var(--rounded-full);
  background: white;
  color: transparent;
}

.screen-choice__check .icon {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.screen-choice__option:has(.screen-choice__input:checked) .screen-choice__check {
  border-color: var(--interactive-primary);
  background: var(--interactive-primary);
  color: white;
}

.screen-choice__title {
  font-family: var(--font-family-bricolage);
  font-size: var(--font-lg);
  font-weight: var(--font-weight-bold);
  line-height: 1.1;
}


@media (min-width: 48rem) {
  .screen-choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
    column-gap: var(--spacing-md);
    row-gap: 0;
  }

  /* Side by side, each option stacks its screen, at its real size, over its text. */
  .screen-choice__option {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-row: span 2;
    grid-template-rows: subgrid;
    row-gap: 0;
    border-radius: 18px;
  }

  .screen-choice__panel {
    align-items: flex-start;
    padding: var(--spacing-3xl) var(--spacing-lg) var(--spacing-xl);
  }

  .screen-choice__zoom {
    zoom: 1;
  }

  .screen-choice__text {
    --screen-choice-check-size: 26px;
    --screen-choice-heading-gap: var(--spacing-xs);
    gap: var(--spacing-xs);
    padding: var(--spacing-lg);
  }

  .screen-choice__details {
    gap: var(--spacing-xs);
  }

  .screen-choice__expand {
    top: var(--spacing-sm);
    right: var(--spacing-sm);
  }

  .screen-choice__check {
    width: var(--screen-choice-check-size);
    height: var(--screen-choice-check-size);
  }

  .screen-choice__title {
    font-size: var(--text-2xl);
  }


  .screen-choice-page__submit {
    align-self: center;
    width: 360px;
  }
}

/* The full-size preview is staged on a grey backdrop, so it reads as a picture of the guest's page. */
.screen-choice-page .modal__body {
  padding: var(--spacing-lg);
  background: #edebe5;
}

@media (max-width: 26rem) {
  .screen-choice-page .modal__body {
    padding: var(--spacing-md);
  }
}

/* The study article fills its modal, with a way out to a full tab below it. */
.screen-choice-page .screen-choice-page__study .modal__body {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--background-screen);
}

.screen-choice-page__article {
  display: block;
  width: 100%;
  height: calc(100vh - 12rem);
  border: 0;
}

.screen-choice-page__article-link {
  padding: var(--spacing-xs) var(--spacing-lg);
  border-top: 1px solid var(--color-border-neutral);
  color: var(--interactive-primary);
  font-size: var(--font-sm);
  font-weight: var(--font-weight-semibold);
}

.pot-experiment {
  max-width: 32rem;
  margin-top: var(--spacing-lg);
}
