/* ============================================
   Registration: the Keystone / Proxy choice cards
   (templates/bundles/PixiekatSymfonyHelpersBundle/user/register.html.twig,
   SECTION 2). Loaded with a <link> on the registration page only.

   Two wide cards side by side, stacked on phones. Each card is a visible
   radio + a <label> (title and one-line summary), then a <details> "What
   is a ...?" outside the label. The chosen card gets a thicker coloured
   border and a tint, plus a check mark, so it's not shown by colour alone.
   ============================================ */

.invalid-feedback {
  display: block;
  margin-top: var(--space-xs);
  font-size: var(--font-size-sm);
  color: var(--color-danger);
}

.role-choice {
  border: 0;
  padding: 0;
  margin-left: 0;
  margin-right: 0;
}

.role-choice__legend {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.role-choice__options {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

/* One card. The radio sits in the left column; the label and details in
   the right, so the text lines up under the title. */
.role-option {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: var(--space-md);
  align-items: start;
  padding: var(--space-lg);
  border: 2px solid var(--color-border-medium);
  border-radius: var(--radius-lg);
  background: var(--color-bg-primary);
}

/* The chosen card: a 3px border and a light tint. */
.role-option:has(.role-option__input:checked) {
  border-color: var(--color-primary);
  box-shadow: inset 0 0 0 1px var(--color-primary);
  background: var(--color-bg-secondary);
}

/* Keyboard focus on the radio: ring around the whole card. */
.role-option:has(.role-option__input:focus-visible) {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* A big, easy-to-hit radio, in the brand colour. */
.role-option__input {
  width: 1.5rem;
  height: 1.5rem;
  margin: 0.15rem 0 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.role-option__input:focus-visible {
  outline: none; /* the card shows the ring instead (above) */
}

/* The label is the card's tap target. */
.role-option__label {
  display: block;
  cursor: pointer;
}

.role-option__title {
  display: block;
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text-primary);
}

/* A check mark after the chosen title: the choice isn't shown by colour alone. */
.role-option__input:checked + .role-option__label .role-option__title::after {
  content: " \2713";
  color: var(--color-primary);
}

.role-option__summary {
  display: block;
  margin-top: var(--space-xs);
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* "What is a Keystone?": under the label, in the text column. */
.role-option__more {
  grid-column: 2;
  margin-top: var(--space-sm);
}

.role-choice details summary {
  cursor: pointer;
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  padding: var(--space-xs) 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.role-choice details summary:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.role-choice details p {
  font-size: var(--font-size-base);
  line-height: 1.6;
  max-width: 70ch;
}

/* Keep the open/closed triangle (display:flex removes it in some browsers). */
.role-choice details summary::before {
  content: "\25B8";
  margin-right: var(--space-xs);
  text-decoration: none;
  display: inline-block;
}

.role-choice details[open] > summary::before {
  content: "\25BE";
}

.role-choice details summary::-webkit-details-marker {
  display: none;
}

.role-choice__network {
  margin-top: var(--space-md);
}
