/* ============================================================
   contact-modal.css — Modal de contacto NUCLEUS
   Diseño: dark-first, gradiente #e8450a → #ff6a1a → #05d2fd
   Compatible con data-theme="dark" / data-theme="light"
   ============================================================ */

/* ── Overlay ─────────────────────────────────────────────── */
.contact-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: overlayFadeIn 0.25s ease forwards;
}

.contact-overlay.is-open {
    display: flex;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal box ───────────────────────────────────────────── */
.contact-modal {
    background: #15213d;
    border: 1px solid rgba(232, 69, 10, 0.3);
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    scrollbar-width: thin;
    scrollbar-color: #e8450a #15213d;
}

[data-theme="light"] .contact-modal {
    background: #ffffff;
    border-color: rgba(232, 69, 10, 0.25);
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}

.contact-modal::-webkit-scrollbar { width: 6px; }
.contact-modal::-webkit-scrollbar-track { background: #15213d; }
.contact-modal::-webkit-scrollbar-thumb { background: #e8450a; border-radius: 3px; }

@keyframes modalSlideIn {
    from { transform: translateY(24px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* ── Barra de gradiente superior ────────────────────────── */
.contact-modal::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, #e8450a, #ff6a1a, #05d2fd);
    border-radius: 16px 16px 0 0;
    position: sticky;
    top: 0;
    z-index: 1;
}

/* ── Encabezado ──────────────────────────────────────────── */
.contact-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    position: relative;
}

.contact-modal__title {
    font-family: 'Space Grotesk', Arial, sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
}

[data-theme="light"] .contact-modal__title {
    color: #0f1a2e;
}

.contact-modal__subtitle {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #05d2fd;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 4px 0 0 0;
}

.contact-modal__close {
    background: none;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: #8a9bb0;
    cursor: pointer;
    padding: 6px 8px;
    line-height: 1;
    transition: border-color 0.2s, color 0.2s;
    flex-shrink: 0;
    margin-left: 16px;
    margin-top: 2px;
}

.contact-modal__logo {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 96px !important;
    height: 96px !important;
    object-fit: contain !important;
    pointer-events: none;
    display: block;
}
    object-fit: contain !important;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 12px;
    align-self: center;
    display: block;
}

.contact-modal__close:hover {
    border-color: #e8450a;
    color: #ffffff;
}

[data-theme="light"] .contact-modal__close {
    border-color: rgba(0,0,0,0.15);
    color: #666;
}

[data-theme="light"] .contact-modal__close:hover {
    border-color: #e8450a;
    color: #e8450a;
}

.contact-modal__close svg {
    display: block;
    width: 16px;
    height: 16px;
}

/* ── Cuerpo del formulario ───────────────────────────────── */
.contact-modal__body {
    padding: 20px 28px 28px 28px;
}

/* ── Grupos de campo ─────────────────────────────────────── */
.contact-form__group {
    margin-bottom: 16px;
}

.contact-form__label {
    display: block;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #8a9bb0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

[data-theme="light"] .contact-form__label {
    color: #555;
}

/* ── Inputs y Select ─────────────────────────────────────── */
.contact-form__input,
.contact-form__select,
.contact-form__textarea {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e0e8f0;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.9rem;
    padding: 11px 14px;
    transition: border-color 0.2s, background 0.2s;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.contact-form__input::placeholder,
.contact-form__textarea::placeholder {
    color: #4a5a70;
}

.contact-form__input:focus,
.contact-form__select:focus,
.contact-form__textarea:focus {
    border-color: #e8450a;
    background: rgba(232, 69, 10, 0.06);
}

/* Textarea bloqueado hasta elegir categoría */
.contact-form__textarea:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.06);
    color: #4a5a70;
}

[data-theme="light"] .contact-form__textarea:disabled {
    opacity: 0.45;
    background: #eef0f3;
    border-color: #d0d8e0;
    color: #9ab;
}

/* Light theme inputs */
[data-theme="light"] .contact-form__input,
[data-theme="light"] .contact-form__select,
[data-theme="light"] .contact-form__textarea {
    background: #f5f7fa;
    border-color: rgba(5, 210, 253, 0.45);
    color: #1a2540;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

[data-theme="light"] .contact-form__input::placeholder,
[data-theme="light"] .contact-form__textarea::placeholder {
    color: #8aa0b8;
}

[data-theme="light"] .contact-form__input:focus,
[data-theme="light"] .contact-form__select:focus,
[data-theme="light"] .contact-form__textarea:focus {
    border-color: #05d2fd;
    background: rgba(5, 210, 253, 0.05);
    box-shadow: 0 0 0 3px rgba(5, 210, 253, 0.15);
    outline: none;
}

/* Select arrow custom */
.contact-form__select-wrap {
    position: relative;
}

.contact-form__select-wrap::after {
    content: '';
    pointer-events: none;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-right: 2px solid #e8450a;
    border-bottom: 2px solid #e8450a;
    rotate: 45deg;
    margin-top: -3px;
}

[data-theme="light"] .contact-form__select-wrap::after {
    border-right-color: #05d2fd;
    border-bottom-color: #05d2fd;
}

.contact-form__select {
    cursor: pointer;
    padding-right: 36px;
    background-color: rgba(255, 255, 255, 0.05);
}

/* Force dropdown bg color for options (browser support) */
.contact-form__select option {
    background: #15213d;
    color: #e0e8f0;
}

[data-theme="light"] .contact-form__select {
    background-color: #f5f7fa;
}

[data-theme="light"] .contact-form__select option {
    background: #f5f7fa;
    color: #1a2540;
}

/* Textarea */
.contact-form__textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.6;
}

/* Wrapper relativo para el toast */
.cf-textarea-wrap,
.contact-form__group {
    position: relative;
}

/* Toast "elige categoría" */
.cf-cat-toast {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%) translateY(-8px) scale(0.96);
    background: #12b76a;
    color: #fff;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.83rem;
    font-weight: 700;
    line-height: 1.55;
    padding: 13px 18px;
    border-radius: 12px;
    white-space: normal;
    text-align: center;
    max-width: 320px;
    width: max-content;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 10;
    box-shadow: 0 6px 20px rgba(18, 183, 106, 0.35);
}

.cf-cat-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(-100%) translateY(-8px) scale(1);
}

/* Shake del select al llamar la atención */
@keyframes cf-shake {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-5px); }
    40%      { transform: translateX(5px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

.cf-shake {
    animation: cf-shake 0.4s ease;
}

/* Row de 2 columnas en pantallas grandes */
.contact-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 420px) {
    .contact-form__row {
        grid-template-columns: 1fr;
    }
}

/* ── Honeypot (oculto para bots) ─────────────────────────── */
.contact-form__honeypot {
    display: none !important;
    visibility: hidden;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* ── Botón de envío ──────────────────────────────────────── */
.contact-form__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    margin-top: 20px;
    background: linear-gradient(90deg, #e8450a, #ff6a1a);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-family: 'Space Grotesk', Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.contact-form__submit:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.contact-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.contact-form__submit-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.contact-form__submit.is-loading .contact-form__submit-spinner { display: block; }
.contact-form__submit.is-loading .contact-form__submit-text    { display: none;  }

/* ── Mensajes de respuesta ───────────────────────────────── */
.contact-form__response {
    display: none;
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: center;
}

.contact-form__response.is-success {
    display: block;
    background: rgba(5, 210, 253, 0.1);
    border: 1px solid rgba(5, 210, 253, 0.25);
    color: #05d2fd;
}

.contact-form__response.is-error {
    display: block;
    background: rgba(232, 69, 10, 0.1);
    border: 1px solid rgba(232, 69, 10, 0.3);
    color: #f87a4a;
}

/* ── Separador inline ────────────────────────────────────── */
.contact-modal__divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(232,69,10,0.3), transparent);
    margin: 4px 0 18px 0;
}

/* ── Trigger: botón/enlace en el footer ──────────────────── */
.contact-trigger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    text-decoration: none;
    display: inline;
}

/* Hides scrollbar on body when modal open */
body.modal-open {
    overflow: hidden;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .contact-modal {
        border-radius: 12px;
        max-height: 92vh;
    }

    .contact-modal__header,
    .contact-modal__body {
        padding-left: 18px;
        padding-right: 18px;
    }

    .contact-modal__title {
        font-size: 1.1rem;
    }

    /* Targets táctiles mínimo 44px */
    .contact-form__input,
    .contact-form__select,
    .contact-form__textarea {
        font-size: 16px; /* evita zoom en iOS */
        min-height: 44px;
        padding: 10px 12px;
    }

    .contact-form__submit {
        min-height: 48px;
        font-size: 0.85rem;
    }

    .contact-modal__close {
        min-width: 36px;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ── Botón de contacto en sección Download ───────────────────────────────────── */
.download-contact-cta {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.download-contact-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.65);
    text-align: center;
    max-width: 480px;
    line-height: 1.6;
}

[data-theme="light"] .download-contact-text {
    color: rgba(0, 0, 0, 0.55);
}

.download-contact-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    border: 1.5px solid rgba(232, 69, 10, 0.6);
    background: transparent;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.download-contact-btn:hover {
    background: linear-gradient(90deg, #e8450a, #ff6a1a);
    border-color: transparent;
    color: #fff;
}

[data-theme="light"] .download-contact-btn {
    color: #0d1626;
    border-color: rgba(232, 69, 10, 0.5);
}

[data-theme="light"] .download-contact-btn:hover {
    color: #fff;
}

@media (max-width: 480px) {
    .download-contact-btn {
        width: 100%;
        max-width: 320px;
        min-height: 48px;
    }
}

/* ── Panel de éxito (reemplaza al formulario tras envío) ───── */
.contact-success {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;
    padding: 2.5rem 2rem;
    min-height: 260px;
    animation: overlayFadeIn 0.3s ease forwards;
}

.contact-success[hidden] {
    display: none;
}

.contact-success__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-secondary, rgba(255,255,255,0.5));
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s;
}

.contact-success__close:hover {
    color: #fff;
}

[data-theme="light"] .contact-success__close:hover {
    color: #0d1626;
}

.contact-success__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: -0.01em;
}

[data-theme="light"] .contact-success__title {
    color: #0d1626;
}

.contact-success__body {
    font-size: 0.97rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.72);
    margin: 0;
}

[data-theme="light"] .contact-success__body {
    color: rgba(0, 0, 0, 0.6);
}

.contact-success__sign {
    font-size: 1rem !important;
    font-weight: 700 !important;
    font-style: italic !important;
    color: #05d2fd !important;
    margin: 20px 0 0 0;
    letter-spacing: 0.04em;
    text-transform: none !important;
    border-top: 1px solid rgba(5, 210, 253, 0.3);
    padding-top: 16px;
    text-shadow: 0 0 12px rgba(5, 210, 253, 0.4);
}

[data-theme="light"] .contact-success__sign {
    color: #0077aa !important;
    border-top-color: rgba(0, 119, 170, 0.3);
    text-shadow: none;
}
