/* ===================================
   Reset y Variables Globales
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores principales - Esquema moderno */
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-light: #f5f3ff;
    --primary-dark: #6d28d9;
    --secondary-color: #10b981;
    --secondary-light: #d1fae5;
    --accent-color: #f59e0b;
    --accent-light: #fef3c7;
    --danger-color: #ef4444;
    --success-color: #10b981;
    
    /* Colores neutros */
    --bg-color: #f8fafc;
    --bg-white: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    
    /* Modo Dark - Estilo Apple Minimalista */
    --dark-bg-primary: #000000;
    --dark-bg-secondary: #0a0a0a;
    --dark-bg-tertiary: #1a1a1a;
    --dark-text-primary: #ffffff;
    --dark-text-secondary: #a1a1a1;
    --dark-border: #2a2a2a;
    --dark-accent: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Espaciado */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Bordes */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Transiciones */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   Estilos Base - Apple Dark Mode
   =================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--dark-bg-primary);
    min-height: 100vh;
    color: var(--dark-text-primary);
    line-height: 1.6;
    padding: var(--spacing-lg);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ===================================
   Contenedor Principal
   =================================== */
.container {
    max-width: 600px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    z-index: 1;
}

/* ===================================
   Botón de Logout
   =================================== */
.logout-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--dark-text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

/* ===================================
   Sección del Formulario
   =================================== */
/* ===================================
   Sección del Formulario - Dark Minimal
   =================================== */
.form-section {
    background: var(--dark-bg-secondary);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    margin-bottom: var(--spacing-xl);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-top: 1rem;
}

.main-title-minimal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.title-primary {
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--dark-text-primary);
    letter-spacing: -0.03em;
}

.title-secondary {
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--dark-text-secondary);
    letter-spacing: -0.01em;
}

.subtitle-minimal {
    color: var(--dark-text-secondary);
    font-size: 0.9375rem;
    font-weight: 400;
    margin-top: 0.5rem;
}

/* ===================================
   Formulario
   =================================== */
.form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--dark-text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.label-text {
    flex: 1;
}

.required {
    color: #ef4444;
    font-weight: 400;
    font-size: 1rem;
    opacity: 0.8;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    border: 1px solid var(--dark-border);
    border-radius: 10px;
    background: var(--dark-bg-tertiary);
    color: var(--dark-text-primary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.form-group input::placeholder {
    color: var(--dark-text-secondary);
    opacity: 0.5;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: var(--dark-bg-primary);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.form-group input:invalid:not(:placeholder-shown) {
    border-color: rgba(239, 68, 68, 0.5);
}

.help-text {
    color: var(--dark-text-secondary);
    font-size: 0.75rem;
    margin-top: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.8;
}

/* ===================================
   Info Box Minimal
   =================================== */
.info-box-minimal {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--dark-border);
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin: 1.5rem 0;
}

.info-box-minimal p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--dark-text-secondary);
    line-height: 1.5;
}

/* ===================================
   Botones Minimal
   =================================== */
.btn-submit-minimal {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 2rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--dark-bg-primary);
    background: var(--dark-text-primary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 1.5rem;
    letter-spacing: 0.01em;
}

.btn-submit-minimal:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.95);
}

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

.btn-submit-minimal:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-reset {
    padding: 0.625rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    background: var(--bg-white);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.btn-reset:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-reset span:first-child {
    font-size: 1.25rem;
    transition: transform var(--transition-base);
}

.btn-reset:hover span:first-child {
    transform: rotate(180deg);
}

/* Responsive para widget minimalista */
@media (max-width: 768px) {
    .widget-section {
        border-radius: 16px;
    }
    
    .widget-header {
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .widget-title {
        font-size: 1.5rem;
    }
    
    .widget-container-minimal {
        padding: 1.5rem;
        min-height: 400px;
    }
    
    .widget-frame {
        padding: 1.5rem;
        min-height: 350px;
    }
    
    .client-info-card {
        padding: 1rem;
    }
    
    .client-info-card p {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .widget-header {
        padding: 1.25rem;
    }
    
    .widget-title {
        font-size: 1.25rem;
    }
    
    .widget-container-minimal {
        padding: 1rem;
    }
    
    .widget-frame {
        padding: 1rem;
        border-radius: 12px;
    }
}

/* ===================================
   Sección del Widget
   =================================== */
/* ===================================
   Sección del Widget - Apple Minimalista Dark
   =================================== */
.widget-section {
    width: 100%;
    max-width: 100%;
    padding: 0;
    animation: fadeInUp 0.6s ease-out;
    display: flex;
    align-items: stretch;
    justify-content: center;
    min-height: 100vh;
}

.widget-frame {
    width: 100%;
    max-width: 900px;
    background: transparent;
    border-radius: 0;
    border: none;
    padding: 1rem;
    min-height: calc(100vh - 2rem);
    display: flex;
    align-items: stretch;
    justify-content: center;
    position: relative;
    margin: 0 auto;
}

/* Estilos para el widget de ElevenLabs */
elevenlabs-convai {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 600px;
    height: 100%;
    display: block !important;
    position: static !important;
}

/* Forzar que el widget permanezca incrustado y centrado */
elevenlabs-convai::part(container) {
    position: static !important;
    bottom: auto !important;
    right: auto !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    margin: 0 auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Override de estilos del widget para modo dark */
elevenlabs-convai::part(button) {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #e5e7eb !important;
}

elevenlabs-convai::part(button):hover {
    background: #f9fafb !important;
}

/* ===================================
   Footer Minimal
   =================================== */
.footer {
    text-align: center;
    padding: var(--spacing-lg) 0;
    color: var(--dark-text-secondary);
    font-size: 0.8125rem;
    opacity: 0.6;
    font-weight: 400;
}

/* ===================================
   Animaciones
   =================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ===================================
   Responsive Design - Dark Minimal
   =================================== */

/* Mobile - Pantallas pequeñas */
@media (max-width: 640px) {
    body {
        padding: 0;
    }
    
    .container {
        padding: 0;
    }
    
    .widget-section {
        min-height: 100vh;
        padding: 0;
    }
    
    .widget-frame {
        padding: 0.5rem;
        max-width: 100%;
        min-height: 100vh;
    }
    
    elevenlabs-convai {
        min-height: calc(100vh - 1rem);
        height: 100%;
    }
    
    .form-section {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .title-primary {
        font-size: 1.75rem;
    }
    
    .form {
        gap: var(--spacing-md);
    }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1024px) {
    .widget-frame {
        padding: 1rem;
        max-width: 750px;
        min-height: calc(100vh - 2rem);
    }
    
    elevenlabs-convai {
        min-height: 550px;
        height: 100%;
    }
}

/* Desktop grande */
@media (min-width: 1025px) {
    .widget-frame {
        max-width: 900px;
        min-height: calc(100vh - 2rem);
    }
    
    elevenlabs-convai {
        min-height: 650px;
        height: 100%;
    }
}

@media (max-width: 768px) {
    body {
        padding: var(--spacing-md);
    }
    
    .form-section {
        padding: 1.5rem;
        border-radius: 20px;
    }
    
    .title-primary {
        font-size: 1.75rem;
    }
    
    .title-secondary {
        font-size: 1rem;
    }
    
    .btn-submit-minimal {
        font-size: 0.875rem;
        padding: 0.875rem 1.5rem;
    }
    
    .widget-section {
        border-radius: 16px;
    }
    
    .widget-header {
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .widget-title {
        font-size: 1.5rem;
    }
    
    .widget-container-minimal {
        padding: 1.5rem;
        min-height: 400px;
    }
    
    .widget-frame {
        padding: 1.5rem;
        min-height: 350px;
    }
    
    .client-info-card {
        padding: 1rem;
    }
    
    .client-info-card p {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .form-section {
        padding: 1.25rem;
        border-radius: 16px;
    }
    
    .title-primary {
        font-size: 1.5rem;
    }
    
    .title-secondary {
        font-size: 0.9375rem;
    }
    
    .form-group input,
    .form-group select {
        font-size: 0.875rem;
    }
    
    .widget-header {
        padding: 1.25rem;
    }
    
    .widget-title {
        font-size: 1.25rem;
    }
    
    .widget-container-minimal {
        padding: 1rem;
    }
    
    .widget-frame {
        padding: 1rem;
        border-radius: 12px;
    }
}

/* ===================================
   Estados de Validación - Dark Mode
   =================================== */
.form-group input.valid {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.05);
}

.form-group input.invalid {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.05);
}

/* ===================================
   Loader personalizado - Dark
   =================================== */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: var(--dark-bg-primary);
    animation: spin 0.8s ease-in-out infinite;
}

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