/** @file register_period_external_parent.css
 *  @brief Page-specific styles for the external parent registration form.
 *
 *  All design values reference --ordolio-* tokens from root.css.
 *  Fallback values are provided so the form degrades gracefully if a token
 *  is missing.
 */

/* Visibility helper: screen-reader only live region ----------------------- */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Participant-type radio cards (step 2) ------------------------------------
 * Two large radio cards stacked side-by-side on desktop, stacked vertically
 * on narrow screens. The native radio input is visually hidden but stays
 * keyboard-focusable; the visible chrome lives in .participant-type__option.
 */

.participant-type__options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--ordolio-space-3, 0.75rem);
}

.participant-type__option {
    position: relative;
    display: block;
    cursor: pointer;
    margin: 0;
}

.participant-type__option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.participant-type__option-content {
    display: flex;
    align-items: flex-start;
    gap: var(--ordolio-space-3, 0.75rem);
    border: 2px solid var(--ordolio-border-default, #dee2e6);
    border-radius: var(--ordolio-radius-md, 8px);
    padding: var(--ordolio-space-4, 1rem);
    background: #fff;
    transition:
        border-color 120ms ease,
        box-shadow 120ms ease,
        background-color 120ms ease;
    min-height: 88px;
    box-sizing: border-box;
}

.participant-type__option:hover .participant-type__option-content {
    border-color: var(--ordolio-default-primary, #366cf3);
    background-color: var(--ordolio-bg-subtle, #f8f9ff);
}

.participant-type__option input[type="radio"]:checked + .participant-type__option-content {
    border-color: var(--ordolio-default-primary, #366cf3);
    background-color: var(--ordolio-bg-subtle, #f8f9ff);
    box-shadow: 0 0 0 1px var(--ordolio-default-primary, #366cf3);
}

.participant-type__option input[type="radio"]:focus-visible + .participant-type__option-content {
    outline: 2px solid var(--ordolio-default-primary, #366cf3);
    outline-offset: 2px;
}

.participant-type__option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--ordolio-bg-subtle, #f1f4ff);
    color: var(--ordolio-default-primary, #366cf3);
    font-size: 1.25rem;
}

.participant-type__option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.3;
}

.participant-type__option-text strong {
    color: var(--ordolio-fg-default, #1a1a1a);
}

.participant-type__option-text small {
    font-size: var(--ordolio-text-sm, 0.875rem);
}

/* "Al ingeschreven voor …" line under an existing kid's name + birthdate.
   Green check + muted-but-readable text — confirms recognition without
   discouraging re-enrolment (the parent can still pick the kid). */
.participant-type__option-enrolment {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.2rem;
    color: var(--ordolio-default-success-dark, #059669);
    font-size: 0.8rem;
    line-height: 1.3;
}

.participant-type__option-enrolment i {
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* Hide name row when "Mezelf" is selected — JS toggles display, but keep
   a fallback class so the styling renders even before JS runs. */
.participant-name-row[data-hidden="true"] {
    display: none;
}

/* Empty-state prompt above the participant fields container — visible until
   a participant type is selected. Same muted tone as form helper text so it
   feels informative rather than alarming. */
.participant-type__prompt {
    margin-top: 1rem;
    font-size: 0.95rem;
}

/* "Een nieuw <child>" gets a distinct CTA look: dashed border + lighter
   surface so the parent reads it as "add a new person" rather than
   "pick an existing one". The hover/checked states are inherited from
   the base option but with a brighter accent so the card still feels
   selectable. */
.participant-type__option--new .participant-type__option-content {
    border-style: dashed;
    border-color: var(--ordolio-default-primary, #366cf3);
    background-color: var(--ordolio-bg-subtle, #f8f9ff);
}

.participant-type__option--new:hover .participant-type__option-content {
    border-style: dashed;
    background-color: var(--ordolio-bg-soft-hover, #eef2ff);
}

.participant-type__option--new input[type="radio"]:checked + .participant-type__option-content {
    border-style: solid;
}

.participant-type__option--new .participant-type__option-icon {
    color: var(--ordolio-default-primary, #366cf3);
}

/* GDPR consent line — emphasise it (slight bg + subtle border) so it's
   not lost between the parent portlet and the wizard nav. Inline checkbox
   stays at form-check styling; only the wrapping fieldset gets the chrome. */
.gdpr-consent {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background-color: var(--ordolio-bg-subtle, #f8f9ff);
    border: 1px solid var(--ordolio-border-default, #dee2e6);
    border-radius: var(--ordolio-radius-md, 8px);
}

/* Radio/checkbox spacing inside the participant fields container.
   ``forms.RadioSelect`` and ``CheckboxSelectMultiple`` emit raw <input>
   elements without Bootstrap's .form-check-input class, so the default
   ``.form-check { padding-left: 1.25rem; .form-check-input { margin-left:
   -1.25rem } }`` rule has nothing to anchor on and the label hugs the
   radio with no gap (e.g. "○Publiek zichtbaar"). Add a margin-left to
   the labels that immediately follow a radio/checkbox to restore the
   visual gap. Scoped to ``.participant-fields`` so we don't reflow
   form-check usage elsewhere. */
.participant-fields .form-check input[type="radio"] + .form-check-label,
.participant-fields .form-check input[type="checkbox"] + .form-check-label,
.participant-fields .form-check-inline input[type="radio"] + .form-check-label,
.participant-fields .form-check-inline input[type="checkbox"] + .form-check-label {
    margin-left: 0.4rem;
}

/* Space neighbouring inline radio groups so the options don't crowd. */
.participant-fields .form-check-inline {
    margin-right: 0.5rem;
}

/* Wizard step-card titles ("Gegevens van de ouder", "Wie schrijf je in?",
 * "Bevestigen") — bigger + bolder than the default portlet title so the
 * section purpose (notably "…van de ouder") is unmistakable. Scoped to the
 * wizard so global portlet titles are untouched. */
.form-wizard-step .kt-portlet__head-title {
    font-size: var(--ordolio-text-2xl, 1.5rem);
    font-weight: 700;
}

.wizard-step-card__title-icon {
    color: var(--ordolio-default-primary, #9e1b6d);
    margin-right: var(--ordolio-space-2, 0.5rem);
}

/* WCAG 2.1 AA contrast overrides ------------------------------------------
 * Page-scoped fixes for axe-core color-contrast violations on this form.
 */

.alert.alert-warning .alert-text {
    color: #78350f;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder,
.select2-container--classic .select2-selection--single .select2-selection__placeholder {
    color: #4b5563;
}

/* The privacy-policy link inside the GDPR consent label inherits the brand
 * link colour (--ordolio-default-primary, #366cf3). On the GDPR fieldset's
 * tinted --ordolio-bg-subtle (#f8f9ff) background that only reaches 4.34:1 —
 * just under the 4.5:1 AA threshold. Use the darker primary so the link clears
 * AA without changing its hue. Scoped to this fieldset so other surfaces keep
 * the standard link colour. */
.gdpr-consent .form-check-label a {
    color: var(--ordolio-default-primary-dark, #2e5ccf);
}

/* Returning-parent identity callout (step 1) -------------------------------
 * Sits at the top of the parent-info card body — in the reading path of the
 * prefilled fields — so a different person on a shared/public computer
 * immediately sees whose data is filled in and a prominent way to clear it.
 * Replaces the old thin banner above the stepper, which sat outside the eye
 * trail and was routinely missed.
 */

.parent-identity-callout {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--ordolio-space-3, 0.75rem);
    padding: var(--ordolio-space-3, 0.75rem) var(--ordolio-space-4, 1rem);
    margin-bottom: var(--ordolio-space-5, 1.5rem);
    background: var(--ordolio-default-primary-soft, #fbeaf3);
    border: 1px solid rgba(var(--ordolio-default-primary-rgb, 158, 27, 109), 0.25);
    border-radius: var(--ordolio-radius-lg, 12px);
}

.parent-identity-callout__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: #fff;
    color: var(--ordolio-default-primary, #9e1b6d);
    font-size: var(--ordolio-text-sm, 0.875rem);
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

.parent-identity-callout__text {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.parent-identity-callout__label {
    font-weight: 600;
    color: var(--ordolio-fg-default, #1a1a1a);
}

.parent-identity-callout__email {
    font-size: var(--ordolio-text-sm, 0.875rem);
    color: var(--ordolio-fg-muted, #6b7280);
    overflow: hidden;
    text-overflow: ellipsis;
}

.parent-identity-callout__action {
    flex: 0 0 auto;
    margin-left: auto;
}

/* Stack the action full-width under the text on narrow screens. */
@media (max-width: 575.98px) {
    .parent-identity-callout__action {
        width: 100%;
        margin-left: 0;
    }
}
