/**********************************************
 * GLOBAL FORM CONTAINER
 **********************************************/
.form-container {
    background: white;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem;
    animation: slideIn 0.6s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/**********************************************
 * PROGRESS BAR
 **********************************************/
.progress-container {
    position: sticky;
    top: 0;
    background: white;
    padding: 1rem 0;
    z-index: 100;
    margin-bottom: 2rem;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #CDE9EC 0%, #5BA5B2 100%);
    width: 0%;
    transition: width 0.4s ease;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/**********************************************
 * FORM SECTIONS
 **********************************************/
.form-section { display: none; animation: fadeIn 0.4s ease; }
.form-section.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* RTL animation */
body.rtl .form-section { animation: fadeInRTL 0.4s ease; }
@keyframes fadeInRTL {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.section-title {
    font-size: 1.6rem;
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

/**********************************************
 * INPUTS
 **********************************************/
.form-group { margin-bottom: 1.5rem; }

label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.required { color: #e74c3c; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.9rem;
    border: 2px solid #e0e0e0;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: #fff;
    border-radius: 8px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #5BA5B2;
    box-shadow: 0 0 0 3px rgba(91, 165, 178, 0.15);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/**********************************************
 * RADIO & CHECKBOX GROUPS
 **********************************************/
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* --- Clean merged style (replaces all your duplicates) --- */
.radio-item,
.checkbox-item {
    display: flex;
    align-items: flex-start;
    position: relative;
    gap: 12px;
    padding: 12px 14px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

/* Hover */
.radio-item:hover,
.checkbox-item:hover {
    border-color: #5BA5B2;
    box-shadow: 0 4px 12px rgba(91,165,178,0.15);
}

/* Hidden native input */
.radio-item input,
.checkbox-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Text inside */
.radio-item span,
.checkbox-item span {
    line-height: 1.4;
    display: block;
    white-space: normal;
    word-break: break-word;
}

/* Selected state */
.radio-item.selected,
.checkbox-item.selected {
    background: #5BA5B2;
    border-color: #4f929e;
    box-shadow: 0 6px 20px rgba(91,165,178,0.4);
}

.radio-item.selected label,
.checkbox-item.selected label {
  color: #fff!important;
}

/**********************************************
 * FIELD ERROR STATE (FORM VALIDATION)
 **********************************************/
.field-error {
    border-color: #e63946 !important;
    background: #fff5f5 !important;
}

.radio-item.field-error,
.checkbox-item.field-error {
    border-color: #e63946 !important;
    background: #fff5f5 !important;
}

/* Shake animation */
@keyframes shake {
    0%,100% { transform: translateX(0); }
    20%,60% { transform: translateX(-4px); }
    40%,80% { transform: translateX(4px); }
}
.field-error { animation: shake 0.3s ease; }

/**********************************************
 * SELECT2 FIXES
 **********************************************/
.select2-container { width: 100% !important; }

.select2-container--default .select2-selection--multiple {
    min-height: 48px;
    padding: 6px;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px;
    border-radius: 8px;
}

.select2-container--default .select2-selection.field-error {
    border-color: #e63946 !important;
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.2) !important;
}

/**********************************************
 * PROGRAM GROUP GRID
 **********************************************/
.pg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

/**********************************************
 * BUTTONS
 **********************************************/
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #f0f0f0;
}

.btn-next,
.btn-submit {
    flex: 1;
    padding: 1rem 2rem;
    background: #5BA5B2;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-prev, .btn-save-later {
    flex: 1;
    padding: 1rem 2rem;
    background: #f8f9fa;
    color: #333;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.btn-next:hover,
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(91,165,178,0.4);
}

.btn-prev:hover {
    background: #e9ecef;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/**********************************************
 * SUCCESS MESSAGE
 **********************************************/
.success-message {
    display: none;
    text-align: center;
    padding: 2rem;
}

.success-message.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

/**********************************************
 * OTHER FIELD
 **********************************************/
.input-with-other {
    display: none;
    margin-top: 0.5rem;
}

/**********************************************
 * TOOLTIP GLOBAL
 **********************************************/
.global-tooltip {
    position: absolute;
    padding: 12px 16px;
    background: #1e293b;
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    max-width: 260px;
    z-index: 9999;
    display: none;
}

.global-tooltip.show { display: block; }

/**********************************************
 * AJAX LOADER
 **********************************************/
.hs-loader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.hs-loader.show {
    opacity: 1;
    pointer-events: all;
}

.hs-loader-spinner {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: 5px solid rgba(255,255,255,0.25);
    border-top-color: #ff914d;
    animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/**********************************************
 * MOBILE FIXES
 **********************************************/
@media (max-width: 768px) {
    .form-container {
        padding: 2rem 1.5rem;
        margin-top: 60px;
    }

    .pg-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================
   REVIEW STEP (Section 7)
   ============================ */

.review-content {
    margin-top: 1.5rem;
}

.review-table-wrapper {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
    overflow: hidden;
}

.review-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 1rem;
}

.review-table th {
    width: 35%;
    text-align: left;
    padding: 0.9rem 1rem;
    color: #374151;
    font-weight: 600;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    vertical-align: top;
}

.review-table td {
    width: 65%;
    padding: 0.9rem 1rem;
    color: #4b5563;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

/* Rounded corners for first + last rows */
.review-table tr:first-child th {
    border-top-left-radius: 12px;
}
.review-table tr:first-child td {
    border-top-right-radius: 12px;
}
.review-table tr:last-child th {
    border-bottom-left-radius: 12px;
    border-bottom: none;
}
.review-table tr:last-child td {
    border-bottom-right-radius: 12px;
    border-bottom: none;
}

/* Accent on hover (optional but beautiful) */
.review-table tr:hover th,
.review-table tr:hover td {
    background: rgba(91, 165, 178, 0.06); /* Horizon blue soft tint */
}

/* Highlight important rows (optional: DOB, name, etc.) */
.review-table tr.important th,
.review-table tr.important td {
    background: rgba(91, 165, 178, 0.1);
    font-weight: 600;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
    .review-table th,
    .review-table td {
        display: block;
        width: 100%;
        border-right: none;
    }

    .review-table th {
        background: #f8fafc;
        border-bottom: none;
        border-right: none;
        border-radius: 8px 8px 0 0;
    }

    .review-table td {
        border-radius: 0 0 8px 8px;
        padding-top: 0.4rem;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
        border-bottom: 1px solid #e5e7eb;
    }

    .review-table tr {
        margin-bottom: 1rem;
        display: block;
        border-radius: 8px;
        background: #ffffff;
        box-shadow: 0 4px 14px rgba(0,0,0,0.05);
    }
}
[data-section] {
    display: none !important;
    opacity: 0;
    transition: opacity 0.3s ease;
}

[data-section].active {
    display: block !important;
    opacity: 1;
}