/* ----- MODAL (POPUP) STYLES ----- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 59, 72, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s, opacity 0.25s ease;
}

.modal-overlay.active {
    visibility: visible;
    opacity: 1;
}

.modal-container {
    background: white;
    width: 95%;
    max-width: 780px;
    max-height: 90vh;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    overflow-y: auto;
    position: relative;
    animation: modalEntrance 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    font-family: 'DM Sans', sans-serif;
}

@keyframes modalEntrance {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(18px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* custom scrollbar */
.modal-container {
    overflow-y: scroll;
    /* keep scrolling enabled */

    /* Hide scrollbar - Chrome, Safari */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.modal-container::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari */
}

.modal-container::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
    display: none;
}

/* form header */
.form-header {
    background: var(--deep-teal);
    padding: 1.6rem 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
    /* border-radius: 28px 28px 0 0; */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.form-header h2 {
    /* font-family: 'Playfair Display', serif; */
    color: white;
    font-weight: 600;
    font-size: 1.7rem;
    letter-spacing: -0.2px;
}

.form-header p {
    color: var(--gold-light);
    font-size: 0.8rem;
    margin-top: 4px;
}

.close-modal {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 40px;
    transition: all 0.2s;
    font-weight: 300;
}

.close-modal:hover {
    background: var(--warm-rust);
    transform: rotate(90deg);
}

/* form body */
.form-body {
    padding: 2rem 2rem 2rem;
    scrollbar-width: none;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 1.8rem;
}

.full-width {
    grid-column: span 2;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--deep-teal);
}

.input-group label .required {
    color: var(--warm-rust);
    margin-left: 3px;
}

input,
select,
textarea {
    font-family: 'DM Sans', sans-serif;
    padding: 12px 14px;
    border: 1.5px solid #e2e0db;
    border-radius: 14px;
    font-size: 0.9rem;
    transition: all 0.2s;
    background: var(--ivory);
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.2);
}

.row-double {
    display: flex;
    gap: 1rem;
}

.row-double .input-group {
    flex: 1;
}

hr {
    margin: 1.5rem 0;
    border: none;
    height: 1px;
    background: linear-gradient(to right, var(--gold-light), transparent);
}

.section-subtitle {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--mid-teal);
    background: #F3F1EA;
    display: inline-block;
    padding: 4px 14px;
    border-radius: 40px;
    margin-bottom: 1.2rem;
}

.action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn-cancel {
    background: transparent;
    border: 1.5px solid #cbcbc4;
    padding: 12px 24px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    color: var(--charcoal);
}

.btn-cancel:hover {
    background: #f0eeea;
    border-color: var(--warm-gray);
}

.btn-submit {
    background: var(--deep-teal);
    border: none;
    padding: 12px 32px;
    border-radius: 40px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-md);
}

.btn-submit:hover {
    background: var(--gold);
    color: var(--deep-teal);
    transform: translateY(-2px);
}

/* responsiveness */
@media (max-width: 680px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        width: 100%;
    }

    .modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .form-body {
        padding: 1.2rem;
    }

    .input-group {
        width: 100%;
    }

    .full-width {
        grid-column: span 1;
    }

    .form-body {
        padding: 1.5rem;
    }

    .form-header {
        padding: 1.2rem 1.5rem;
    }

    .row-double {
        flex-direction: column;
        gap: 1rem;
    }
}

.error-text {
    color: #ff4d4f;
    font-size: 0.75rem;
    margin-top: 4px;
    display: block;
}

.input-error {
    border: 1px solid #ff4d4f !important;
}