/*
 * Registration flow pages (registrationApp/index.php and includes/flow/*.php, public and admin).
 * Everything is scoped under .reg so it cannot leak into the Pico theme or the other admin pages,
 * which keep RegistrationStyles.css / FormValidation.css.
 */

.reg {
    --reg-navy: #00457c;
    --reg-navy-dark: #00335c;
    --reg-navy-tint: #eef4fa;
    --reg-gold: #eaa000;
    --reg-gold-tint: #fff8e6;
    --reg-ink: #1f2933;
    --reg-muted: #5b6670;
    --reg-border: #d5dbe1;
    --reg-field-border: #b3bec9;
    --reg-surface: #ffffff;
    --reg-soft: #f5f7fa;
    --reg-error: #b42318;
    --reg-error-tint: #fef3f2;
    --reg-success: #1e7e4a;
    --reg-radius: 8px;
    --reg-focus: 0 0 0 3px rgba(0, 69, 124, .2);

    box-sizing: border-box;
    max-width: 1120px;
    margin: 0 auto;
    padding: 1.5rem 2rem 3rem;
    color: var(--reg-ink);
    font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

.reg *,
.reg *::before,
.reg *::after {
    box-sizing: border-box;
    font-family: inherit;
}

.reg .fa {
    font-family: FontAwesome;
}

/* The site theme sets large paragraph/list typography; reset it inside the flow. */
.reg p {
    margin: 0 0 .75rem;
    color: inherit;
    font-size: 1rem;
    line-height: 1.55;
}

.reg ul,
.reg ol,
.reg li {
    font-family: inherit !important;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.reg a:not(.reg-btn) {
    color: var(--reg-navy);
    text-decoration: underline;
}

.reg small {
    display: block;
}

/* ---- Header and progress ---------------------------------------------------------------- */

.reg-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.25rem;
    padding-bottom: .9rem;
    border-bottom: 3px solid var(--reg-gold);
}

.reg .reg-title {
    margin: 0;
    color: var(--reg-navy);
    font-family: 'Roboto Slab', Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .02em;
}

.reg-badge {
    padding: .25rem .65rem;
    border-radius: 999px;
    background: var(--reg-gold);
    color: var(--reg-ink);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.reg .reg-steps {
    display: flex;
    margin: 0 0 1.75rem;
    padding: 0;
    list-style: none;
}

.reg-steps__item {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    color: var(--reg-muted);
    font-size: .875rem;
}

.reg-steps__item:last-child {
    flex: 0 0 auto;
}

.reg-steps__item:not(:last-child)::after {
    content: '';
    flex: 1 1 auto;
    min-width: .75rem;
    height: 2px;
    margin: 0 .25rem;
    background: var(--reg-border);
}

.reg-steps__num {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border: 2px solid var(--reg-border);
    border-radius: 50%;
    background: var(--reg-surface);
    font-size: .8rem;
    font-weight: 700;
}

.reg-steps__label {
    white-space: nowrap;
}

.reg-steps__item.is-done .reg-steps__num {
    border-color: var(--reg-navy);
    background: var(--reg-navy);
    color: #fff;
}

.reg-steps__item.is-done::after {
    background: var(--reg-navy);
}

.reg-steps__item.is-current {
    color: var(--reg-navy);
    font-weight: 700;
}

.reg-steps__item.is-current .reg-steps__num {
    border-color: var(--reg-navy);
    color: var(--reg-navy);
    box-shadow: var(--reg-focus);
}

/* ---- Layout ----------------------------------------------------------------------------- */

.reg-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 2rem;
    align-items: start;
}

.reg-layout--payment {
    grid-template-columns: minmax(0, 1fr) 360px;
}

/* the sidebar column spans the full row height so its content can stick while the form scrolls */
.reg-aside {
    align-self: stretch;
}

.reg-aside__sticky {
    position: sticky;
    top: 1rem;
}

.reg-card {
    margin-bottom: 1.25rem;
    padding: 1.5rem;
    border: 1px solid var(--reg-border);
    border-radius: var(--reg-radius);
    background: var(--reg-surface);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}

.reg-card--narrow {
    max-width: 760px;
}

.reg-card--aside {
    padding: 1.25rem;
}

.reg-card--staff {
    border-left: 4px solid var(--reg-gold);
    background: var(--reg-gold-tint);
}

.reg .reg-card__title {
    margin: 0 0 1rem;
    padding: 0 0 .6rem;
    border-bottom: 1px solid var(--reg-border);
    color: var(--reg-navy);
    font-family: 'Roboto Slab', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0;
}

.reg .reg-card__subtitle {
    margin: 1.5rem 0 .75rem;
    color: var(--reg-ink);
    font-size: 1rem;
    font-weight: 700;
}

.reg-lead {
    margin: 0 0 1.25rem;
    padding: .85rem 1rem;
    border-left: 4px solid var(--reg-navy);
    border-radius: 0 var(--reg-radius) var(--reg-radius) 0;
    background: var(--reg-navy-tint);
}

.reg .reg-lead {
    font-size: .95rem;
}

.reg-notice {
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    border: 1px solid #f1d58f;
    border-left: 4px solid var(--reg-gold);
    border-radius: var(--reg-radius);
    background: var(--reg-gold-tint);
}

.reg-notice p:last-child {
    margin-bottom: 0;
}

/* ---- Fields ----------------------------------------------------------------------------- */

.reg-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.reg-field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: 1.1rem;
}

.reg-grid > .reg-field {
    margin-bottom: 0;
}

.reg-field--full {
    grid-column: 1 / -1;
}

.reg-field > label:first-child,
.reg-label {
    color: var(--reg-ink);
    font-size: .9rem;
    font-weight: 600;
}

.reg .is-required::after {
    content: ' *';
    color: var(--reg-error);
}

/* empty error placeholders (lblErr*) take no space until the validator writes into them */
.reg-field > label:empty,
.reg-field > span:empty {
    display: none;
}

.reg input[type=text],
.reg select,
.reg textarea {
    width: 100%;
    min-height: 2.75rem;
    padding: .5rem .75rem;
    border: 1px solid var(--reg-field-border);
    border-radius: 6px;
    background: var(--reg-surface);
    color: var(--reg-ink);
    font-size: 1rem;
    line-height: 1.4;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.reg textarea {
    min-height: 6rem;
    resize: vertical;
}

.reg input[type=text]:focus,
.reg select:focus,
.reg textarea:focus {
    border-color: var(--reg-navy);
    outline: none;
    box-shadow: var(--reg-focus);
}

.reg input.error,
.reg select.error,
.reg textarea.error {
    border-color: var(--reg-error);
    background: var(--reg-error-tint);
}

.reg .form-error {
    color: var(--reg-error);
    font-size: .85rem;
    font-weight: 500;
}

.reg-hint {
    margin: .2rem 0 0;
    color: var(--reg-muted);
    font-size: .85rem;
    line-height: 1.5;
}

.reg p.reg-hint {
    font-size: .85rem;
    line-height: 1.5;
}

.reg-field--staff label:first-child {
    color: #7a5200;
}

.reg-field--staff textarea {
    border-color: #e2c36e;
    background: #fffdf5;
}

/* Radio choices rendered as selectable cards */
.reg-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: .6rem;
    margin-top: .2rem;
}

.reg-options--inline {
    display: flex;
    flex-wrap: wrap;
}

.reg-option {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 2.75rem;
    padding: .6rem .9rem;
    border: 1px solid var(--reg-border);
    border-radius: var(--reg-radius);
    background: var(--reg-surface);
    color: var(--reg-ink);
    font-size: .95rem;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.reg-options--inline .reg-option {
    min-width: 6.5rem;
}

.reg-option:hover {
    border-color: #7fa2c0;
    background: #f7fafd;
}

.reg-option input {
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    accent-color: var(--reg-navy);
}

.reg-option:has(input:checked) {
    border-color: var(--reg-navy);
    background: var(--reg-navy-tint);
    box-shadow: inset 0 0 0 1px var(--reg-navy);
}

.reg-option:has(input:focus-visible) {
    box-shadow: var(--reg-focus);
}

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

.reg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 2.75rem;
    padding: .6rem 1.4rem;
    border: 2px solid var(--reg-navy);
    border-radius: 6px;
    background: var(--reg-navy);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.reg-btn:hover {
    border-color: var(--reg-navy-dark);
    background: var(--reg-navy-dark);
    color: #fff;
}

.reg-btn:focus-visible {
    outline: 3px solid rgba(234, 160, 0, .7);
    outline-offset: 2px;
}

.reg-btn--primary {
    box-shadow: inset 0 -3px 0 var(--reg-gold);
}

.reg-btn--secondary {
    background: var(--reg-surface);
    color: var(--reg-navy);
}

.reg-btn--secondary:hover {
    background: var(--reg-navy-tint);
    color: var(--reg-navy);
}

.reg-btn--small {
    min-height: 2.25rem;
    padding: .35rem .9rem;
    font-size: .875rem;
}

.reg-btn--link {
    min-height: 0;
    padding: .15rem .25rem;
    border: none;
    background: none;
    color: var(--reg-navy);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: underline;
}

.reg-btn--link:hover {
    background: none;
    color: var(--reg-navy-dark);
}

.reg-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.reg-btn--link:disabled {
    text-decoration: none;
}

.reg-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin: .5rem 0 1.5rem;
}

.reg-actions--narrow {
    justify-content: space-between;
    max-width: 760px;
}

.reg-controls {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    margin-bottom: 1rem;
}

/* ---- Totals, summaries, attendee list --------------------------------------------------- */

.reg-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1.1rem;
    border-bottom: 3px solid var(--reg-gold);
    border-radius: var(--reg-radius);
    background: var(--reg-navy);
    color: #fff;
}

.reg-total__label {
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.reg-total__amount {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.reg .reg-summary {
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.reg-summary__item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--reg-border);
}

.reg-summary__item:first-child {
    padding-top: 0;
}

.reg-summary__name {
    font-weight: 700;
}

.reg-summary__meta {
    color: var(--reg-muted);
    font-size: .9rem;
}

.reg-summary__cost {
    font-weight: 700;
    white-space: nowrap;
}

.reg-k {
    color: var(--reg-muted);
    font-weight: 500;
}

.reg-items {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin-bottom: 1rem;
}

.reg-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
    padding: .75rem .85rem;
    border: 1px solid var(--reg-border);
    border-left: 3px solid var(--reg-gold);
    border-radius: 6px;
    background: var(--reg-soft);
    font-size: .9rem;
}

.reg-item__name {
    font-weight: 700;
}

.reg-item__meta {
    color: var(--reg-muted);
}

/* ---- Dialogs ---------------------------------------------------------------------------- */

.reg-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 1rem;
    overflow-y: auto;
    background: rgba(15, 23, 42, .55);
}

.reg-modal__dialog {
    max-width: 460px;
    margin: 15vh auto 0;
    padding: 1.5rem;
    border-top: 4px solid var(--reg-gold);
    border-radius: 10px;
    background: var(--reg-surface);
    color: var(--reg-ink);
    box-shadow: 0 20px 45px rgba(0, 0, 0, .25);
}

.reg .reg-modal__dialog p {
    margin-bottom: .5rem;
}

.reg-modal__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .6rem;
    margin-top: 1.25rem;
}

.reg-code {
    font-family: Consolas, Menlo, monospace !important;
    font-weight: 700;
}

#orderLink {
    word-break: break-all;
}

/* ---- Payment and confirmation ----------------------------------------------------------- */

.reg-card-element {
    min-height: 2.75rem;
    padding: .7rem .75rem;
    border: 1px solid var(--reg-field-border);
    border-radius: 6px;
    background: var(--reg-surface);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.reg-card-element.StripeElement--focus {
    border-color: var(--reg-navy);
    box-shadow: var(--reg-focus);
}

.reg-card-element.StripeElement--invalid {
    border-color: var(--reg-error);
}

.reg-card-errors {
    min-height: 1.25rem;
    color: var(--reg-error);
    font-size: .875rem;
}

.reg-success {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.reg-success__icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--reg-success);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
}

.reg-card--success .reg-card__title {
    margin-bottom: .35rem;
    padding: 0;
    border: none;
}

/* ---- Landing page (index.php) ----------------------------------------------------------- */

.reg-intro {
    max-width: 760px;
}

.reg-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.reg-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0;
    padding: 1.75rem 1.5rem;
    border-top: 4px solid var(--reg-navy);
}

.reg-choice__icon {
    color: var(--reg-gold);
    font-size: 2.25rem;
}

.reg-choice .reg-btn {
    width: 100%;
}

.reg-resume {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1.5rem;
}

.reg-resume__form {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.reg .reg-resume__form input[type=text] {
    width: 9rem;
}

/* ---- Admin portal shell ----------------------------------------------------------------- */

.reg--admin {
    padding-top: 1.75rem;
}

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

/* Below the theme's 48em breakpoint its "Menu" bar is fixed over the top of the page (75px). */
@media (max-width: 48em) {
    body:not(.admin-page) .reg {
        padding-top: calc(75px + 1.25rem);
    }
}

@media (max-width: 900px) {
    .reg-layout,
    .reg-layout--payment {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    .reg-aside {
        order: -1;
    }

    .reg-aside__sticky {
        position: static;
    }

    /* Pages whose sidebar is only the running total: keep it pinned to the bottom of the screen */
    .reg-aside--total {
        position: sticky;
        bottom: 0;
        z-index: 5;
        order: 1;
    }

    .reg-aside--total .reg-total {
        box-shadow: 0 -6px 16px rgba(15, 23, 42, .18);
    }
}

@media (max-width: 640px) {
    .reg {
        padding: 1rem 1rem 2rem;
    }

    .reg .reg-title {
        font-size: 1.5rem;
    }

    .reg-card {
        padding: 1.1rem;
    }

    .reg-grid,
    .reg-choices {
        grid-template-columns: minmax(0, 1fr);
    }

    .reg-steps__label {
        display: none;
    }

    .reg-actions .reg-btn {
        flex: 1 1 100%;
    }

    .reg-controls {
        justify-content: stretch;
    }

    .reg-controls .reg-btn {
        flex: 1 1 0;
    }

    .reg-resume__form {
        width: 100%;
    }

    .reg .reg-resume__form input[type=text] {
        flex: 1 1 auto;
        width: auto;
    }
}
