/*
 * Registration wizard (Pages/Account/Register, RegisterJoin, Welcome)
 * Palette from 2021.scss: green #81C14B / #468412, navy #172A3A
 */
.wizard {
    --wizard-green: #81C14B;
    --wizard-green-dark: #468412;
    --wizard-navy: #172A3A;
    --wizard-grey: #D5DBE0;
    --wizard-dot: 2.5rem;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
    width: 100%;
    max-width: 34rem;
    margin: 2rem auto 5rem;
    padding: 2rem 2.25rem;
}

.wizard .logo {
    max-width: 16rem;
    margin: 0 auto 1.5rem;
}

.wizard .logo img {
    width: 100%;
}

.wizard h2 {
    font-family: "Ubuntu", sans-serif;
    font-size: 1.5rem;
    color: var(--wizard-navy);
    margin: 0 0 0.5rem;
}

.wizard .wizard-intro {
    color: #5b6b78;
    margin-bottom: 1.5rem;
}

/* ---------- Progress indicator ---------- */
.wizard-progress {
    margin-bottom: 1.75rem;
}

.wizard-steps {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.wizard-step {
    position: relative;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* connector line toward the previous step: grey track + green fill */
.wizard-step + .wizard-step::before,
.wizard-step + .wizard-step::after {
    content: "";
    position: absolute;
    top: calc(var(--wizard-dot) / 2 - 2px);
    right: calc(50% + var(--wizard-dot) / 2 + 0.25rem);
    left: calc(-50% + var(--wizard-dot) / 2 + 0.25rem);
    height: 4px;
    border-radius: 2px;
    background: var(--wizard-grey);
}

.wizard-step + .wizard-step::after {
    background: var(--wizard-green);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.45s ease;
}

.wizard-step.is-done::after,
.wizard-step.is-current::after {
    transform: scaleX(1);
}

.wizard-step-dot {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--wizard-dot);
    height: var(--wizard-dot);
    border-radius: 50%;
    border: 3px solid var(--wizard-grey);
    background: #fff;
    color: #8a98a4;
    font-weight: 700;
    box-sizing: border-box;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.wizard-step.is-current .wizard-step-dot {
    border-color: var(--wizard-green);
    color: var(--wizard-green-dark);
    box-shadow: 0 0 0 0.4rem rgba(129, 193, 75, 0.25);
    transform: scale(1.08);
}

.wizard-step.is-done .wizard-step-dot {
    border-color: var(--wizard-green);
    background: var(--wizard-green);
    color: #fff;
}

/* check mark drawn in CSS for completed steps */
.wizard-step.is-done .wizard-step-num {
    display: none;
}

.wizard-step.is-done .wizard-step-dot::after {
    content: "";
    width: 0.45rem;
    height: 0.85rem;
    margin-top: -0.2rem;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.wizard-step-label {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #8a98a4;
    transition: color 0.3s ease;
}

.wizard-step.is-current .wizard-step-label,
.wizard-step.is-done .wizard-step-label {
    color: var(--wizard-navy);
}

.wizard-progress-caption {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.9375rem;
    color: #5b6b78;
}

.wizard-progress.is-completed .wizard-progress-caption {
    color: var(--wizard-green-dark);
    font-weight: 500;
}

/* ---------- Panels ---------- */
.wizard-panel[hidden] {
    display: none;
}

.wizard-panel.is-entering {
    animation: wizard-panel-in 0.3s ease both;
}

.wizard-panel.is-entering.from-left {
    animation-name: wizard-panel-in-left;
}

@keyframes wizard-panel-in {
    from { opacity: 0; transform: translateX(1.5rem); }
    to { opacity: 1; transform: none; }
}

@keyframes wizard-panel-in-left {
    from { opacity: 0; transform: translateX(-1.5rem); }
    to { opacity: 1; transform: none; }
}

.wizard .form-control {
    height: auto;
    min-height: 2.75rem;
    font-size: 1rem; /* >= 16px avoids iOS zoom on focus */
}

.wizard .form-check {
    margin-bottom: 0.75rem;
}

.wizard .form-check-label {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    font-weight: normal;
    cursor: pointer;
}

.wizard .form-check-input {
    flex: 0 0 auto;
    width: 1.25rem;
    height: 1.25rem;
    margin: 0.1rem 0 0;
}

.wizard .text-danger {
    display: block;
}

.wizard .wizard-note {
    font-size: 0.875rem;
    color: #5b6b78;
    margin-top: 1rem;
}

/* ---------- Navigation buttons ---------- */
.wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
}

.wizard-nav .wizard-nav-primary {
    margin-left: auto;
}

.wizard-nav .btn {
    min-height: 2.75rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    border: 0;
}

/* inset outline instead of a border so both buttons have the same height */
.wizard-nav .btn.alt {
    border: 0;
    box-shadow: inset 0 0 0 2px var(--wizard-green);
}

.wizard .form-control.input-validation-error {
    border-color: #e10a00;
}

.wizard-nav .btn-link {
    padding-left: 0;
    padding-right: 0;
}

.wizard-footer-link {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9375rem;
}

/* ---------- Final message ---------- */
.wizard-done {
    text-align: center;
}

/* site-wide h2:after underline, centered with the heading */
.wizard-done h2:after {
    margin-left: auto;
    margin-right: auto;
}

.wizard-done-icon {
    font-size: 3rem;
    color: var(--wizard-green);
    margin-bottom: 0.75rem;
}

.wizard-done .wizard-team-card {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    background: rgba(129, 193, 75, 0.12);
    text-align: left;
}

.wizard-done .wizard-team-card p {
    margin: 0.2rem 0;
}

.wizard-done .wizard-nav {
    justify-content: center;
    flex-wrap: wrap;
}

.wizard-done .wizard-nav .wizard-nav-primary {
    margin-left: 0;
}

/* ---------- Small screens ---------- */
@media (max-width: 576px) {
    .wizard {
        --wizard-dot: 2.125rem;
        margin: 1rem auto 4rem;
        padding: 1.5rem 1.25rem;
    }

    .wizard .logo {
        max-width: 12rem;
        margin-bottom: 1rem;
    }

    .wizard-step-label {
        display: none;
    }

    .wizard-nav,
    .wizard-done .wizard-nav {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .wizard-nav .btn,
    .wizard-nav .wizard-nav-primary {
        width: 100%;
        margin-left: 0;
    }

    .wizard-nav .btn-link {
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wizard-panel.is-entering,
    .wizard-step-dot,
    .wizard-step + .wizard-step::after {
        animation: none;
        transition: none;
    }
}
