/* =============================================================
   DCLIC.CO — CUSTOM CSS
   Paleta morada premium enterprise
   Tokens + utilities + animaciones que Tailwind no cubre
   ============================================================= */

/* === TOKENS (dark corporate · Silicon Valley) === */
:root {
    --color-primary: #7C3AED;       /* violeta profundo */
    --color-primary-light: #A78BFA;
    --color-primary-dark: #6D28D9;
    --color-accent: #4F46E5;        /* índigo */
    --color-accent-dark: #4338CA;
    --color-dark: #0A0B14;          /* near-black navy */
    --color-slate-light: #F8F9FD;
    --color-slate-border: #EEF0F7;
    --shadow-purple: 0 10px 40px -10px rgba(124, 58, 237, 0.35);
    --shadow-purple-lg: 0 20px 60px -15px rgba(124, 58, 237, 0.5);
    --shadow-3xl: 0 35px 60px -15px rgba(10, 11, 20, 0.4);
    --gradient-primary: linear-gradient(135deg, #7C3AED 0%, #4F46E5 100%);
    --gradient-primary-hover: linear-gradient(135deg, #6D28D9 0%, #4338CA 100%);
    --gradient-purple-blue: linear-gradient(135deg, #A78BFA 0%, #7C3AED 50%, #4F46E5 100%);
}

/* === BASE === */
[x-cloak] { display: none !important; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--color-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.font-display {
    font-family: 'Poppins', 'Inter', system-ui, sans-serif;
}

/* Accesibilidad: reducir animación si el usuario lo pide */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Selección de texto */
::selection {
    background-color: rgba(124, 58, 237, 0.2);
    color: var(--color-dark);
}

/* Focus visible pro (WCAG 2.2) */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
    border-radius: 6px;
}

/* Scrollbar estilizada */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #F1F5F9; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #A78BFA 0%, #7C3AED 100%);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #7C3AED 0%, #6D28D9 100%);
}
html { scrollbar-color: #7C3AED #F1F5F9; scrollbar-width: thin; }

/* === UTILITIES PREMIUM === */
.container-editorial {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.shadow-purple { box-shadow: var(--shadow-purple); }
.shadow-purple-lg { box-shadow: var(--shadow-purple-lg); }
.shadow-3xl { box-shadow: var(--shadow-3xl); }

.gradient-primary { background: var(--gradient-primary); }
.gradient-purple-blue { background: var(--gradient-purple-blue); }

.gradient-primary-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.glass-morphism {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-morphism-dark {
    background: rgba(29, 36, 51, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* === BACKGROUNDS DECORATIVOS === */
.bg-grid-purple {
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
}

.bg-dots-purple {
    background-image: radial-gradient(circle, rgba(124, 58, 237, 0.15) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* === SECTORES — tarjetas estilo agencia (badge gradiente + icono) === */
.sector-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #ffffff;
    border-radius: 1.25rem;
    padding: 1.4rem 1.5rem;
    border: 1px solid #EEF0F7;
    box-shadow:
        0 1px 2px rgba(16, 17, 30, 0.04),
        0 10px 24px -14px rgba(16, 17, 30, 0.18);
    transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.3, 1),
                box-shadow 0.32s ease,
                border-color 0.32s ease;
}

.sector-card:hover {
    transform: translateY(-6px);
    border-color: rgba(124, 58, 237, 0.22);
    box-shadow:
        0 10px 20px -10px rgba(16, 17, 30, 0.12),
        0 28px 44px -20px rgba(124, 58, 237, 0.30);
}

/* Badge circular con gradiente + sombra de color e highlight superior */
.sector-badge {
    position: relative;
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    border-radius: 16px;
    display: grid;
    place-items: center;
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.45),
        0 8px 18px -6px rgba(124, 58, 237, 0.45);
    transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.sector-badge::after {
    /* brillo superior sutil (efecto glossy premium) */
    content: "";
    position: absolute;
    inset: 1px 1px 55% 1px;
    border-radius: 15px 15px 40% 40%;
    background: linear-gradient(180deg, rgba(255,255,255,0.35), rgba(255,255,255,0));
    pointer-events: none;
}
.sector-card:hover .sector-badge {
    transform: scale(1.08) rotate(-4deg);
}

.sector-arrow {
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}
.sector-card:hover .sector-arrow {
    opacity: 1;
    transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
    .sector-card, .sector-card:hover,
    .sector-card:hover .sector-badge,
    .sector-arrow {
        transform: none;
        transition: none;
    }
    .sector-card:hover .sector-arrow { opacity: 1; }
}

/* Grid sutil para secciones OSCURAS (hero, CTA, contacto) */
.bg-grid-dark {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 40%, transparent 100%);
    mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 40%, transparent 100%);
}

.bg-diagonal-lines {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 20px,
        rgba(124, 58, 237, 0.03) 20px,
        rgba(124, 58, 237, 0.03) 21px
    );
}

/* === ANIMACIONES === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(3deg); }
}

@keyframes blob {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.4); }
    50% { box-shadow: 0 0 0 20px rgba(124, 58, 237, 0); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes rotateSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounceSubtle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* === UTILITY CLASSES DE ANIMACIÓN === */
.animate-fade-in { animation: fadeIn 1s ease-out forwards; }
.animate-fade-in-up { animation: fadeInUp 0.8s ease-out forwards; }
.animate-fade-in-down { animation: fadeInDown 0.8s ease-out forwards; }
.animate-float { animation: float 6s ease-in-out infinite; }
.animate-float-slow { animation: floatSlow 8s ease-in-out infinite; }
.animate-blob { animation: blob 20s ease-in-out infinite; }
.animate-pulse-glow { animation: pulseGlow 3s ease-in-out infinite; }
.animate-rotate-slow { animation: rotateSlow 40s linear infinite; }
.animate-bounce-subtle { animation: bounceSubtle 2s ease-in-out infinite; }
.animate-gradient {
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

/* Reveal on scroll — clases para IntersectionObserver */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-100 { animation-delay: 100ms; transition-delay: 100ms; }
.delay-200 { animation-delay: 200ms; transition-delay: 200ms; }
.delay-300 { animation-delay: 300ms; transition-delay: 300ms; }
.delay-400 { animation-delay: 400ms; transition-delay: 400ms; }
.delay-500 { animation-delay: 500ms; transition-delay: 500ms; }

/* === HOVER EFFECTS PREMIUM === */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-3xl);
}

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}
.hover-glow:hover {
    box-shadow: var(--shadow-purple-lg);
}

/* === CARDS PREMIUM === */
.card-premium {
    background: white;
    border-radius: 1rem;
    border: 1px solid var(--color-slate-border);
    box-shadow: 0 4px 20px -4px rgba(29, 36, 51, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-premium:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.2);
}

.card-glow-hover {
    position: relative;
    overflow: hidden;
}
.card-glow-hover::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-primary);
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
    filter: blur(20px);
}
.card-glow-hover:hover::before {
    opacity: 0.6;
}

/* === BOTONES PREMIUM === */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 9999px;
    box-shadow: var(--shadow-purple);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
}
.btn-primary:hover {
    background: var(--gradient-primary-hover);
    box-shadow: var(--shadow-purple-lg);
    transform: translateY(-2px) scale(1.02);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: white;
    color: var(--color-dark);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 9999px;
    border: 2px solid #E2E8F0;
    transition: all 0.3s ease;
    cursor: pointer;
}
.btn-secondary:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
}

/* === TIPOGRAFÍA PREMIUM === */
h1, h2, h3, h4 {
    letter-spacing: -0.02em;
    line-height: 1.15;
}

h1.hero-title {
    font-size: clamp(2.5rem, 5.5vw, 4.5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

/* Underline decorativo tipo brush stroke */
.brush-underline {
    position: relative;
    display: inline-block;
}
.brush-underline::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 100%;
    height: 12px;
    background: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3e%3cpath d='M2 8 Q50 -2 100 6 T198 4' stroke='%23F0A500' stroke-width='4' fill='none' stroke-linecap='round'/%3e%3c/svg%3e") no-repeat center;
    background-size: 100% 100%;
}

/* === INPUTS/SELECTS === */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
select,
textarea {
    transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
    border-color: var(--color-primary);
}

/* Select con chevron custom */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%237C3AED'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.1em;
    padding-right: 2.75rem;
}

/* === LOADING SKELETON === */
.skeleton {
    background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
    background-size: 1000px 100%;
    animation: shimmer 1.5s infinite;
}

/* === TRANSICIONES GLOBALES SUTILES === */
a, button {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* === MOBILE FINE-TUNING === */
@media (max-width: 640px) {
    h1, h2 {
        line-height: 1.1;
    }
    h1.hero-title {
        font-size: 2.5rem;
    }
    .section-title {
        font-size: 1.875rem;
    }
    .container-editorial {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Tap target mínimo 44x44 en móvil */
@media (hover: none) {
    button, a.btn, input[type="submit"] {
        min-height: 44px;
    }
}

/* === PRINT === */
@media print {
    nav, footer, .no-print, [x-data*="show"] {
        display: none !important;
    }
    body {
        color: #000;
        background: white;
    }
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        color: #666;
    }
}

/* === UTILITY: aspect ratios === */
.aspect-portrait { aspect-ratio: 3 / 4; }
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video { aspect-ratio: 16 / 9; }

/* === UTILITY: text sizes premium (backup a Tailwind) === */
.text-display-1 { font-size: clamp(3rem, 7vw, 5rem); line-height: 1.05; letter-spacing: -0.03em; }
.text-display-2 { font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.1; letter-spacing: -0.02em; }

/* === SEPARADORES DECORATIVOS === */
.divider-editorial {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.divider-editorial::before,
.divider-editorial::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    opacity: 0.3;
}
