/* ====================================================== */
/* 1. MAIN MODAL CONTAINER & OVERLAY                      */
/* ====================================================== */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    
    
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

.modal-container.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.modal-active {
    overflow: hidden;
}

body.modal-active > *:not(.modal-container) {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 25, 47, 0.6);
    backdrop-filter: blur(3px);
    z-index: 1;
}

/* ====================================================== */
/* 2. MODAL CONTENT BOX                                   */
/* ====================================================== */
.modal-content {
    position: relative;
    z-index: 2;
    background-color: var(--color-white);
    color: var(--color-dark);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 900px;
    max-height: 90vh; /* Prevents modal from being taller than viewport */
    overflow-y: auto; /* Adds scrolling for long content */
    -webkit-overflow-scrolling: touch;
    padding: 40px;
    border-top: 4px solid var(--color-primary);
    transform: scale(0.95);
    transition: transform 0.3s ease-in-out;
}

.modal-container.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 2rem;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    transition:
        color 0.2s,
        transform 0.2s;
}
.modal-close:hover {
    color: var(--color-dark);
    transform: rotate(90deg);
}

/* ====================================================== */
/* 3. PROGRESS BAR                                        */
/* ====================================================== */
.progress-bar-container {
    padding: 0 5px;
    margin-bottom: 30px;
}

.progress-bar-track {
    width: 100%;
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background-color: var(--color-primary);
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====================================================== */
/* 4. STEP CONTAINER & ANIMATIONS                         */
/* ====================================================== */
.modal-steps-container {
    position: relative;
    /* **FIX** Removed fixed height, added min-height for consistent look on desktop */
    min-height: 540px;
    overflow: hidden;
}

.modal-step {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(30px);
    pointer-events: none;
    transition:
        opacity 0.4s ease,
        transform 0.4s ease;
}

.modal-step.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.modal-step.exiting {
    transform: translateX(-30px);
}

/* ====================================================== */
/* 5. TYPOGRAPHY & COMMON ELEMENTS                        */
/* ====================================================== */
.step-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    color: var(--color-text-black);
    margin-bottom: 8px;
}

.step-subtitle {
    font-size: 1rem;
    color: var(--color-dark);
    margin-bottom: 25px;
}

.step-nav {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    width: 100%;
}

/* ====================================================== */
/* 6. INTERACTIVE ELEMENTS (BUTTONS, CARDS, INPUTS)     */
/* ====================================================== */
.btn-next,
.btn-prev,
.btn-submit,
.btn-close-modal {
    padding: 12px 25px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-next,
.btn-submit {
    background-color: var(--color-primary);
    color: var(--color-white);
    border: 1px solid var(--color-primary);
}
.btn-next:hover,
.btn-submit:hover {
    background-color: #0077d9;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 140, 255, 0.2);
}

.btn-prev {
    background-color: transparent;
    color: var(--color-dark);
    border: 1px solid #cbd5e1;
}
.btn-prev:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
}

.btn-next:disabled,
.btn-submit:disabled {
    background-color: #e2e8f0;
    border-color: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.option-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.radio-card {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-card:hover {
    border-color: #94a3b8;
    transform: translateY(-3px);
}

.radio-card input[type="radio"] {
    display: none;
}

.radio-card.selected {
    border-color: var(--color-primary);
    background-color: #f0f9ff;
    box-shadow: 0 0 0 3px rgba(0, 140, 255, 0.2);
}

.radio-card .card-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}
.radio-card .card-content i {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 10px;
    display: block;
}
.radio-card .card-content strong {
    display: block;
    color: var(--color-text-black);
    margin-bottom: 5px;
}
.radio-card .card-content span {
    font-size: 0.85rem;
    color: var(--color-dark);
    max-width: 150px;
}

.option-group-small {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.option-group-small label {
    display: inline-block;
}
.option-group-small input[type="radio"] {
    display: none;
}
.option-group-small label span {
    display: inline-block;
    padding: 10px 20px;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.option-group-small label:hover span {
    border-color: var(--color-primary);
}
.option-group-small input[type="radio"]:checked + span {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.modal-input,
textarea {
    width: 100%;
    padding: 12px 15px;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    margin-bottom: 15px;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}
.modal-input:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 140, 255, 0.2);
}
textarea {
    min-height: 160px;
    resize: vertical;
}
.modal-input.has-error,
textarea.has-error {
    border-color: #ef4444; /* Red for error */
}

/* ====================================================== */
/* 7. FINAL "THANK YOU" STEP                              */
/* ====================================================== */
#final-step {
    text-align: center;
    justify-content: center;
}
.success-icon {
    font-size: 4rem;
    color: #22c55e;
    margin-bottom: 20px;
}

.auto-close-progress-bar {
    width: 80%;
    height: 4px;
    background-color: #e2e8f0;
    border-radius: 2px;
    margin: 30px auto 0 auto;
}
.auto-close-fill {
    width: 100%;
    height: 100%;
    background-color: #22c55e;
    border-radius: 2px;
    transform: translateX(-100%);
    animation: fillToClose 3s linear forwards;
}

@keyframes fillToClose {
    to {
        transform: translateX(0);
    }
}

/* ====================================================== */
/* 8. RESPONSIVENESS                                      */
/* ====================================================== */
@media screen and (max-width: 768px) {
    .modal-content {
        padding: 30px 20px;
        max-width: 95vw;
        max-height: 85vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-steps-container {
        /* **FIX** Height is now flexible and overflow is visible */
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .modal-step {
        /* **FIX** Steps no longer need to be absolutely positioned, they can flow naturally */
        position: relative;
        height: auto;
        opacity: 1;
        transform: none;
        pointer-events: auto;
        display: none; /* Hide all steps by default */
    }

    .modal-step.active {
        display: flex; /* Show only the active step */
    }

    .step-title {
        font-size: 1.5rem;
    }

    .option-group {
        grid-template-columns: 1fr;
    }

    .radio-card .card-content {
        min-height: auto;
        padding: 10px 0;
    }
}


/* ====================================================== */
/* 9. PREMIUM CONTACT MODAL REDESIGN                      */
/* ====================================================== */
.simple-content-wrapper {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    max-width: 1000px !important;
}

.simple-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 650px;
}

.simple-form-col {
    padding: 60px;
    background: white;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

.simple-heading {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--color-dark);
    margin-bottom: 10px;
}

.simple-sub {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 30px;
}

.simple-contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-primary);
}

.input-group input, 
.input-group textarea {
    padding: 12px 0;
    border: none;
    border-bottom: 2px solid #e2e8f0;
    background: transparent;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-group input:focus, 
.input-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.simple-map-col {
    position: relative;
    overflow: hidden;
}

.simple-map-col iframe {
    filter: grayscale(1) contrast(1.2) opacity(0.8);
    transition: filter 0.5s ease;
}

.simple-map-col:hover iframe {
    filter: grayscale(0.5) contrast(1) opacity(1);
}

.premium-tag {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: block;
}

/* Custom Styled Select */
.styled-select-wrapper {
    position: relative;
    width: 100%;
}

.styled-select {
    appearance: none;
    width: 100%;
    padding: 15px 0;
    border: none;
    border-bottom: 2px solid #eee;
    background: transparent;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-dark);
    cursor: pointer;
    transition: border-color 0.3s;
}

.styled-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.select-icon {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #94a3b8;
}

/* ====================================================== */
/* 10. CALENDAR MODAL STYLES                              */
/* ====================================================== */
.calendar-content-wrapper {
    max-width: 1100px;
    padding: 60px;
}

.calendar-header {
    text-align: center;
    margin-bottom: 40px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.month-box {
    background: #f8fafc;
    padding: 25px;
    border-radius: 15px;
    border: 1px solid #e2e8f0;
}

.month-name {
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 15px;
    display: block;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 5px;
}

.event-item {
    font-size: 0.85rem;
    margin-bottom: 12px;
    display: flex;
    gap: 10px;
}

.event-date {
    font-weight: 700;
    min-width: 45px;
}

.event-name {
    color: #475569;
}

@media screen and (max-width: 768px) {
    .simple-modal-grid {
        grid-template-columns: 1fr;
        height: auto;
    }
    .simple-form-col {
        padding: 40px 25px;
    }
    .simple-map-col {
        height: 250px;
    }
    .calendar-content-wrapper {
        padding: 40px 20px;
    }
}
