/* public/css/modal.css */

.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: var(--bg-modal-overlay);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--bg-modal);
    padding: 25px 30px;
    border: 1px solid var(--border-primary);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-primary);
    animation: animatetop 0.4s;
    border-radius: 8px;
    position: relative;
    text-align: left;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 1.5em;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1em;
    line-height: 1.5;
}

/* ADD these new styles for the large modal */
.modal-content.modal-lg {
    width: 50%;
    max-width: 1000px;
    height: auto;
    max-height: 90vh;
    padding: 0; /* The iframe will fill the space */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent double scrollbars */
}

.modal-content.modal-lg .close-modal-btn {
    z-index: 10;
    color: var(--text-secondary);
}

.modal-content.modal-lg iframe {
    width: 100%;
    border: none;
    border-radius: 8px; /* Match modal radius */
}

/* Base style for all form inputs in the modal */
.modal-content .form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-secondary);
    border-radius: 5px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 1em;
    box-sizing: border-box;
}

/* Spacing for inputs that are not in a group */
.modal-content .single-input {
    margin-bottom: 15px;
}

/* Style for the phone input container */
.phone-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

/* Style for the country code input */
.country-code-input {
    /* Do not grow, do not shrink, fixed width of 80px */
    flex: 0 0 80px;
}

/* Style for the main telephone number input */
.telephone-input {
    /* Grow to fill available space */
    flex-grow: 1;
    
    /* THE FIX: Allow the input to shrink below its default minimum size */
    min-width: 0;
}

.modal-content form textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-content form button {
    background-color: var(--accent-primary);
    color: var(--text-inverted);
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    width: 100%;
    transition: background-color 0.2s;
}

.modal-content form button:hover {
    background-color: var(--accent-primary-hover);
}

.modal-content form button:disabled {
    background-color: var(--accent-secondary);
    cursor: not-allowed;
}

.close-modal-btn {
    color: var(--text-secondary);
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-modal-btn:hover,
.close-modal-btn:focus {
    color: var(--text-primary);
}

.modal-status {
    margin-top: 15px;
    font-size: 0.9em;
    text-align: center;
    font-weight: 500;
}

.modal-status.success {
    color: var(--accent-positive);
}

.modal-status.error {
    color: var(--accent-negative);
}

@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}
