.ikitchen-form-container,
.ikitchen-form-container * {
    font-family: 'Tajawal', sans-serif !important;
}

.ikitchen-form-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.ikitchen-form-container h3 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 19px;
}

.required {
    color: #e53935;
}

.form-step {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.form-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Image Radio Buttons */
.image-radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

/* Force 3 columns on desktop for Step 5 */
@media (min-width: 601px) {
    #step-5 .image-radio-group {
        grid-template-columns: repeat(3, 1fr);
    }
}

.image-radio {
    cursor: pointer;
    text-align: center;
    border: 2px solid #eee;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 220px;
    /* Fixed height to unify all cards */
}

.image-radio input[type="radio"] {
    display: none;
    /* Safely hide without taking space */
}

.image-radio img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    object-position: top;
    display: block;
}

/* Step 3 specific sizing (shorter cards) */
#step-3 .image-radio {
    height: 180px;
}
#step-3 .image-radio img {
    height: 120px;
}

.image-radio .radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 5px;
    margin: 0;
    font-weight: bold;
    font-size: 14px;
    color: #555;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    transition: all 0.3s ease;
}

/* Checked State */
.image-radio input[type="radio"]:checked+img {
    opacity: 0.9;
}

.image-radio input[type="radio"]:checked~.radio-label {
    background: #e53935;
    color: #fff;
    border-top-color: #e53935;
}

.image-radio:has(input[type="radio"]:checked) {
    border-color: #e53935;
    box-shadow: 0 0 10px rgba(229, 57, 53, 0.2);
}

/* Text Checkboxes (No Images) */
.text-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
}

.text-checkbox {
    cursor: pointer;
    position: relative;
    display: inline-block;
}

.text-checkbox input[type="checkbox"] {
    display: none;
}

.text-checkbox .checkbox-label {
    display: block;
    padding: 12px 24px;
    background: #f9f9f9;
    border: 2px solid #ddd;
    border-radius: 8px;
    color: #555;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
    user-select: none;
}

.text-checkbox:hover .checkbox-label {
    border-color: #e53935;
    color: #e53935;
}

.text-checkbox input[type="checkbox"]:checked ~ .checkbox-label {
    background: #e53935;
    color: #fff;
    border-color: #e53935;
    box-shadow: 0 4px 10px rgba(229, 57, 53, 0.2);
}

/* Form Inputs */
.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 250px;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #444;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="email"]:focus {
    border-color: #e53935;
    outline: none;
}

/* Inline Radio Buttons */
.radio-group-inline {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-group-inline label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

/* Actions */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.form-actions button {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-prev {
    background: #f1f1f1;
    color: #333;
}

.btn-prev:hover {
    background: #e1e1e1;
}

.btn-next,
.btn-submit {
    background: #555;
    color: #fff;
}

.btn-next:hover,
.btn-submit:hover {
    background: #333;
}

.btn-submit {
    background: #e53935;
}

.btn-submit:hover {
    background: #c62828;
}

.form-actions:has(.btn-prev) {
    justify-content: center;
}

.form-actions:not(:has(.btn-prev)) {
    justify-content: center;
}

/* Custom Phone Input Wrapper */
.phone-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    transition: border-color 0.3s;
    overflow: hidden;
    direction: rtl; /* Indicator on the right */
}

.phone-input-wrapper:focus-within {
    border-color: #e53935;
}

.country-indicator {
    display: flex;
    align-items: center;
    padding-right: 6px;
    padding-left: 6px;
    background: #f9f9f9;
    border-left: 1px solid #ddd;
    height: 100%;
    min-height: 44px;
    width: 100px;
    justify-content: space-between;
}

.country-indicator img {
    width: 24px;
    height: auto;
    margin-left: 4px; /* space between flag and code */
    border-radius: 2px;
}

.country-indicator span {
    font-weight: bold;
    color: #555;
    font-size: 15px;
    direction: ltr; /* +966 */
}

.phone-input-wrapper input[type="tel"] {
    border: none;
    border-radius: 0;
    width: 100%;
    outline: none;
    padding: 12px 15px;
    text-align: right;
    direction: ltr;
}

/* Message */
.form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    display: none;
    text-align: center;
    font-weight: bold;
}

.form-message.success {
    display: block;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.form-message.error {
    display: block;
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .ikitchen-form-container {
        padding: 10px 14px !important;
        border-radius: 0;
        box-shadow: none;
    }
    
    .image-radio-group {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .image-radio {
        flex: 0 0 calc(50% - 5px);
        max-width: calc(50% - 5px);
        height: 195px; 
    }

    #step-3 .image-radio {
        height: 175px;
    }

    .image-radio img {
        height: 135px;
    }

    #step-3 .image-radio img {
        height: 115px;
    }

    .image-radio .radio-label {
        font-size: 15px;
        padding: 5px;
    }

    .text-checkbox .checkbox-label {
        padding: 8px 16px;
        font-size: 14px;
    }
}