/* ============================================
   FORM CONTACTOS WP - Frontend Styles
   Mobile-first responsive design
   ============================================ */

/* ---- CSS Variables ---- */
:root {
    --fcwp-green: #25D366;
    --fcwp-green-dark: #128C7E;
    --fcwp-green-light: #DCF8C6;
    --fcwp-dark: #1a1a2e;
    --fcwp-gray: #6b7280;
    --fcwp-light: #f3f4f6;
    --fcwp-white: #ffffff;
    --fcwp-red: #ef4444;
    --fcwp-shadow: 0 10px 40px rgba(0,0,0,0.15);
    --fcwp-shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
    --fcwp-radius: 16px;
    --fcwp-radius-sm: 12px;
    --fcwp-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --fcwp-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Botón Shortcode */
    --fcwp-shortcode-bg: #25D366;
    --fcwp-shortcode-hover: #20bd5a;
    --fcwp-shortcode-text: #ffffff;

    /* Botón Modal Enviar */
    --fcwp-submit-bg: #25D366;
    --fcwp-submit-hover: #20bd5a;
    --fcwp-submit-text: #ffffff;
}

/* ---- CTA Button (Shortcode) ---- */
.fcwp-shortcode-wrapper {
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.fcwp-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: var(--fcwp-shortcode-bg) !important;
    color: var(--fcwp-shortcode-text) !important;
    border: none;
    border-radius: 50px;
    font-family: var(--fcwp-font);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--fcwp-transition);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.fcwp-cta-btn:hover {
    background: var(--fcwp-shortcode-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5);
    color: var(--fcwp-shortcode-text) !important;
    text-decoration: none;
}

.fcwp-cta-btn:active {
    transform: translateY(0);
}

.fcwp-cta-btn svg {
    flex-shrink: 0;
}

/* ---- Floating WhatsApp Button ---- */
.fcwp-floating-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0;
}

.fcwp-floating-icon {
    width: 60px;
    height: 60px;
    background: var(--fcwp-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fcwp-white);
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
    transition: var(--fcwp-transition);
    position: relative;
    z-index: 2;
}

.fcwp-floating-btn:hover .fcwp-floating-icon {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

.fcwp-floating-pulse {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--fcwp-green);
    opacity: 0.4;
    animation: fcwp-pulse 2s ease-out infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes fcwp-pulse {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(1.8); opacity: 0; }
}

.fcwp-floating-tooltip {
    position: absolute;
    right: 70px;
    background: var(--fcwp-white);
    color: var(--fcwp-dark);
    padding: 8px 16px;
    border-radius: 8px;
    font-family: var(--fcwp-font);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: var(--fcwp-shadow-sm);
    opacity: 0;
    transform: translateX(10px);
    transition: var(--fcwp-transition);
    pointer-events: none;
}

.fcwp-floating-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: var(--fcwp-white);
}

.fcwp-floating-btn:hover .fcwp-floating-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* ---- Modal Overlay ---- */
.fcwp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fcwp-modal-overlay.fcwp-active {
    opacity: 1;
}

/* ---- Modal ---- */
.fcwp-modal {
    background: var(--fcwp-white);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px 20px 32px;
    position: relative;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
}

.fcwp-modal-overlay.fcwp-active .fcwp-modal {
    transform: translateY(0);
}

.fcwp-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--fcwp-light);
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    color: var(--fcwp-gray);
    cursor: pointer;
    transition: var(--fcwp-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fcwp-modal-close:hover {
    background: #e5e7eb;
    color: var(--fcwp-dark);
}

/* ---- Modal Header ---- */
.fcwp-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.fcwp-modal-whatsapp-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--fcwp-white);
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.fcwp-modal-title {
    font-family: var(--fcwp-font);
    font-size: 22px;
    font-weight: 700;
    color: var(--fcwp-dark);
    margin: 0 0 6px;
    line-height: 1.3;
}

.fcwp-modal-subtitle {
    font-family: var(--fcwp-font);
    font-size: 14px;
    color: var(--fcwp-gray);
    margin: 0;
    line-height: 1.5;
}

/* ---- Form ---- */
.fcwp-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fcwp-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fcwp-label {
    font-family: var(--fcwp-font);
    font-size: 13px;
    font-weight: 600;
    color: var(--fcwp-dark);
    letter-spacing: 0.01em;
}

.fcwp-input {
    font-family: var(--fcwp-font);
    font-size: 16px;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: var(--fcwp-radius-sm);
    background: var(--fcwp-light);
    color: var(--fcwp-dark);
    outline: none;
    transition: var(--fcwp-transition);
    width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.fcwp-input:focus {
    border-color: var(--fcwp-green);
    background: var(--fcwp-white);
    box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.1);
}

.fcwp-input.fcwp-input-error {
    border-color: var(--fcwp-red);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* Phone wrapper */
.fcwp-phone-wrapper {
    display: flex;
    align-items: stretch;
    border: 2px solid #e5e7eb;
    border-radius: var(--fcwp-radius-sm);
    background: var(--fcwp-light);
    overflow: hidden;
    transition: var(--fcwp-transition);
}

.fcwp-phone-wrapper:focus-within {
    border-color: var(--fcwp-green);
    background: var(--fcwp-white);
    box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.1);
}

.fcwp-phone-wrapper.fcwp-input-error {
    border-color: var(--fcwp-red);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.fcwp-phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 14px;
    font-family: var(--fcwp-font);
    font-size: 16px;
    font-weight: 600;
    color: var(--fcwp-green-dark);
    background: rgba(37, 211, 102, 0.08);
    border-right: 2px solid #e5e7eb;
    white-space: nowrap;
    user-select: none;
}

.fcwp-phone-input {
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 14px 16px;
    flex: 1;
    min-width: 0;
}

.fcwp-phone-input:focus {
    border: none !important;
    box-shadow: none !important;
}

.fcwp-error {
    font-family: var(--fcwp-font);
    font-size: 12px;
    color: var(--fcwp-red);
    min-height: 0;
    transition: var(--fcwp-transition);
}

/* ---- Submit Button ---- */
.fcwp-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: var(--fcwp-submit-bg) !important;
    color: var(--fcwp-submit-text) !important;
    border: none;
    border-radius: var(--fcwp-radius-sm);
    font-family: var(--fcwp-font);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--fcwp-transition);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.35);
    margin-top: 4px;
}

.fcwp-submit-btn:hover {
    background: var(--fcwp-submit-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.45);
    color: var(--fcwp-submit-text) !important;
}

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

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

.fcwp-submit-btn svg {
    flex-shrink: 0;
}

/* Loading spinner on button */
.fcwp-submit-btn.fcwp-loading span {
    display: none;
}

.fcwp-submit-btn.fcwp-loading svg {
    display: none;
}

.fcwp-submit-btn.fcwp-loading::after {
    content: '';
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: var(--fcwp-white);
    border-radius: 50%;
    animation: fcwp-spin 0.6s linear infinite;
}

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

/* ---- Success State ---- */
.fcwp-success {
    text-align: center;
    padding: 20px 0;
}

.fcwp-success-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--fcwp-white);
    margin-bottom: 16px;
    animation: fcwp-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fcwp-pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.fcwp-success-text {
    font-family: var(--fcwp-font);
    font-size: 16px;
    font-weight: 600;
    color: var(--fcwp-dark);
    margin: 0;
}

/* ---- Desktop Styles ---- */
@media (min-width: 640px) {
    .fcwp-modal-overlay {
        align-items: center;
        padding: 24px;
    }

    .fcwp-modal {
        border-radius: var(--fcwp-radius);
        max-width: 440px;
        padding: 32px;
        transform: translateY(30px) scale(0.95);
        opacity: 0;
        box-shadow: var(--fcwp-shadow);
    }

    .fcwp-modal-overlay.fcwp-active .fcwp-modal {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    .fcwp-floating-btn {
        bottom: 32px;
        right: 32px;
    }

    .fcwp-cta-btn {
        padding: 16px 40px;
        font-size: 17px;
    }
}
