/* ============================================================
   LABIX — Estilos comunes (reutilizables en todas las páginas)
   ------------------------------------------------------------
   Contiene: design tokens, reset, tipografía base, fondo animado,
   footer, sistema de botones y banner de cookies.
   ============================================================ */

/* ------------------------------------------------------------
   Design tokens (paleta + gradientes)
   ------------------------------------------------------------ */
:root {
    /* Gradiente de marca */
    --grad-1: #FF7A18; /* naranja   */
    --grad-2: #FF3D77; /* rosa      */
    --grad-3: #A64DFF; /* violeta   */
    --grad-4: #4DA6FF; /* celeste   */

    /* Fondos dark PRO */
    --bg-primary: #2B004F;
    --bg-deep:    #1E0038;
    --bg-hover:   #3A0066;

    /* Texto sobre oscuro */
    --text-primary:   #FFFFFF;
    --text-secondary: #CFCFEA;

    /* Funcionales */
    --success: #22C55E;
    --warning: #F59E0B;
    --error:   #EF4444;
    --info:    #3B82F6;

    /* Gradiente compuesto */
    --gradient-brand: linear-gradient(90deg, var(--grad-1), var(--grad-2), var(--grad-3), var(--grad-4));
}

/* ------------------------------------------------------------
   Reset + base
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }

main {
    position: relative;
    z-index: 2;
    flex: 1;
}

/* ------------------------------------------------------------
   Fondo animado — blobs + grano + viñeta
   ------------------------------------------------------------ */
.bg-blobs {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    will-change: transform, opacity;
}

/* Dimensiones levemente elípticas para que la rotación sea visible:
   un círculo perfecto rotado se ve idéntico (simetría). */
.blob-1 {
    width: 540px; height: 480px;
    background: var(--grad-1);
    top: -160px; left: -120px;
    opacity: 0.45;
    animation: float-1 22s ease-in-out infinite;
}
.blob-2 {
    width: 460px; height: 500px;
    background: var(--grad-2);
    top: 45%; right: -160px;
    opacity: 0.40;
    animation: float-2 26s ease-in-out infinite;
}
.blob-3 {
    width: 460px; height: 400px;
    background: var(--grad-3);
    bottom: -140px; left: 28%;
    opacity: 0.50;
    animation: float-3 24s ease-in-out infinite;
}
.blob-4 {
    width: 360px; height: 410px;
    background: var(--grad-4);
    top: 18%; left: 48%;
    opacity: 0.35;
    animation: float-4 30s ease-in-out infinite;
}

/* Breathing asimétrico: algunos suben opacidad, otros bajan en el mismo
   instante, para que la escena respire sin sincronizarse visualmente. */
@keyframes float-1 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg);           opacity: 0.45; }
    50%      { transform: translate(170px, 130px) scale(1.18) rotate(6deg);  opacity: 0.55; }
}
@keyframes float-2 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg);             opacity: 0.40; }
    50%      { transform: translate(-190px, -110px) scale(0.88) rotate(-7deg); opacity: 0.30; }
}
@keyframes float-3 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg);            opacity: 0.50; }
    50%      { transform: translate(140px, -170px) scale(1.12) rotate(5deg);  opacity: 0.60; }
}
@keyframes float-4 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg);             opacity: 0.35; }
    50%      { transform: translate(-140px, 130px) scale(1.22) rotate(-8deg); opacity: 0.27; }
}

.grain {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(30, 0, 56, 0.6) 100%);
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
footer {
    position: relative;
    z-index: 2;
    padding: 24px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.grad-text {
    background: var(--gradient-brand);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-weight: 500;
    letter-spacing: 3px;
    animation: shimmer 8s linear infinite;
}

@keyframes shimmer {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.footer-sep {
    margin: 0 10px;
    opacity: 0.4;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease, opacity 0.3s ease;
    opacity: 0.85;
}
.footer-link:hover,
.footer-link:focus-visible {
    opacity: 1;
    background: var(--gradient-brand);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.footer-link:focus-visible {
    outline: 2px solid rgba(166, 77, 255, 0.6);
    outline-offset: 4px;
    border-radius: 2px;
}

/* ------------------------------------------------------------
   Sistema de botones (.btn, .btn-primary, .btn-ghost)
   ------------------------------------------------------------ */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 13px;
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: transform 0.2s ease, box-shadow 0.3s ease, background-position 0.4s ease, color 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
}
.btn:focus-visible {
    outline: 2px solid rgba(166, 77, 255, 0.6);
    outline-offset: 3px;
}
.btn:active { transform: translateY(0); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.15);
}
.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-primary {
    background: var(--gradient-brand);
    background-size: 200% 100%;
    color: #fff;
    box-shadow: 0 8px 24px rgba(166, 77, 255, 0.35);
}
.btn-primary:hover {
    background-position: 100% 0;
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(166, 77, 255, 0.5);
}

/* ------------------------------------------------------------
   Banner de cookies
   ------------------------------------------------------------ */
.cookie-banner {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 100;
    width: min(760px, calc(100% - 40px));
    padding: 18px 22px;
    background: rgba(30, 0, 56, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    transform: translateY(140%);
    opacity: 0;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.5s ease;
}
.cookie-banner.cookie-visible {
    transform: translateY(0);
    opacity: 1;
}

.cookie-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1 1 260px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}
.cookie-text strong {
    color: var(--text-primary);
    font-weight: 500;
}

.cookie-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 520px) {
    .cookie-banner {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        padding: 16px 18px;
        border-radius: 16px;
    }
    .cookie-text { font-size: 12.5px; }
    .cookie-actions { width: 100%; }
    .cookie-actions .btn { flex: 1; padding: 13px 14px; } /* target táctil ~44px */
}

/* ------------------------------------------------------------
   Responsive común (fondo)
   ------------------------------------------------------------ */
@media (max-width: 640px) {
    .blob { filter: blur(70px); }
    .blob-1, .blob-2, .blob-3, .blob-4 { width: 320px; height: 320px; }
}

/* ------------------------------------------------------------
   Accesibilidad — respeta preferencia de reducir movimiento
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
