main{
    margin-top: 125px;
    background-image: url(/assets/index-assets/background.png);
    background-size: cover;
    background-position: center;
    width: 100%;
    height: 100%;
}

/* Accessibility helper */
.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;
}

.signup-section {
    min-height: calc(100vh - 200px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 20px 80px;
    /* background: var(--primary-color); */
}

.signup-card {
    width: 100%;
    max-width: 640px;
    background: var(--white);
    border-radius: 24px;
    padding: 48px 48px 40px;
    box-shadow: 0 8px 30px color-mix(in srgb, var(--black) 6%, transparent);
}

.progress {
    margin-bottom: 36px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--black);
}

.progress-step-label {
    opacity: 0.7;
}

.progress-percent {
    color: var(--accent-color);
    font-weight: 700;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: var(--secondary-color);
    border-radius: 50px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 17%;
    background: var(--accent-color);
    border-radius: 50px;
    transition: width 0.4s ease-in-out;
}

.signup-form {
    display: flex;
    flex-direction: column;
}

.form-step {
    border: none;
    padding: 0;
    margin: 0;
    display: none;
    animation: fadeStepIn 0.35s ease-in-out;
}

.form-step.is-active {
    display: block;
}

@keyframes fadeStepIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-title {
    font-family: var(--main-font);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--black);
    margin: 0 0 10px;
    line-height: 1.3;
}

.step-subtitle {
    font-size: 1rem;
    color: var(--black);
    opacity: 0.7;
    margin: 0 0 28px;
    line-height: 1.5;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.form-field label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 8px;
}

.form-field input {
    font-family: var(--main-font);
    font-size: 1rem;
    padding: 14px 16px;
    border: 2px solid var(--secondary-color);
    border-radius: 12px;
    background: var(--primary-color);
    color: var(--black);
    transition: border-color 0.2s ease-in-out, background 0.2s ease-in-out;
    width: 100%;
}

.form-field input::placeholder {
    color: var(--black);
    opacity: 0.4;
}

.form-field input:hover {
    border-color: var(--tertiary-color);
}

.form-field input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--white);
}

.form-field input.is-invalid {
    border-color: var(--accent-color);
    background: var(--secondary-color);
}

.error-message {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 600;
    margin: 8px 0 0;
    min-height: 1.2em;
}

.error-message:empty {
    margin: 0;
    min-height: 0;
}

.role-question {
    font-size: 1rem;
    font-weight: 600;
    color: var(--black);
    margin: 0 0 16px;
    grid-column: 1 / -1;
}

.role-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.role-card,
.level-card {
    cursor: pointer;
    display: block;
}

.role-card input,
.level-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.role-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
    border: 2px solid var(--secondary-color);
    border-radius: 16px;
    background: var(--primary-color);
    transition: border-color 0.2s ease-in-out, background 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.role-card-inner:hover {
    border-color: var(--tertiary-color);
    transform: translateY(-2px);
}

.role-card input:checked + .role-card-inner {
    border-color: var(--accent-color);
    background: var(--secondary-color);
}

.role-card input:focus-visible + .role-card-inner {
    outline: 3px solid var(--tertiary-color);
    outline-offset: 2px;
}

.role-emoji {
    font-size: 2.25rem;
    margin-bottom: 8px;
}

.role-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 4px;
}

.role-desc {
    font-size: 0.85rem;
    color: var(--black);
    opacity: 0.7;
}

.level-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.level-card-inner {
    display: flex;
    flex-direction: column;
    padding: 18px 20px;
    border: 2px solid var(--secondary-color);
    border-radius: 12px;
    background: var(--primary-color);
    transition: border-color 0.2s ease-in-out, background 0.2s ease-in-out;
}

.level-card-inner:hover {
    border-color: var(--tertiary-color);
}

.level-card input:checked + .level-card-inner {
    border-color: var(--accent-color);
    background: var(--secondary-color);
}

.level-card input:focus-visible + .level-card-inner {
    outline: 3px solid var(--tertiary-color);
    outline-offset: 2px;
}

.level-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 2px;
}

.level-desc {
    font-size: 0.85rem;
    color: var(--black);
    opacity: 0.7;
}

.password-rules {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.password-rules li {
    font-size: 0.8rem;
    color: var(--black);
    opacity: 0.55;
    position: relative;
    padding-left: 18px;
    transition: color 0.2s ease-in-out, opacity 0.2s ease-in-out;
}

.password-rules li::before {
    content: "○";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
}

.password-rules li.is-met {
    color: var(--accent-color);
    opacity: 1;
}

.password-rules li.is-met::before {
    content: "✓";
}

.review-list {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.review-row {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--primary-color);
    border: 2px solid var(--secondary-color);
    border-radius: 12px;
}

.review-row dt {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--black);
    opacity: 0.6;
    margin: 0;
}

.review-row dd {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--black);
    word-break: break-word;
}

.review-edit {
    background: transparent;
    border: none;
    color: var(--accent-color);
    font-family: var(--main-font);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.2s ease-in-out;
}

.review-edit:hover,
.review-edit:focus-visible {
    background: var(--secondary-color);
    outline: none;
}

.form-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.nav-btn {
    flex: 1;
    min-width: 140px;
    padding: 14px 24px;
    font-family: var(--main-font);
    font-size: 1rem;
    cursor: pointer;
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-btn:disabled:hover {
    transform: none;
}

.nav-btn-submit {
    display: none;
}

.nav-btn-submit.is-visible {
    display: flex;
}

#next-btn.is-hidden {
    display: none;
}

.signup-footer-text {
    text-align: center;
    margin: 28px 0 0;
    font-size: 0.95rem;
    color: var(--black);
    opacity: 0.75;
}

.signup-footer-link {
    color: var(--accent-color);
    font-weight: 700;
    text-decoration: none;
}

.signup-footer-link:hover {
    text-decoration: underline;
}

.success-modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: color-mix(in srgb, var(--black) 50%, transparent);
    padding: 20px;
    z-index: 1000;
    animation: fadeIn 0.25s ease-in-out;
}

.success-modal.is-open {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.success-modal-card {
    background: var(--white);
    border-radius: 24px;
    padding: 48px 36px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px color-mix(in srgb, var(--black) 20%, transparent);
    animation: popIn 0.35s ease-in-out;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.success-icon {
    width: 72px;
    height: 72px;
    line-height: 72px;
    border-radius: 50%;
    background: var(--tertiary-color);
    color: var(--white);
    font-size: 2.4rem;
    font-weight: 700;
    margin: 0 auto 20px;
}

.success-title {
    font-family: var(--main-font);
    font-size: 1.6rem;
    color: var(--black);
    margin: 0 0 12px;
}

.success-message {
    font-size: 1rem;
    color: var(--black);
    opacity: 0.75;
    margin: 0 0 28px;
    line-height: 1.5;
}

.success-btn {
    display: inline-flex;
    width: 100%;
    justify-content: center;
}

@media (max-width: 720px) {
    .signup-card {
        padding: 32px 24px 28px;
        border-radius: 20px;
    }

    .step-title {
        font-size: 1.4rem;
    }

    .step-subtitle {
        font-size: 0.95rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .role-options {
        grid-template-columns: 1fr;
    }

    .review-row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 14px;
    }

    .review-edit {
        justify-self: end;
    }

    .form-nav {
        flex-direction: column-reverse;
    }

    .nav-btn {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .signup-section {
        padding: 32px 12px 60px;
    }

    .signup-card {
        padding: 28px 20px 24px;
    }
}
