/* Registration popup: reserve a separate column for the close button. */
.tdlx-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tdlx-modal-overlay.is-active {
    display: flex;
}

.tdlx-modal-card {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
    animation: modal-pop 0.3s ease;
}

@keyframes modal-pop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-card-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    column-gap: 12px;
    align-items: start;
    background: var(--primary);
    color: #FFFFFF;
    padding: 20px 24px;
    position: relative;
}

.modal-card-header h3 {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
}

.modal-card-header p {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    overflow-wrap: anywhere;
    margin: 4px 0 0;
    font-size: 12px;
    color: #FEE2E2;
}

.btn-close-modal {
    position: static;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: start;
    padding: 0;
    line-height: 1;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.2);
    border: none;
    color: #FFFFFF;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-modal:focus-visible {
    outline: 2px solid #FFFFFF;
    outline-offset: 3px;
}

.btn-close-modal:hover {
    background: rgba(255,255,255,0.3);
}

.modal-card-body {
    padding: 24px;
}

@media (max-width: 768px) {
    .tdlx-modal-card {
        max-height: 90vh;
        overflow-y: auto;
    }
}

.tdlx-hp-wrap {
    display: none !important;
    visibility: hidden;
    position: absolute;
    left: -9999px;
    height: 0;
    width: 0;
    overflow: hidden;
}

.form-field-group input.tdlx-input-error {
    border-color: #EF4444;
    background-color: #FEF2F2;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.form-field-group textarea.tdlx-input-error {
    border-color: #EF4444;
    background-color: #FEF2F2;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}
