/* Modal de Alta Inmediata */

.ae-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 900;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ae-overlay.active {
    display: flex;
}

.ae-modal {
    background: #fff;
    border-radius: var(--radius, 14px);
    max-width: 740px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
}

.ae-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border, #E5E7EB);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.ae-header h2 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text, #111827);
}

.ae-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--muted, #4B5563);
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}

.ae-close:hover {
    background: var(--bg, #F9FAFB);
    color: var(--text, #111827);
}

.ae-body {
    padding: 12px 24px;
    flex: 1;
}

.ae-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--blue, #2563EB);
    margin: 10px 0 6px;
}

.ae-section-title:first-child {
    margin-top: 0;
}

.ae-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.ae-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.ae-row .ae-group {
    margin-bottom: 0;
}

.ae-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text, #111827);
    margin-bottom: 3px;
}

.ae-group input {
    padding: 6px 10px;
    border: 1px solid var(--border, #E5E7EB);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text, #111827);
    background: #fff;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ae-group input:focus {
    outline: none;
    border-color: var(--blue, #2563EB);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.ae-group input:disabled {
    background: var(--bg, #F9FAFB);
    color: var(--muted, #4B5563);
}

.ae-group small {
    font-size: 0.78rem;
    color: var(--muted, #4B5563);
    margin-top: 4px;
}

.ae-checkbox-group {
    margin-top: 4px;
}

.ae-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--muted, #4B5563);
    line-height: 1.5;
}

.ae-checkbox-label input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 3px;
    cursor: pointer;
}

.ae-checkbox-label a {
    color: var(--blue, #2563EB);
    text-decoration: underline;
}

.ae-message {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.ae-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.ae-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.ae-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 12px 24px;
    border-top: 1px solid var(--border, #E5E7EB);
    background: var(--bg, #F9FAFB);
    position: sticky;
    bottom: 0;
}

/* Estado de éxito tras envío */
.ae-exito {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 40px;
    gap: 12px;
    min-height: 280px;
}

.ae-exito-icono {
    font-size: 3.5rem;
    line-height: 1;
}

.ae-exito h2 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--text, #111827);
}

.ae-exito p {
    margin: 0;
    color: var(--muted, #4B5563);
    font-size: 0.95rem;
    max-width: 420px;
    line-height: 1.6;
}

.ae-exito-sub {
    font-size: 0.82rem !important;
    color: #9ca3af !important;
}

.ae-exito .cta-btn {
    margin-top: 8px;
}

/* Botón "Alta Inmediata" llamativo */
.cta-btn.instant {
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.45);
    animation: ae-pulse 2.8s ease-in-out infinite;
    font-weight: 700;
}

.cta-btn.instant:hover {
    background: linear-gradient(135deg, #ea6c08 0%, #dc2626 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.55);
}

@keyframes ae-pulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(249, 115, 22, 0.45); }
    50%       { box-shadow: 0 4px 28px rgba(249, 115, 22, 0.7); }
}

@media (max-width: 640px) {
    .ae-row { grid-template-columns: 1fr; }
    .ae-body, .ae-header, .ae-footer { padding-left: 16px; padding-right: 16px; }
}
