/**
 * Mini CRM - Public Styles
 * Estilos para formularios y botones en el frontend
 * Tema Dark moderno
 */

:root {
    --mcrm-bg-dark: #0f0f12;
    --mcrm-bg-card: #16161a;
    --mcrm-bg-input: #1a1a1f;
    --mcrm-bg-elevated: #1f1f24;
    
    --mcrm-primary: #8b5cf6;
    --mcrm-primary-light: #a78bfa;
    --mcrm-primary-dark: #7c3aed;
    --mcrm-primary-glow: rgba(139, 92, 246, 0.3);
    
    --mcrm-gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    --mcrm-gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    
    --mcrm-success: #10b981;
    --mcrm-danger: #ef4444;
    
    --mcrm-text-primary: #ffffff;
    --mcrm-text-secondary: #a1a1aa;
    --mcrm-text-muted: #71717a;
    
    --mcrm-border: #27272a;
    --mcrm-border-light: #3f3f46;
    
    --mcrm-radius: 10px;
    --mcrm-radius-lg: 16px;
    --mcrm-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --mcrm-shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);
    --mcrm-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   FORMULARIOS
   ========================================== */

.mini-crm-form {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 100%;
}

.mini-crm-form__title {
    font-size: 28px;
    font-weight: 700;
    color: var(--mcrm-text-primary);
    margin: 0 0 28px;
    text-align: center;
    letter-spacing: -0.5px;
}

.mini-crm-form__form {
    position: relative;
}

/* ==========================================
   TEMA MODERNO (DARK)
   ========================================== */

.mini-crm-form--modern {
    background: var(--mcrm-bg-card);
    padding: 40px;
    border-radius: var(--mcrm-radius-lg);
    box-shadow: var(--mcrm-shadow);
    border: 1px solid var(--mcrm-border);
}

.mini-crm-form--modern .mini-crm-form__field {
    margin-bottom: 24px;
}

.mini-crm-form--modern .mini-crm-form__label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--mcrm-text-secondary);
}

.mini-crm-form--modern .mini-crm-form__required {
    color: var(--mcrm-danger);
    margin-left: 3px;
}

.mini-crm-form--modern .mini-crm-form__input,
.mini-crm-form--modern .mini-crm-form__textarea,
.mini-crm-form--modern .mini-crm-form__select {
    width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    color: var(--mcrm-text-primary);
    background: var(--mcrm-bg-input);
    border: 1px solid var(--mcrm-border);
    border-radius: var(--mcrm-radius);
    transition: var(--mcrm-transition);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.mini-crm-form--modern .mini-crm-form__input:focus,
.mini-crm-form--modern .mini-crm-form__textarea:focus,
.mini-crm-form--modern .mini-crm-form__select:focus {
    background: var(--mcrm-bg-elevated);
    border-color: var(--mcrm-primary);
    box-shadow: 0 0 0 3px var(--mcrm-primary-glow);
}

.mini-crm-form--modern .mini-crm-form__input::placeholder,
.mini-crm-form--modern .mini-crm-form__textarea::placeholder {
    color: var(--mcrm-text-muted);
}

.mini-crm-form--modern .mini-crm-form__textarea {
    min-height: 120px;
    resize: vertical;
}

.mini-crm-form--modern .mini-crm-form__select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a1a1aa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    padding-right: 48px;
}

.mini-crm-form--modern .mini-crm-form__checkbox-wrap {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.mini-crm-form--modern .mini-crm-form__checkbox {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    accent-color: var(--mcrm-primary);
    cursor: pointer;
}

.mini-crm-form--modern .mini-crm-form__checkbox-label {
    font-size: 14px;
    color: var(--mcrm-text-secondary);
    line-height: 1.5;
}

.mini-crm-form--modern .mini-crm-form__radio-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mini-crm-form--modern .mini-crm-form__radio-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--mcrm-text-secondary);
    cursor: pointer;
    padding: 10px 14px;
    background: var(--mcrm-bg-input);
    border-radius: var(--mcrm-radius);
    border: 1px solid var(--mcrm-border);
    transition: var(--mcrm-transition);
}

.mini-crm-form--modern .mini-crm-form__radio-label:hover {
    border-color: var(--mcrm-primary);
}

.mini-crm-form--modern .mini-crm-form__radio {
    width: 20px;
    height: 20px;
    accent-color: var(--mcrm-primary);
}

.mini-crm-form--modern .mini-crm-form__submit {
    margin-top: 32px;
}

.mini-crm-form--modern .mini-crm-form__button {
    width: 100%;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: var(--mcrm-gradient-primary);
    border: none;
    border-radius: var(--mcrm-radius);
    cursor: pointer;
    transition: var(--mcrm-transition);
    box-shadow: 0 4px 20px var(--mcrm-primary-glow);
}

.mini-crm-form--modern .mini-crm-form__button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
}

.mini-crm-form--modern .mini-crm-form__button:active {
    transform: translateY(0);
}

.mini-crm-form--modern .mini-crm-form__button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================
   MENSAJES
   ========================================== */

.mini-crm-form__message {
    padding: 18px 22px;
    border-radius: var(--mcrm-radius);
    font-size: 14px;
    text-align: center;
    margin-top: 24px;
}

.mini-crm-form__message--success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.mini-crm-form__message--error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ==========================================
   TEMA MINIMALISTA
   ========================================== */

.mini-crm-form--minimal {
    padding: 24px 0;
}

.mini-crm-form--minimal .mini-crm-form__field {
    margin-bottom: 22px;
}

.mini-crm-form--minimal .mini-crm-form__label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--mcrm-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mini-crm-form--minimal .mini-crm-form__input,
.mini-crm-form--minimal .mini-crm-form__textarea,
.mini-crm-form--minimal .mini-crm-form__select {
    width: 100%;
    padding: 14px 0;
    font-size: 16px;
    color: var(--mcrm-text-primary);
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--mcrm-border);
    border-radius: 0;
    transition: var(--mcrm-transition);
    outline: none;
}

.mini-crm-form--minimal .mini-crm-form__input:focus,
.mini-crm-form--minimal .mini-crm-form__textarea:focus,
.mini-crm-form--minimal .mini-crm-form__select:focus {
    border-bottom-color: var(--mcrm-primary);
}

.mini-crm-form--minimal .mini-crm-form__button {
    padding: 14px 44px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    background: var(--mcrm-bg-elevated);
    border: 1px solid var(--mcrm-border);
    border-radius: 50px;
    cursor: pointer;
    transition: var(--mcrm-transition);
}

.mini-crm-form--minimal .mini-crm-form__button:hover {
    background: var(--mcrm-primary);
    border-color: var(--mcrm-primary);
}

/* ==========================================
   TEMA DARK (COMPLETO)
   ========================================== */

.mini-crm-form--dark {
    background: var(--mcrm-bg-dark);
    padding: 44px;
    border-radius: var(--mcrm-radius-lg);
    border: 1px solid var(--mcrm-border);
}

.mini-crm-form--dark .mini-crm-form__title {
    color: var(--mcrm-text-primary);
}

.mini-crm-form--dark .mini-crm-form__label {
    color: var(--mcrm-text-secondary);
}

.mini-crm-form--dark .mini-crm-form__input,
.mini-crm-form--dark .mini-crm-form__textarea,
.mini-crm-form--dark .mini-crm-form__select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--mcrm-border);
    color: var(--mcrm-text-primary);
}

.mini-crm-form--dark .mini-crm-form__input::placeholder,
.mini-crm-form--dark .mini-crm-form__textarea::placeholder {
    color: var(--mcrm-text-muted);
}

.mini-crm-form--dark .mini-crm-form__input:focus,
.mini-crm-form--dark .mini-crm-form__textarea:focus,
.mini-crm-form--dark .mini-crm-form__select:focus {
    border-color: var(--mcrm-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px var(--mcrm-primary-glow);
}

/* ==========================================
   TEMA LIGHT (para fondos claros)
   ========================================== */

.mini-crm-form--light {
    background: #ffffff;
    padding: 40px;
    border-radius: var(--mcrm-radius-lg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.mini-crm-form--light .mini-crm-form__title {
    color: #111827;
}

.mini-crm-form--light .mini-crm-form__label {
    color: #374151;
}

.mini-crm-form--light .mini-crm-form__input,
.mini-crm-form--light .mini-crm-form__textarea,
.mini-crm-form--light .mini-crm-form__select {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #111827;
}

.mini-crm-form--light .mini-crm-form__input::placeholder,
.mini-crm-form--light .mini-crm-form__textarea::placeholder {
    color: #9ca3af;
}

.mini-crm-form--light .mini-crm-form__input:focus,
.mini-crm-form--light .mini-crm-form__textarea:focus,
.mini-crm-form--light .mini-crm-form__select:focus {
    border-color: var(--mcrm-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.mini-crm-form--light .mini-crm-form__message--success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.mini-crm-form--light .mini-crm-form__message--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Honeypot */
.mini-crm-form__hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* ==========================================
   BOTONES DE WHATSAPP Y LLAMADA
   ========================================== */

.mini-crm-wa-button,
.mini-crm-call-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: var(--mcrm-transition);
    cursor: pointer;
}

/* WhatsApp Button */
.mini-crm-wa-button {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white !important;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
}

.mini-crm-wa-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.4);
    color: white !important;
}

.mini-crm-wa-icon {
    width: 26px;
    height: 26px;
}

/* WhatsApp Floating */
.mini-crm-wa-button--floating {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    padding: 0;
    border-radius: 50%;
    z-index: 9999;
    animation: pulse-wa 2s infinite;
}

.mini-crm-wa-button--floating .mini-crm-wa-icon {
    width: 34px;
    height: 34px;
}

@keyframes pulse-wa {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
    }
    70% {
        box-shadow: 0 0 0 18px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* WhatsApp Icon Only */
.mini-crm-wa-button--icon {
    width: 54px;
    height: 54px;
    padding: 0;
    border-radius: 50%;
}

/* Call Button */
.mini-crm-call-button {
    background: var(--mcrm-gradient-primary);
    color: white !important;
    box-shadow: 0 4px 20px var(--mcrm-primary-glow);
}

.mini-crm-call-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
    color: white !important;
}

.mini-crm-call-icon {
    width: 26px;
    height: 26px;
}

.mini-crm-call-button--floating {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 64px;
    height: 64px;
    padding: 0;
    border-radius: 50%;
    z-index: 9998;
    animation: pulse-call 2s infinite 1s;
}

@keyframes pulse-call {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.5);
    }
    70% {
        box-shadow: 0 0 0 18px rgba(139, 92, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
    }
}

.mini-crm-call-button--icon {
    width: 54px;
    height: 54px;
    padding: 0;
    border-radius: 50%;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 600px) {
    .mini-crm-form--modern,
    .mini-crm-form--dark,
    .mini-crm-form--light {
        padding: 28px 22px;
    }

    .mini-crm-form--modern .mini-crm-form__input,
    .mini-crm-form--modern .mini-crm-form__textarea,
    .mini-crm-form--modern .mini-crm-form__select {
        padding: 14px 16px;
        font-size: 16px; /* Previene zoom en iOS */
    }

    .mini-crm-wa-button--floating,
    .mini-crm-call-button--floating {
        right: 20px;
        bottom: 20px;
        width: 58px;
        height: 58px;
    }

    .mini-crm-call-button--floating {
        bottom: 95px;
    }
}

/* ==========================================
   LOADING STATE
   ========================================== */

.mini-crm-form--loading .mini-crm-form__button {
    position: relative;
    pointer-events: none;
    color: transparent;
}

.mini-crm-form--loading .mini-crm-form__button::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    top: 50%;
    left: 50%;
    margin: -11px 0 0 -11px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spinner 0.7s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   ERROR MESSAGES
   ========================================== */

.mini-crm-error {
    padding: 18px 22px;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--mcrm-radius);
    font-size: 14px;
}
