﻿/* =========================================================
   DTP Modal — sistema propio, liviano, accesible
   Sin backdrop-filter, sin blur, sin will-change.
   Animaciones cortas y solo on-demand (transición CSS).
   ========================================================= */

.dtp-modal {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
}

    .dtp-modal[hidden] {
        display: none;
    }

.dtp-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(4, 8, 18, 0.72);
    opacity: 0;
    transition: opacity .18s ease-out;
    pointer-events: auto;
}

.dtp-modal__panel {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #0e162a;
    color: #f5f7fb;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px 18px 0 0;
    padding: clamp(20px, 4vw, 32px) clamp(20px, 4vw, 32px) clamp(24px, 5vw, 36px);
    box-shadow: 0 -8px 32px -12px rgba(0, 0, 0, 0.6);
    transform: translateY(24px);
    opacity: 0;
    transition: transform .22s cubic-bezier(.2, .9, .25, 1), opacity .18s ease-out;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

.dtp-modal__panel--sm {
    max-width: 440px;
}

.dtp-modal.is-open {
    pointer-events: auto;
}

    .dtp-modal.is-open .dtp-modal__overlay {
        opacity: 1;
    }

    .dtp-modal.is-open .dtp-modal__panel {
        transform: translateY(0);
        opacity: 1;
    }

@media (min-width: 640px) {
    .dtp-modal {
        align-items: center;
        padding: 24px;
    }

    .dtp-modal__panel {
        border-radius: 16px;
        border-top-color: rgba(255, 255, 255, 0.08);
        max-height: calc(100vh - 48px);
        transform: translateY(8px) scale(.985);
    }

    .dtp-modal.is-open .dtp-modal__panel {
        transform: translateY(0) scale(1);
    }
}

/* Borde decorativo arriba — pintado una sola vez, sin animación */
.dtp-modal__panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    border-radius: 18px 18px 0 0;
    background: linear-gradient(90deg, transparent, #00bfff 30%, #ff7b00 70%, transparent);
    opacity: .9;
    pointer-events: none;
}

@media (min-width: 640px) {
    .dtp-modal__panel::before {
        border-radius: 16px 16px 0 0;
    }
}

/* Cerrar */
.dtp-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: #f5f7fb;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
    transition: background-color .15s ease;
}

    .dtp-modal__close:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .dtp-modal__close:focus-visible {
        outline: 2px solid #00bfff;
        outline-offset: 2px;
    }

/* Ícono decorativo arriba (modal de contacto) */
.dtp-modal__icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px auto 16px;
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.18), rgba(255, 123, 0, 0.18));
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Header del modal de solicitud */
.dtp-modal__header {
    margin-bottom: 20px;
}

.dtp-modal__eyebrow {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(245, 247, 251, 0.55);
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    margin-bottom: 12px;
}

.dtp-modal__title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
    font-size: clamp(1.25rem, 2.6vw, 1.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin: 0 0 8px;
    text-align: center;
}

.dtp-modal__header .dtp-modal__title {
    text-align: left;
}

.dtp-modal__desc {
    color: rgba(245, 247, 251, 0.72);
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0 0 20px;
    text-align: center;
}

.dtp-modal__header .dtp-modal__desc {
    text-align: left;
    margin-bottom: 0;
}

/* Acciones */
.dtp-modal__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    flex-wrap: wrap;
}

.dtp-modal__actions--stack {
    flex-direction: column;
    align-items: stretch;
}

.dtp-modal__actions .dtp-cta,
.dtp-modal__actions .dtp-btn {
    flex: 1 1 auto;
}

@media (max-width: 480px) {
    .dtp-modal__actions {
        flex-direction: column-reverse;
    }

        .dtp-modal__actions .dtp-cta,
        .dtp-modal__actions .dtp-btn {
            width: 100%;
        }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .dtp-modal__overlay,
    .dtp-modal__panel {
        transition: none;
    }
}

/* Bloqueo de scroll del body cuando hay un modal abierto */
body.dtp-modal-open {
    overflow: hidden;
    /* compensa scrollbar para evitar layout shift */
    padding-right: var(--dtp-scrollbar-pad, 0);
}


/* =========================================================
   Toast — variante con icono grande y un solo CTA
   ========================================================= */

.dtp-toast__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dtp-toast__icon-svg {
    width: 100%;
    height: 100%;
    display: none;
}

.dtp-toast__icon[data-variant="success"] .dtp-toast__icon-svg--success {
    display: block;
    color: #2ecc71;
}

.dtp-toast__icon[data-variant="error"] .dtp-toast__icon-svg--error {
    display: block;
    color: #ff5d5d;
}

.dtp-toast__icon[data-variant="info"] .dtp-toast__icon-svg--info {
    display: block;
    color: #00bfff;
}

.dtp-toast__icon[data-variant="success"] {
    filter: drop-shadow(0 6px 18px rgba(46, 204, 113, .35));
}

.dtp-toast__icon[data-variant="error"] {
    filter: drop-shadow(0 6px 18px rgba(255, 93, 93, .35));
}

.dtp-toast__icon[data-variant="info"] {
    filter: drop-shadow(0 6px 18px rgba(0, 191, 255, .35));
}

/* Animación de tilde / cruz al aparecer (solo cuando el modal está open) */
.dtp-modal.is-open .dtp-toast__icon-svg circle,
.dtp-modal.is-open .dtp-toast__icon-svg path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: dtp-toast-draw .55s cubic-bezier(.65, 0, .35, 1) forwards;
}

.dtp-modal.is-open .dtp-toast__icon-svg path {
    animation-delay: .25s;
}

@keyframes dtp-toast-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dtp-modal.is-open .dtp-toast__icon-svg circle,
    .dtp-modal.is-open .dtp-toast__icon-svg path {
        animation: none;
        stroke-dasharray: none;
        stroke-dashoffset: 0;
    }
}

/* Center alignment para el botón único del toast */
.dtp-modal__actions--center {
    justify-content: center;
}

    .dtp-modal__actions--center .dtp-cta {
        flex: 0 0 auto;
        min-width: 140px;
    }

.dtp-modal--toast .dtp-modal__title {
    text-align: center;
}

.dtp-modal--toast .dtp-modal__desc {
    text-align: center;
    margin-bottom: 8px;
}