:root {
    --primary-color: #0e1937;
    --success-color: #10b981;
    --danger-color: #ff4521;
    --warning-color: #f59e0b;
    --gray-100: #f8fafc;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg:
        0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Layout */
.stepper-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}
.stepper-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.stepper-header {
    background: var(--primary-color);
    color: #fff;
    padding: 2rem;
    text-align: center;
    position: relative;
}
.stepper-header h2 {
    margin: 0;
    font-weight: 700;
    font-size: 2rem;
}
.stepper-header p {
    margin: 0.5rem 0 0;
    opacity: 0.9;
}
.stepper-body {
    padding: 2rem;
    overflow: auto;
    max-height: calc(100vh - 12rem);
}

/* Close button */
.close-stepper {
    position: absolute;
    top: 2rem;
    right: 1rem;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Stepper Nav */
.stepper-nav {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 0 20px;
}
.stepper-nav::before {
    content: "";
    position: absolute;
    top: 25px;
    left: 5%;
    right: 5%;
    height: 3px;
    background: var(--gray-200);
    border-radius: 3px;
    z-index: 1;
}

/* Progress line */
.progress-line {
    position: absolute;
    top: 25px;
    left: 5%;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--primary-color),
        var(--danger-color)
    );
    border-radius: 3px;
    z-index: 2;
    width: 0;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Step item */
.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    flex: 1 1 0;
    min-width: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}
.step-item:hover .step-circle {
    transform: scale(1.05);
}
.step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    border: 3px solid var(--gray-300);
    color: var(--gray-500);
    position: relative;
    overflow: hidden;
    margin-bottom: 8px;
}
.step-circle::before {
    content: "";
    position: absolute;
    inset: 0;
    left: -100%;
    transition: left 0.5s;
}
.step-item.active .step-circle::before {
    left: 100%;
}

/* Step title */
.step-title {
    display: block;
    max-width: 120px;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--gray-500);
}

/* States */
.step-item.completed .step-circle {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.step-item.completed .step-title {
    color: var(--primary-color);
}
.step-item.active .step-circle {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: #fff;
    box-shadow: 0 4px 12px var(--danger-color);
    transform: scale(1.1);
}
.step-item.active .step-title {
    color: var(--danger-color);
    font-weight: 700;
}
.step-item.error .step-circle {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    border-color: var(--danger-color);
    color: #fff;
    animation: shake 0.5s ease-in-out;
}
.step-item.error .step-title {
    color: var(--danger-color);
}

/* Content */
.step-content {
    display: none;
    animation: fadeInUp 0.5s ease-out;
    min-height: 400px;
}
.step-content.active {
    display: block;
}
.content-card {
    background: var(--gray-100);
    border-radius: 15px;
    padding: 1rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}
.content-card.focus {
    background: #fff;
}
.content-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.content-title i {
    color: var(--primary-color);
}

/* Form */
.form-floating {
    margin-bottom: 1.5rem;
}
.form-floating > .form-control,
.form-floating.custom-file-floating > .form-control,
.form-floating > .form-select {
    height: 3.5rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}
.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 25, 55, 0.12);
}
.form-floating > label {
    color: var(--gray-500);
    font-weight: 500;
}
.form-check {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 10px;
    border: 2px solid var(--gray-200);
    transition: all 0.3s ease;
}
.form-check:hover {
    border-color: var(--primary-color);
}
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.form-check-label {
    font-weight: 500;
    color: var(--gray-700);
}

/* Validation */
.is-invalid {
    border-color: var(--danger-color) !important;
}

.invalid-feedback {
    display: none;
    font-weight: 500;
    margin-top: 0.5rem;
}

.form-floating .is-invalid ~ .invalid-feedback {
    display: block;
}

/* Review */
.review-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 2px solid var(--gray-200);
    transition: all 0.3s ease;
}
.review-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}
.review-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-100);
}
.review-header i {
    color: var(--primary-color);
    font-size: 1.2rem;
}
.review-header h6 {
    margin: 0;
    font-weight: 600;
    color: var(--gray-800);
}
.review-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
}
.review-item:last-child {
    border-bottom: none;
}
.review-label {
    flex: 0 0 auto;
    max-width: 55%;
    font-weight: 500;
    color: var(--gray-600);
}
.review-value {
    flex: 1 1 auto;
    min-width: 0;
    text-align: right;
    font-weight: 600;
    color: var(--gray-800);
    word-break: break-word;
}

/* Actions */
.stepper-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 2px solid var(--gray-200);
}
.btn-stepper {
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    min-width: 120px;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}
.btn-stepper::before {
    content: "";
    position: absolute;
    inset: 0;
    left: -100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}
.btn-stepper:hover::before {
    left: 100%;
}
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    color: #fff;
}
.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
}
.btn-success-custom {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: #fff;
}
.btn-success-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}
.btn-secondary-custom {
    background: var(--gray-200);
    color: var(--gray-700);
}
.btn-secondary-custom:hover {
    background: var(--gray-300);
    transform: translateY(-2px);
}

.force-hide {
    transition: none !important;
    display: none !important;
}
.account_modal:not(.active) #prevBtn,
.account_modal.force-hide #prevBtn {
    display: none !important;
}

.custom-file-floating label {
    position: absolute;
    top: -5px;
    left: 0;
    z-index: 2;
    max-width: 100%;
    height: 100%;
    padding: 1rem 0.75rem;
    overflow: hidden;
    color: rgba(var(--bs-body-color-rgb), 0.65);
    text-align: start;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
    border: var(--bs-border-width) solid transparent;
    transform-origin: 0 0;
    transition:
        opacity 0.1s ease-in-out,
        transform 0.1s ease-in-out;
}

.custom-file-floating .form-control {
    /* display: block; */
    width: 100%;
    height: 44px;
    border-radius: 3px;
    padding: 5px 20px;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ddd;
    transition:
        border-color 0.15s ease-in-out,
        box-shadow 0.15s ease-in-out;
}

.filepond--root .filepond--panel-root {
    border: 2px solid #ced4da;
    border-radius: 12px;
    box-shadow: none;
}

.filepond--root.is-invalid .filepond--panel-root {
    border-color: #dc3545 !important;
    box-shadow: none !important;
}

.filepond--root.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Animations */
@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.loading {
    animation: pulse 1s infinite;
}
.success-animation {
    text-align: center;
    padding: 3rem 1rem;
}
.success-icon {
    font-size: 4rem;
    color: var(--success-color);
    animation: bounceIn 1s ease-out;
}
.form-floating > .select2-container {
    width: 100% !important;
}

.form-floating > .select2-container .select2-selection--single {
    height: calc(3.5rem + 2px);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
    padding-left: 0.625rem;
    display: flex;
    align-items: center;
}

.form-floating > .select2-container .select2-selection__rendered {
    line-height: 1.25rem;
    padding-left: 0;
    margin-top: 0;
    color: var(--gray-700);
}

.select2-container .select2-selection__placeholder {
    color: var(--gray-500);
}

.form-floating > .select2-container .select2-selection__arrow {
    height: 100%;
    right: 0.75rem;
}

.form-floating > .select2-container .select2-selection--single:focus,
.form-floating > .select2-container .select2-selection--single:focus-visible {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 25, 55, 0.12);
    outline: none;
}

.is-invalid + .select2 .select2-selection {
    border-color: var(--danger-color) !important;
    box-shadow: none !important;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 992px) {
    .step-title {
        max-width: 90px;
    }
}
@media (max-width: 768px) {
    .stepper-container {
        margin: 1rem;
        padding: 1rem;
    }
    .stepper-nav {
        flex-direction: column;
        gap: 1.5rem;
    }
    .stepper-nav::before,
    .progress-line {
        display: none;
    }
    .step-item {
        display: none;
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
        gap: 1rem;
        padding: 1rem;
        background: #fff;
        border-radius: 12px;
        border: 2px solid var(--gray-200);
    }
    .step-item.active {
        display: flex;
    }
    .step-circle {
        width: 20px;
        height: 20px;
        font-size: 1rem;
        margin-bottom: 0;
    }
    .step-title {
        margin: 0;
        text-align: left;
        max-width: unset;
    }
    .stepper-actions {
        flex-direction: column-reverse;
        gap: 1rem;
    }
    .btn-stepper {
        width: 100%;
    }
    .stepper-body {
        padding: 5px;
    }
    .stepper-header h2 {
        margin: 0;
        font-weight: 700;
        font-size: 1.25rem;
    }
}
@media (max-width: 576px) {
    .step-item.active .step-title {
        display: block;
        max-width: 140px;
    }
    .content-title {
        font-size: 1.25rem;
    }
    /* Review cards */
    .review-card {
        padding: 0.875rem;
    }
    .review-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }
    .review-label {
        max-width: 100%;
        font-size: 0.78rem;
        color: var(--gray-400);
    }
    .review-value {
        text-align: left;
        font-size: 0.9rem;
    }
    /* Checkboxes */
    .form-check {
        padding: 0.75rem;
        gap: 0.6rem;
    }
}

/* ── Account Type Selection ── */
.type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2.5rem 1.5rem;
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    color: var(--gray-700);
}
.type-card i {
    font-size: 3rem;
    color: var(--primary-color);
    transition: transform 0.25s ease;
}
.type-card h5 {
    font-weight: 700;
    font-size: 1.15rem;
    margin: 0;
    color: var(--gray-800);
}
.type-card p {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0;
}
.type-card:hover {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}
.type-card:hover i {
    transform: scale(1.15);
}
.type-card:focus {
    outline: none;
    border-color: var(--danger-color);
}
@media (max-width: 576px) {
    .type-card {
        padding: 1.75rem 1rem;
    }
    .type-card i {
        font-size: 2.25rem;
    }
}
