/* General Animation & Helper */
.hidden {
    display: none !important;
}

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

.form-step {
    animation: fadeIn 0.5s ease-in-out;
}

/* Intro Box at the Top of the Form */
.intro-box {
    background-color: #eff6ff;
    border-right: 4px solid #a0aec0;
    padding: 1rem;
    margin-bottom: 2.5rem;
    border-radius: 0.5rem;
    color: #374151;
    line-height: 1.75;
    text-align: justify;
}

/* ================================================= */
/* SECTION: Stepper / Progress Bar (NEW & FINAL DESIGN) */
/* ================================================= */

.stepper-wrapper {
    display: flex;
    border-bottom: 2px solid #e2e8f0; /* The main gray track */
    margin-bottom: 3rem;
}

.stepper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    color: #a0aec0; /* Default text color */
    padding-bottom: 1rem;
    border-bottom: 4px solid transparent; /* Placeholder for the active/completed underline */
    position: relative;
    top: 2px; /* Align the new border with the main track */
    transition: all 0.3s ease;
}

.step-counter {
    height: 2.5rem;
    width: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background-color: #e2e8f0;
    font-weight: 700;
    transition: all 0.3s ease;
}

.step-name {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Active Step Style */
.stepper-item.active {
    color: var(--brand-secondary); /* Darker text for active step */
    border-bottom-color: var(--brand-primary); /* Blue underline */
}

.stepper-item.active .step-counter {
    background-color: var(--brand-primary);
    color: black;
}

.stepper-item.active .step-name {
    font-weight: 700;
}

/* Completed Step Style */
.stepper-item.completed {
    color: var(--brand-secondary);
}

.stepper-item.completed .step-counter {
    background-color: var(--brand-secondary);
    color: white;
}

.stepper-item.completed .step-name {
    font-weight: 600;
}


/* Form Step Titles */
.form-step-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-secondary);
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--brand-primary);
    padding-bottom: 0.75rem;
}

/* Product Selection Cards */
.product-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.product-card {
    position: relative;
    cursor: pointer;
}

.product-card-content {
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

.product-card:hover .product-card-content {
    border-color: var(--brand-primary);
    transform: translateY(-4px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.product-radio {
    position: absolute;
    opacity: 0;
}

.product-radio:checked + .product-card-content {
    border-color: var(--brand-secondary);
    box-shadow: 0 0 0 3px rgba(95, 102, 102, 0.2);
}

.product-image {
    width: 100%;
    height: 160px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.product-name {
    font-weight: 600;
    color: #4a5568;
}

/* General Form Fields & Spacing */
.form-fields-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.form-field img {
    max-width: 100%;
    height: auto;
    max-height: 250px;
    display: block;
    margin: 1.5rem auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #2d3748;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e0;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--brand-secondary);
    box-shadow: 0 0 0 3px rgba(95, 102, 102, 0.2);
}

.form-error-message {
    color: var(--toast-error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    height: 1rem;
}

/* Choice (Radio/Checkbox) Styling */
.choice-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.choice-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.choice-label:has(input:checked) {
    border-color: var(--brand-secondary);
    background-color: white;
    box-shadow: 0 0 0 2px rgba(95, 102, 102, 0.2);
}

.choice-label input {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--brand-secondary);
}

.choice-label span {
    font-weight: 500;
}

/* Navigation Buttons */
.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 1.5rem;
}

.nav-btn {
    font-size: 1rem;
    font-weight: 700;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.1);
}

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

#prev-btn {
    background-color: #e2e8f0;
    color: #4a5568;
}

#prev-btn:hover:not(:disabled) {
    background-color: #cbd5e0;
}

#next-btn, #submit-btn {
    background-color: var(--brand-secondary);
    color: white;
}

#next-btn:hover:not(:disabled), #submit-btn:hover:not(:disabled) {
    background-color: #4a5050;
}

/* --- Loading Overlay Styles --- */
.loader {
    border: 5px solid #f3f3f3; /* Light grey */
    border-top: 5px solid var(--brand-secondary); /* Brand color */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

#step-2 input,
#step-2 textarea,
#step-3 input,
#step-3 textarea {
    direction: rtl;
    text-align: right;
}

#step-2 input::placeholder,
#step-2 textarea::placeholder,
#step-3 input::placeholder,
#step-3 textarea::placeholder {
    direction: rtl;
    text-align: right;
}

