:root {
    --teal: #098ea8;
    --teal-light: #0aa6c3;
    --teal-dark: #066a7d;
    --gray: #6c757d;
    --soft-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    --radius: 14px;
}

#levelOptions {
    display: flex;
    gap: 1rem;
    flex-wrap: nowrap;
}

.invalid-feedback {
    display: none;
    font-size: 0.875rem;
}

.is-invalid + .invalid-feedback,
.is-invalid ~ .invalid-feedback {
    display: block;
}

form label {
    font-weight: 400;
    text-align: left;
    display: block;
}

.level-card {
    flex: 1 1 0;
    min-width: 0;
    border: 1px solid #098ea8;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.level-card:focus,
.sidebar-steps li:focus {
    outline: 3px solid rgba(9, 142, 168, 0.35);
    outline-offset: 2px;
}

.ribbon-wrapper {
    width: 150px;
    height: 150px;
    overflow: hidden;
    position: absolute;
    top: -10px;
    right: -10px;
}

.ribbon-popular {
    text-align: center;
    transform: rotate(45deg);
    position: relative;
    padding: 7px 0;
    left: -5px;
    top: 30px;
    width: 220px;
    background-color: #ffc107;
    color: #000;
    font-size: 0.65rem;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    z-index: 10;
}

.level-card:hover,
.level-card.selected {
    border-color: var(--teal-dark);
    background: #dff8ff;
}

.level-card.disabled-level {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ffffff;
}

h1,
h2,
h4 {
    color: var(--teal-dark);
}

.form-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--soft-shadow);
    padding: 2rem;
}

.progress {
    height: 10px;
    border-radius: 5px;
    background: #dff6fa;
}

.progress-bar {
    background: linear-gradient(90deg, var(--teal-dark), var(--teal));
    border-radius: 5px;
}

.form-step {
    display: none;
}

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

.btn-primary {
    background: var(--teal);
    border-color: var(--teal);
    border-radius: var(--radius);
}

.btn-primary:hover {
    background: var(--teal-dark);
    border-color: var(--teal-dark);
}

.btn-success {
    border-radius: var(--radius);
}

.pi-field,
.org-field {
    display: none;
}

.card-body {
    padding: 2rem !important;
}

.sidebar-steps {
    display: flex;
    justify-content: space-between;
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}
.sidebar-steps::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 12.5%;
    right: 12.5%;
    height: 2px;
    background: #dee2e6;
    z-index: 0;
}
.sidebar-steps li {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 25%;
    cursor: pointer;
    position: relative;
    z-index: 1;
}
.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e9ecef;
    color: #adb5bd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    border: 2px solid #dee2e6;
    transition: all .2s ease;
}
.step-label {
    font-size: .68rem;
    color: #adb5bd;
    margin-top: .35rem;
    text-align: center;
    font-weight: 500;
    transition: color .2s ease;
}
.sidebar-steps li.active .step-num {
    background: #06a0a8;
    border-color: #06a0a8;
    color: #fff;
}
.sidebar-steps li.active .step-label {
    color: #03434f;
    font-weight: 700;
}
.sidebar-steps li.completed .step-num {
    background: #03434f;
    border-color: #03434f;
    color: #fff;
}
.sidebar-steps li.completed .step-label {
    color: #03434f;
}
.sidebar-steps li:focus {
    outline: none;
}

/* Level card collapsible details */
.level-card-details {
    display: none;
    margin-top: .5rem;
}
.level-card-details.open {
    display: block;
}
.level-details-toggle {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: none;
    border: none;
    outline: none;
    box-shadow: none;
    display: block;
    padding: .25rem 0;
    font-size: .75rem;
    font-family: inherit;
    color: #06a0a8;
    cursor: pointer;
    width: 100%;
    text-align: left;
    margin-top: .5rem;
    user-select: none;
}
.level-details-toggle:hover { color: #03434f; text-decoration: underline; }
.level-details-toggle:focus { outline: none; box-shadow: none; }
.level-card.selected .level-card-details.open { display: block; }

.form-narrow {
    max-width: 680px;
    margin: 0 auto;
}

.review-label {
    min-width: 160px;
    font-weight: 500;
}
.review-row { font-size: .85rem; }
.review-row.hidden { display: none !important; }

.form-check {
    min-width: 220px;
    flex: 1 1 auto;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.shake-error {
    animation: shake 0.4s ease-in-out;
}

.level-error-msg {
    background: #fff5f5;
    padding: 10px;
    border-radius: 8px;
    border-left: 4px solid #ff4d4d;
    display: inline-block;
}

.btn-teal-dark {
    background-color: var(--teal-dark);
    border-color: var(--teal-dark);
    color: white;
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.btn-teal-dark:hover {
    background-color: var(--teal);
    border-color: var(--teal);
    color: white;
}

.btn-teal-dark:disabled {
    background-color: var(--gray);
    border-color: var(--gray);
    opacity: 0.6;
}

.eoi-nav-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.level-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 20px;
    text-align: center;
    width: fit-content;
    margin: 0 auto;
}

.badge-recommended {
    background-color: #e3fcf7;
    color: #066a7d;
    border: 1px solid #098ea8;
}

.badge-org-only {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.level-card.disabled-style {
    opacity: 0.6;
    filter: grayscale(0.5);
    background-color: #fcfcfc;
    border-style: dashed;
}

@media (max-width: 767.98px) {
    #levelOptions,
    .eoi-nav-buttons {
        gap: 0.6rem;
    }

    #levelOptions {
        flex-wrap: wrap;
    }
    .level-card {
        flex: 1 1 45%;
        min-width: 0;
    }
    .form-check {
        flex-basis: 100%;
        min-width: 0;
    }

    .form-card {
        border-radius: 10px;
        padding: 1rem;
    }

    .card-body {
        padding: 1rem !important;
    }

    .sidebar-steps {
        flex-direction: column;
        gap: 0.45rem;
    }

    .sidebar-steps li {
        border: 1px solid #dff6fa;
        border-radius: 8px;
    }

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

    .ribbon-wrapper {
        transform: scale(0.82);
        transform-origin: top right;
    }
}
