/* WhatsApp Form Modal v4 - Estilos Frontend */

/* ============================================
   BOTÓN FLOTANTE
   ============================================ */
.wfm-button {
    position: fixed;
    bottom: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9998;
    animation: wfm-pulse 2s infinite;
}

.wfm-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    animation: none;
}

@keyframes wfm-pulse {
    0% { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); }
    50% { box-shadow: 0 4px 25px rgba(37, 211, 102, 0.4); }
    100% { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); }
}

.wfm-button svg {
    width: 28px;
    height: 28px;
}

.wfm-pos-right {
    right: 30px;
}

.wfm-pos-left {
    left: 30px;
}

.wfm-size-small {
    width: 50px;
    height: 50px;
}

.wfm-size-small svg {
    width: 22px;
    height: 22px;
}

.wfm-size-large {
    width: 70px;
    height: 70px;
}

.wfm-size-large svg {
    width: 32px;
    height: 32px;
}

/* ============================================
   CONTENEDOR DEL FORMULARIO
   ============================================ */
.wfm-form-container {
    position: fixed;
    bottom: 100px;
    width: 380px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    z-index: 9997;
    opacity: 0;
}

.wfm-form-container.wfm-pos-right {
    right: 30px;
}

.wfm-form-container.wfm-pos-left {
    left: 30px;
}

.wfm-form-container.active {
    max-height: 85vh;
    opacity: 1;
}

/* ============================================
   WRAPPER DEL FORMULARIO
   ============================================ */
.wfm-form-wrapper {
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
    position: relative;
    overflow-y: auto;
    max-height: 80vh;
}

/* ============================================
   BOTÓN CERRAR
   ============================================ */
.wfm-form-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #ffffff;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    border-radius: 50%;
    line-height: 1;
}

.wfm-form-close:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

/* ============================================
   HEADER
   ============================================ */
.wfm-form-header {
    padding: 22px 20px;
    border-radius: 16px 16px 0 0;
    background: #25D366;
    color: #ffffff;
}

.wfm-form-header h3 {
    margin: 0 0 6px 0;
    font-size: 18px;
    color: #ffffff;
    font-weight: 700;
    line-height: 1.3;
}

.wfm-form-header p {
    margin: 0;
    color: #ffffff;
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.4;
}

/* ============================================
   FORMULARIO
   ============================================ */
.wfm-form {
    padding: 20px;
}

.wfm-form-group {
    margin-bottom: 14px;
}

.wfm-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #374151;
    font-size: 13px;
}

.wfm-form-group input[type="text"],
.wfm-form-group input[type="email"],
.wfm-form-group input[type="tel"],
.wfm-form-group input[type="number"],
.wfm-form-group input[type="url"],
.wfm-form-group input[type="date"],
.wfm-form-group textarea,
.wfm-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fafafa;
    color: #1f2937;
}

.wfm-form-group input:focus,
.wfm-form-group textarea:focus,
.wfm-form-group select:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.12);
    background: #fff;
}

.wfm-form-group textarea {
    resize: vertical;
    min-height: 65px;
}

/* ============================================
   FILE UPLOAD
   ============================================ */
.wfm-file-upload {
    position: relative;
}

.wfm-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.wfm-file-label {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: #fafafa;
}

.wfm-file-upload:hover .wfm-file-label {
    border-color: #25D366;
    color: #25D366;
    background: #f0fdf4;
}

.wfm-file-label small {
    color: #9ca3af;
    font-size: 11px;
}

.wfm-file-name {
    padding: 8px 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    font-size: 12px;
    color: #166534;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wfm-file-name::before {
    content: '✓';
    font-weight: bold;
}

/* ============================================
   CHECKBOX
   ============================================ */
.wfm-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
}

.wfm-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #25D366;
}

/* ============================================
   BOTÓN ENVIAR
   ============================================ */
.wfm-submit {
    width: 100%;
    padding: 12px;
    color: white;
    border:0px solid !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 8px;
    letter-spacing: 0.3px;
}

.wfm-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.wfm-submit:active {
    transform: translateY(0);
}

.wfm-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   LOADING
   ============================================ */
.wfm-form-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    color: #6b7280;
    font-size: 13px;
}

.wfm-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid #e5e7eb;
    border-top-color: #25D366;
    border-radius: 50%;
    animation: wfm-spin 0.7s linear infinite;
}

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

/* ============================================
   SCROLLBAR
   ============================================ */
.wfm-form-wrapper::-webkit-scrollbar {
    width: 5px;
}

.wfm-form-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.wfm-form-wrapper::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

.wfm-form-wrapper::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 600px) {
    .wfm-button {
        bottom: 20px;
    }

    .wfm-pos-right.wfm-button {
        right: 16px;
    }

    .wfm-pos-left.wfm-button {
        left: 16px;
    }

    .wfm-form-container {
        bottom: 80px;
        width: 90vw;
    }

    .wfm-form-container.wfm-pos-right {
        right: 5vw;
    }

    .wfm-form-container.wfm-pos-left {
        left: 5vw;
    }

    .wfm-form-wrapper {
        border-radius: 14px;
        max-height: 75vh;
    }

    .wfm-form-header {
        padding: 16px;
        border-radius: 14px 14px 0 0;
    }

    .wfm-form-header h3 {
        font-size: 16px;
    }

    .wfm-form-header p {
        font-size: 12px;
    }

    .wfm-form {
        padding: 16px;
    }

    .wfm-form-group input,
    .wfm-form-group textarea,
    .wfm-form-group select {
        font-size: 16px; /* Evita zoom en iOS */
        padding: 10px;
    }

    .wfm-submit {
        padding: 14px;
        font-size: 15px;
    }
}

@media (max-width: 380px) {
    .wfm-form-container {
        width: 95vw;
    }

    .wfm-form-container.wfm-pos-right {
        right: 2.5vw;
    }

    .wfm-form-container.wfm-pos-left {
        left: 2.5vw;
    }
}
