/* ============================================
   MODAL COMPONENT - REUSABLE
   ============================================ */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(4 12 24 / 90%);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.modal-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease;
    z-index: 9999;
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.modal-header {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: #eceef6;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;

}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title i {
    color: var(--primary-color-text);
    font-size: 18px;
}

/* Close Button */
.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: white;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    flex-shrink: 0;

}

.modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: rotate(90deg);
}

.modal-close i {
    font-size: 16px;
}

/* Modal Body */
.modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

.verification-flow {
    width: 100%;
}

.verification-flow-modal-body {
    overflow-y: auto;
    max-height: min(70vh, 640px);
    padding: 20px 24px 24px;
}

.vf-alt {
    margin-top: 8px;
}

.vf-header {
    display: flex;
    align-items: center;
    padding: 16px;
}

.vf-sep {
    width: 100%;
    height: 0;
    margin: 0 0 14px;
    border: 0;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.vf-help {
    display: inline-flex;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary-color-text, #444db0);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.vf-help:hover {
    text-decoration: underline;
}

.vf-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary-color-text, #444db0);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.vf-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    margin-top: 16px;
}

.vf-footer-actions--spread {
    justify-content: space-between;
    margin-top: 0;
}

.vf-alt .vf-footer-actions {
    margin-top: 0;
}

.vf-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vf-item {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    overflow: visible;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    margin-bottom: 10px;
}

.vf-item.is-open {
    border-color: #c7c9ef;
    box-shadow: 0 4px 14px rgba(46, 50, 147, 0.08);
}

.vf-item--recovery.is-open {
    border-color: #b7e4c7;
}

.vf-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 16px 16px;
    border: 0;
    background: transparent;
    color: #1f2937;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.vf-trigger-main {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    min-width: 0;
}

.vf-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 15px;
}

.vf-icon--email {
    background: #eef0fb;
    color: var(--primary-color-text, #444db0);
}

.vf-icon--recovery {
    background: #e8f8ef;
    color: #1b9e4b;
}

.vf-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.vf-item-title {
    color: #111827;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.vf-item-desc {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.4;
}

.vf-chevron {
    color: #9ca3af;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.vf-item.is-open .vf-chevron {
    transform: rotate(180deg);
    color: var(--primary-color-text, #444db0);
}

.vf-item--recovery.is-open .vf-chevron {
    color: #1b9e4b;
}

.vf-panel {
    padding: 0 16px 16px;
}

.vf-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    /*border: 1 px solid #e8eaed;*/
    border-radius: 12px;
    /*background: #f7f8fa;*/
}

.vf-label {
    margin: 0;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
}

.vf-cta {
    margin-top: 4px;
    border-radius: 999px;
    font-weight: 600;
}

.vf-panel :deep(.verification-code-panel__submit) {
    margin-top: 4px;
    margin-bottom: 0;
    border-radius: 999px;
    font-weight: 600;
}

.vf-panel :deep(.verification-method-list) {
    margin-top: 0;
}

/* Custom scrollbar for modal body */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Modal Footer (Optional) */
.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}


/* ============================================
   RESPONSIVE
   ============================================ */

/* Mobile Small (≤575px) */
@media (max-width: 575px) {
    .modal-overlay {
        padding: 10px;
    }

    .modal-container {
        max-height: 95vh;
        border-radius: var(--radius-md);
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-title i {
        font-size: 16px;
    }

    .modal-close {
        width: 32px;
        height: 32px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 16px 20px;
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }


}

/* Mobile Large (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .modal-header {
        padding: 20px 24px;
    }

    .modal-body {
        padding: 24px;
    }

    .modal-footer {
        padding: 18px 24px;
    }


}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .modal-container {
        max-width: 700px;
    }


}