/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.active {
    display: flex;
}

/* ============= MODAL STYLES ============= */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    /* opacity: 0; */
    transition: opacity 0.3s ease;
}

.modal[style*="flex"] {
    opacity: 1;
}

.modal-content {
    background: var(--background-gradient135deg);
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal[style*="flex"] .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-header h3 {
    margin: 0;
    color: var(--fontColorWhite);
    font-size: 18px;
    /* font-weight: 600; */
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-text {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    color: var(--fontColorWhite);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.close-modal {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: var(--fontColorWhite);
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ============= FORM STYLES ============= */

.modal form {
    padding: 16px;
}

.qrcode {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background: var(--fontColorWhite);
    border-radius: 12px;
    text-align: center;
    font-size: .7rem;
    width: fit-content;
    margin: auto;
}

.content-text .form-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: var(--fontColorWhite);
    border-radius: 12px;
    text-align: center;
    font-size: .7rem;
}

.content-text .form-group input {
    background: var(--secondary-color-transparent);
    color: var(--fontColorWhite);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    font-family: 'Poppins', sans-serif;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    /* margin-top: 24px; */
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    transform: none !important;
}

/* ============= RESPONSIVE MODAL ============= */

@media (max-width: 768px) {
    .form-group input, .form-group textarea, .form-group select {
        outline: none;
        padding: 16px 10px;
        border-color: var(--secondary-color);
        /* box-shadow: 0 0 0 4px var(--primary-color); */
        background: var(--fontColorWhite);
        transform: translateY(-2px);
    }

    .modal {
        padding: 10px;
    }

    .modal-content {
        margin: 0;
        max-height: calc(100vh - 20px);
        border-radius: 12px;
    }

    .modal form {
        padding: 16px;
    }

    .modal-header {
        padding: 16px 16px 12px;
    }

    .modal-header h3 {
        font-size: 18px;
    }

    .form-actions {
        /* flex-direction: column; */
        gap: 8px;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .content-text {
        grid-template-columns: 1fr !important;
    }
}

/* ============= TOAST NOTIFICATIONS ============= */

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--fontColorWhite);
    color: var(--fontColorBlack);
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    font-weight: 500;
    min-width: 300px;
    max-width: 400px;
    backdrop-filter: blur(10px);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    background: linear-gradient(135deg, var(--btnSuccess-bg) 0%, var(--btnSuccess-hover-bg) 100%);
    color: var(--fontColorWhite);
    font-weight: 600;
    border-left: 4px solid var(--btnSuccess-bg);
}

.toast.error {
    background: linear-gradient(135deg, var(--btnError-bg) 0%, var(--btnError-hover-bg) 100%);
    color: var(--fontColorWhite);
    border-left: 4px solid var(--btnError-bg);
}

.toast.info {
    background: linear-gradient(135deg, var(--btnInfo-bg) 0%, var(--btnInfo-hover-bg) 100%);
    color: var(--fontColorWhite);
    border-left: 4px solid var(--btnInfo-bg);
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-message {
    font-size: 14px;
    line-height: 1.4;
}

@media (max-width: 480px) {
    .modal-content {
        max-height: calc(100vh - 10px);
        padding: 0 12px;
    }

    .modal form {
        padding: 5px 0;
    }

    .modal-header {
        padding: 12px;
    }

    .form-group {
        margin: 0;
        padding: 5px 0;
    }

    .toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        min-width: auto;
        transform: translateY(-100px);
    }

    .toast.show {
        transform: translateY(0);
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        border-radius: 12px;
        margin: 0;
    }

    .form-actions {
        /* flex-direction: column; */
        gap: 8px;
    }

    .form-actions .btn {
        width: 100%;
        font-size: 1.1rem;
        min-height: 60px;
        padding: .7rem 2.0rem;
        border-radius: 15px;
    }
}