/* ==========================================================================
   DAIA — Demo Agent IA "Vori"
   Sistema de disseny copiat de voradata.cat (mode fosc per defecte)
   ========================================================================== */

:root {
    --bg-main: #02040a;            /* Deep Night — gairebé negre amb to navy */
    --text-main: #e2e8f0;
    --accent-main: #f48e24;        /* Bold Copper */
    --accent-glow: rgba(244, 142, 36, 0.2);
    --accent-studio: #E98525;
    --studio-shadow: rgba(233, 133, 37, 0.2);

    --card-bg: rgba(255, 255, 255, 0.02);
    --card-border: rgba(255, 255, 255, 0.05);
    --card-hover-border: var(--accent-main);

    --text-muted: #94a3b8;
    --nav-bg: rgba(2, 4, 10, 0.85);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;

    --shadow-accent-10: rgba(244, 142, 36, 0.1);
    --shadow-accent-30: rgba(244, 142, 36, 0.3);
    --shadow-accent-40: rgba(244, 142, 36, 0.4);

    --orb-bg-1: rgba(244, 142, 36, 0.15);
    --orb-bg-2: rgba(233, 133, 37, 0.15);

    --nav-height: 80px;
    --spacing-md: 2rem;
    --spacing-xl: 6rem;
    --spacing-lg: 3rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    letter-spacing: -0.01em;
}

/* Texture Grain */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9998;
    pointer-events: none;
    opacity: 0.03;
    mix-blend-mode: overlay;
    background-image: url('data:image/svg+xml,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch" /></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)" /></svg>');
}

/* Classes utilitàries */
.mono {
    font-family: var(--font-mono);
}

.accent {
    color: var(--accent-main);
    background: linear-gradient(90deg, var(--accent-main), #ffaa55, var(--accent-studio), var(--accent-main));
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine-accent 6s linear infinite;
}

@keyframes shine-accent {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid var(--card-border);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--spacing-md);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-main);
    letter-spacing: -1px;
}

.logo .mono {
    font-weight: 600;
}

/* Pestanyes de la barra de navegació */
.nav-tabs {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-tab-btn:hover {
    color: var(--accent-main);
    border-color: rgba(244, 142, 36, 0.3);
}

.nav-tab-btn.active {
    background: rgba(244, 142, 36, 0.1);
    border-color: var(--accent-main);
    color: var(--accent-main);
    box-shadow: 0 0 12px var(--shadow-accent-10);
}

@media (max-width: 768px) {
    .navbar-container {
        flex-wrap: wrap;
        padding: 0.6rem 1rem;
        gap: 0.5rem;
        height: auto;
    }
    .navbar {
        height: auto;
    }
    .nav-tabs {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    .nav-tab-btn {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--nav-height) + var(--spacing-lg)) var(--spacing-md) var(--spacing-xl);
    position: relative;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 2;
}

.hero-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 5px;
    margin-bottom: 2rem;
    opacity: 0.7;
    position: relative;
    padding-left: 50px;
    display: inline-block;
}

.hero-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 40px;
    height: 1px;
    background: var(--accent-main);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 8vw, 5rem);
    font-weight: 800;
    line-height: 0.95;
    margin-bottom: var(--spacing-md);
    letter-spacing: -3px;
}

.hero-title .line {
    display: block;
}

.hero-subtitle {
    font-size: clamp(1.05rem, 2.5vw, 1.25rem);
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-inline: auto;
}

.hero-cta-group {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.hero-scroll-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(244, 142, 36, 0.08);
    border: 1px solid rgba(244, 142, 36, 0.35);
    color: var(--accent-main);
    padding: 0.75rem 1.4rem;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(244, 142, 36, 0.1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-scroll-btn:hover {
    background: rgba(244, 142, 36, 0.18);
    border-color: var(--accent-main);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 25px rgba(244, 142, 36, 0.25);
    color: #fff;
}

.hero-scroll-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounceDown 2s infinite ease-in-out;
}

@keyframes bounceDown {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(5px);
    }
    60% {
        transform: translateY(3px);
    }
}

/* Glow orbs */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 1;
    opacity: 0.4;
    pointer-events: none;
}

.orb-1 {
    top: 15%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: var(--orb-bg-1);
}

.orb-2 {
    bottom: 5%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: var(--orb-bg-2);
}

/* ==========================================================================
   Botons
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    text-align: center;
    font-family: var(--font-body);
}

.btn-outline {
    border: 1px solid var(--accent-main);
    color: var(--accent-main);
    font-size: 0.9rem;
    background: transparent;
}

.btn-outline:hover {
    background: var(--shadow-accent-10);
    box-shadow: 0 0 15px var(--shadow-accent-30);
}

.btn-primary {
    background: var(--accent-main);
    color: var(--bg-main);
    border: 1px solid var(--accent-main);
    font-size: 1.05rem;
    padding: 0.9rem 2.2rem;
}

.btn-primary:hover {
    background: transparent;
    color: var(--accent-main);
    box-shadow: 0 0 20px var(--shadow-accent-40);
    transform: translateY(-2px);
}

.btn[disabled] {
    opacity: 0.5;
    pointer-events: none;
}

/* ==========================================================================
   Demo Constitutional layout
   ========================================================================== */
.demo-section {
    padding: var(--spacing-xl) var(--spacing-md) calc(var(--spacing-xl) * 1.5);
    position: relative;
    z-index: 2;
}

.demo-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    letter-spacing: -2px;
}

/* Targetes de demo (estil feature-card) */
.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.demo-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0;
    padding: 3rem 2.5rem;
    position: relative;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(15px);
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    color: var(--text-main);
    font-family: var(--font-body);
}

.demo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-main);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.demo-card:hover,
.demo-card.active {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--card-hover-border);
    transform: translateY(-8px);
    box-shadow: 0 10px 30px var(--shadow-accent-10), inset 0 0 0 1px var(--shadow-accent-10);
}

.demo-card:hover::before,
.demo-card.active::before {
    transform: scaleX(1);
}

.demo-card.active {
    border-color: var(--accent-main);
}

.demo-icon {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--accent-main);
    margin-bottom: 1.5rem;
    opacity: 0.8;
    display: block;
}

.demo-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.demo-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Pestanya de treball activa */
.demo-workspace {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 3rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .demo-workspace {
        padding: 2rem 1.5rem;
    }
}

.workspace-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
}

.workspace-header .demo-icon {
    margin: 0;
}

.workspace-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.workspace-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   Chat workspace
   ========================================================================== */
.chat-log {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 440px;
    overflow-y: auto;
    padding: 0.5rem;
    margin-bottom: 1.5rem;
}

.chat-log::-webkit-scrollbar {
    width: 5px;
}

.chat-log::-webkit-scrollbar-track {
    background: transparent;
}

.chat-log::-webkit-scrollbar-thumb {
    background: rgba(244, 142, 36, 0.2);
    border-radius: 10px;
}

.message {
    display: flex;
    max-width: 85%;
    animation: message-appear 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: left bottom;
}

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    transform-origin: right bottom;
}

.message-content {
    padding: 0.8rem 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.bot .message-content {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-bottom-left-radius: 2px;
}

.user .message-content {
    background: var(--accent-main);
    color: #ffffff;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 12px rgba(244, 142, 36, 0.25);
}

.message-content strong {
    font-weight: 700;
}

@keyframes message-appear {
    0% { opacity: 0; transform: scale(0.9) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Indicador d'escriptura */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.3rem 0;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing-bounce 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Input */
.chat-input-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
}

.chat-input-area input,
.chat-input-area textarea {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    font-family: var(--font-body);
    resize: vertical;
}

.chat-input-area input:focus,
.chat-input-area textarea:focus {
    border-color: var(--accent-main);
    background: rgba(255, 255, 255, 0.05);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-main);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background-color 0.3s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: var(--accent-studio);
    transform: scale(1.05);
}

/* Xips de suggeriments */
.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.suggestion-chip {
    background: rgba(244, 142, 36, 0.05);
    border: 1px solid rgba(244, 142, 36, 0.25);
    color: var(--text-main);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.suggestion-chip:hover {
    background: var(--accent-main);
    color: #ffffff;
    border-color: var(--accent-main);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(244, 142, 36, 0.15);
}

/* ==========================================================================
   Controls / forms (RAG, PDF, Audio)
   ========================================================================== */
.control-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.file-label {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    border: 1px dashed rgba(244, 142, 36, 0.4);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-label:hover {
    border-color: var(--accent-main);
    color: var(--accent-main);
    background: var(--shadow-accent-10);
}

.file-label input[type="file"] {
    display: none;
}

.file-label span {
    font-family: var(--font-mono);
    color: var(--accent-main);
}

.select-model,
select,
input[type="text"],
input[type="number"] {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    padding: 0.7rem 1rem;
    border-radius: 6px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.3s ease;
}

.select-model:focus,
select:focus,
input[type="text"]:focus {
    border-color: var(--accent-main);
}

.status-line {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    min-height: 1.2rem;
}

.status-line.ok {
    color: #27c93f;
}

.status-line.err {
    color: #ff5f56;
}

.hint-line {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.hint-line strong {
    color: var(--accent-main);
}

.agent-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
}

.agent-status strong {
    color: var(--text-main);
}

.agent-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    background: #27c93f;
    border-radius: 50%;
    animation: pulse-online 2s infinite;
}

.doc-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.doc-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: rgba(244, 142, 36, 0.06);
    border: 1px solid rgba(244, 142, 36, 0.2);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    color: var(--text-muted);
}

.rag-source-note {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
    padding: 10px 12px;
    margin: 10px 0;
    border: 1px dashed rgba(114, 181, 255, 0.35);
    border-radius: 6px;
    background: rgba(114, 181, 255, 0.05);
    color: var(--text-muted);
}

.rag-source-note a {
    color: var(--accent-main);
    word-break: break-all;
}

.rag-source-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 3px;
    background: var(--accent-main);
    color: #16181c;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.rag-source-note [data-rag-save-status] {
    margin: 0;
    padding: 0;
}

/* Evidència RAG Vectorial */
.rag-evidence-card {
    margin-top: 10px;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(45, 212, 191, 0.05);
    border: 1px solid rgba(45, 212, 191, 0.25);
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: fadeIn 0.25s ease-out;
}

.rag-evidence-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.rag-evidence-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(45, 212, 191, 0.15);
    color: #2dd4bf;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(45, 212, 191, 0.3);
}

.rag-evidence-meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.rag-evidence-score {
    color: #10b981;
    font-weight: 700;
}

.rag-evidence-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.rag-evidence-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.73rem;
    color: var(--text-main);
}

.panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.panel-title {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
}

.audio-result {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    white-space: pre-wrap;
    color: var(--text-main);
    font-size: 0.95rem;
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.model-selector .select-model {
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* ==========================================================================
   Llistes i inputs de les demos 05 (WhatsApp) i 06 (Correu)
   ========================================================================== */
.sim-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    padding: 0.7rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    font-family: var(--font-body);
}

.sim-input:focus {
    border-color: var(--accent-main);
    background: rgba(255, 255, 255, 0.05);
}

.request-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.request-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
}

.request-meta {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.3rem;
    flex-wrap: wrap;
}

.request-meta strong {
    color: var(--accent-main);
    font-weight: 700;
    font-size: 0.9rem;
}

.request-phone {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.request-date {
    margin-left: auto;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    white-space: nowrap;
}

.request-body {
    color: var(--text-muted);
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.empty-note {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ==========================================================================
   Privacitat & LOPD — concepte de màrqueting a la portada
   ========================================================================== */
.privacy-section {
    position: relative;
    z-index: 2;
    padding: var(--spacing-xl) var(--spacing-md) 0;
}

.privacy-container {
    max-width: 1200px;
    margin: 0 auto;
}

.privacy-head {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.shield-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    border: 1px solid rgba(244, 142, 36, 0.35);
    background: var(--accent-glow);
    color: var(--accent-main);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.5px;
    box-shadow: 0 0 24px var(--shadow-accent-10);
    margin-bottom: 1.5rem;
}

.shield-chip svg {
    animation: shield-pulse 2.6s ease-in-out infinite;
}

@keyframes shield-pulse {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(244, 142, 36, 0.3)); }
    50% { filter: drop-shadow(0 0 11px var(--accent-main)); }
}

.privacy-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    letter-spacing: -2px;
}

.privacy-sub {
    color: var(--text-muted);
    max-width: 660px;
    margin: 1rem auto 0;
    font-size: 1.05rem;
}

.privacy-sub strong {
    color: var(--text-main);
}

/* Diagrama: fonts → nucli privat → núvol bloquejat */
.privacy-diagram {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1.1fr;
    gap: 1.2rem;
    align-items: stretch;
    margin-bottom: var(--spacing-lg);
}

@media (max-width: 860px) {
    .privacy-diagram {
        grid-template-columns: 1fr;
    }
}

.diagram-panel {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
}

.diagram-title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.diagram-sources {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.diagram-src {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    background: rgba(244, 142, 36, 0.05);
    border: 1px solid rgba(244, 142, 36, 0.18);
    font-size: 0.88rem;
}

.diagram-src .arrow {
    margin-left: auto;
    color: var(--accent-main);
    display: flex;
}

.diagram-core {
    text-align: center;
    border: 2px solid var(--accent-main);
    border-radius: 16px;
    background: radial-gradient(circle at 50% 25%, rgba(244, 142, 36, 0.16), rgba(2, 4, 10, 0.35));
    padding: 2.2rem 1rem;
    box-shadow: 0 0 32px var(--shadow-accent-10);
}

.diagram-core .core-shield {
    color: var(--accent-main);
    margin-bottom: 1rem;
    animation: shield-pulse 2.6s ease-in-out infinite;
    display: block;
}

.core-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--text-main);
}

.core-tagline {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0.4rem 0 1rem;
}

.core-pill {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    background: var(--accent-main);
    color: #02040a;
    font-size: 0.75rem;
    font-weight: 700;
}

.diagram-blocked {
    border-color: rgba(255, 95, 86, 0.25);
}

.diagram-blocked .diagram-title {
    color: #ff5f56;
}

.blocked-x {
    color: #ff5f56;
    font-size: 1.7rem;
    line-height: 1;
    margin-bottom: 0.4rem;
}

.blocked-title {
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.blocked-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.blocked-list li {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.blocked-list li::before {
    content: '✕';
    color: #ff5f56;
    flex-shrink: 0;
}

/* Estadístiques d'impacte */
.privacy-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.privacy-stat {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
}

.stat-num {
    display: block;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 2.3rem;
    color: var(--accent-main);
    letter-spacing: -1px;
}

.stat-txt {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==========================================================================
   Comercial — inversió i preu
   ========================================================================== */
.pricing-section {
    position: relative;
    z-index: 2;
    padding: var(--spacing-xl) var(--spacing-md) var(--spacing-xl);
}

.pricing-container {
    max-width: 1200px;
    margin: 0 auto;
}

.pricing-card {
    border: 1px solid rgba(244, 142, 36, 0.35);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(244, 142, 36, 0.06), rgba(2, 4, 10, 0.2));
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(244, 142, 36, 0.05);
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 2.5rem;
    padding: 2.5rem;
}

@media (max-width: 760px) {
    .pricing-card {
        grid-template-columns: 1fr;
        padding: 1.8rem;
    }
}

.pricing-includes h3,
.pricing-plan h3 {
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 1.25rem;
    font-size: 1.15rem;
}

.pricing-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.pricing-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.pricing-list li::before {
    content: '✓';
    color: var(--accent-main);
    font-weight: 700;
    flex-shrink: 0;
}

.pricing-list .price {
    margin-left: auto;
    font-family: var(--font-mono);
    color: var(--text-main);
    white-space: nowrap;
}

.pricing-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(244, 142, 36, 0.3);
    font-weight: 600;
}

.pricing-total .total-cap {
    color: var(--text-main);
}

.pricing-total .amount {
    font-family: var(--font-mono);
    color: var(--accent-main);
    font-size: 1.35rem;
    font-weight: 800;
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.plan-price .cur {
    font-family: var(--font-mono);
    color: var(--accent-main);
    font-size: 1.4rem;
    font-weight: 800;
}

.plan-price .amount {
    font-family: var(--font-heading);
    font-size: clamp(2.6rem, 6vw, 3.6rem);
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -2px;
    line-height: 1;
}

.plan-price .per {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.plan-period {
    color: var(--text-muted);
    margin: 0.5rem 0 1.3rem;
    font-size: 0.95rem;
}

.plan-ownership {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border-radius: 20px;
    background: var(--accent-glow);
    border: 1px solid rgba(244, 142, 36, 0.3);
    color: var(--accent-main);
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
}

.plan-maintenance {
    border-top: 1px dashed rgba(244, 142, 36, 0.3);
    padding-top: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.plan-maintenance .mt-label {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.plan-maintenance .mt-sub {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.2rem;
    opacity: 0.8;
}

.plan-maintenance .mt-price {
    font-family: var(--font-mono);
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
}

.pricing-fine {
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-family: var(--font-mono);
    text-align: center;
    opacity: 0.9;
}

/* ==========================================================================
   Diagrama de xarxa — estil "tracert" (el viatge de les dades)
   ========================================================================== */
.network-section {
    position: relative;
    z-index: 2;
    padding: var(--spacing-xl) var(--spacing-md) 0;
}

.c-accent { color: var(--accent-main); }

.net-sources {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.net-source {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(244, 142, 36, 0.22);
    color: var(--text-muted);
}

.net-source.hot {
    color: var(--accent-main);
    border-color: rgba(244, 142, 36, 0.4);
}

.net-terminal {
    border: 1px solid rgba(244, 142, 36, 0.3);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.net-term-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    background: rgba(2, 4, 10, 0.6);
    border-bottom: 1px solid var(--card-border);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.net-term-bar .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.net-term-bar .dot-1 { background: #ff5f56; }
.net-term-bar .dot-2 { background: #ffbd2e; }
.net-term-bar .dot-3 { background: #27c93f; }

.net-term-title {
    margin-left: 0.6rem;
    letter-spacing: 0.3px;
}

.net-term-title .prompt {
    color: var(--accent-main);
    font-weight: 700;
}

.net-term-body {
    background:
        linear-gradient(rgba(244, 142, 36, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(244, 142, 36, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    background-color: rgba(2, 4, 10, 0.55);
    padding: 1.5rem 1.6rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.5;
}

.net-route-title {
    color: var(--text-muted);
    margin-bottom: 1.3rem;
}

.net-route-title .c-accent {
    font-weight: 700;
}

.net-hop {
    display: grid;
    grid-template-columns: 3.4rem 1fr auto;
    align-items: baseline;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
}

.net-hop-num {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.net-hop-info {
    min-width: 0;
}

.net-hop-name {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
}

.net-hop-desc {
    display: block;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 400;
    padding-top: 0.1rem;
}

.net-hop-ms {
    color: var(--accent-main);
    font-size: 0.78rem;
    white-space: nowrap;
}

.net-hop-core {
    background: var(--accent-glow);
    border: 1px solid rgba(244, 142, 36, 0.3);
    box-shadow: 0 0 20px var(--shadow-accent-10);
}

.net-hop-core .net-hop-name {
    color: var(--accent-main);
    font-weight: 700;
}

.net-line {
    position: relative;
    width: 2px;
    height: 20px;
    margin-left: 3.4rem;
    background: linear-gradient(rgba(244, 142, 36, 0.15), rgba(244, 142, 36, 0.5));
}

.net-line::after {
    content: '';
    position: absolute;
    left: -2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-main);
    box-shadow: 0 0 6px var(--accent-main);
    animation: net-packet 1.4s ease-in-out infinite;
}

@keyframes net-packet {
    0% { top: 1px; opacity: 0; }
    30% { opacity: 1; }
    100% { top: calc(100% - 7px); opacity: 0; }
}

.net-final {
    margin-top: 1.3rem;
    padding-top: 0.9rem;
    border-top: 1px dashed rgba(244, 142, 36, 0.25);
    color: var(--text-muted);
    font-size: 0.82rem;
}

.net-final .c-accent {
    font-weight: 700;
}

@media (max-width: 520px) {
    .net-hop {
        grid-template-columns: 2.6rem 1fr;
    }
    .net-hop-ms {
        grid-column: 2;
        justify-self: start;
    }
}

/* ==========================================================================
   Diagrama de xarxa — topologia i moviment de paquets (estil Packet Tracer)
   ========================================================================== */
.pt-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.2rem;
    align-items: stretch;
}

@media (max-width: 920px) {
    .pt-layout {
        grid-template-columns: 1fr;
    }
}

.pt-canvas-wrap {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: rgba(2, 4, 10, 0.45);
    padding: 0.8rem 1rem;
    overflow: hidden;
}

.pt-canvas {
    display: block;
    width: 100%;
    height: auto;
}

/* --- elements SVG --- */
.pt-boundary {
    stroke: rgba(244, 142, 36, 0.35);
    fill: rgba(244, 142, 36, 0.03);
    stroke-dasharray: 6 6;
}

.pt-title {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 2px;
    fill: var(--accent-main);
}

.pt-label {
    font-family: var(--font-mono);
    font-size: 13px;
    fill: #94a3b8;
}

.pt-label-daia {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 700;
    fill: var(--accent-main);
}

.pt-cable {
    stroke: rgba(244, 142, 36, 0.3);
    fill: none;
    stroke-width: 1.5;
}

.pt-cable-back {
    stroke: rgba(45, 212, 191, 0.35);
    fill: none;
    stroke-width: 1.5;
}

.pt-node-icon {
    stroke: var(--accent-main);
    fill: rgba(244, 142, 36, 0.08);
    stroke-width: 1.5;
}

.pt-node-line {
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 1.5;
}

.pt-daia {
    stroke: var(--accent-main);
    fill: none;
    stroke-width: 1.5;
}

/* --- paquets (PDU) --- */
.pt-pdu {
    stroke: rgba(2, 4, 10, 0.45);
}

.pt-pdu.c1 { fill: #ffbd2e; }
.pt-pdu.c2 { fill: #f48e24; }
.pt-pdu.c3 { fill: #ffaa55; }
.pt-pdu.c4 { fill: #2dd4bf; }

/* --- Finestra PDU Information --- */
.pt-pdu-panel {
    border: 1px solid rgba(244, 142, 36, 0.3);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(2, 4, 10, 0.45);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.pt-pdu-bar {
    padding: 0.55rem 1rem;
    background: rgba(244, 142, 36, 0.12);
    border-bottom: 1px solid rgba(244, 142, 36, 0.2);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent-main);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pt-pdu-bar .dot-blink {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27c93f;
    box-shadow: 0 0 6px #27c93f;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0.3; }
}

.pt-frame {
    padding: 1rem;
}

.pt-pdu-row {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.32rem 0;
    border-bottom: 1px dashed rgba(244, 142, 36, 0.12);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.pt-pdu-row .k { color: var(--text-muted); }
.pt-pdu-row .v { color: var(--text-main); text-align: right; }

.pt-pdu-layer {
    margin-top: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 1px;
    color: var(--accent-main);
    text-transform: uppercase;
    opacity: 0.85;
}

.pt-pdu-data {
    margin-top: 0.5rem;
    padding: 0.6rem 0.7rem;
    border-radius: 6px;
    background: rgba(244, 142, 36, 0.06);
    border: 1px solid rgba(244, 142, 36, 0.18);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.pt-pdu-data .q {
    color: var(--text-main);
}

/* cross-fade dels dos estats (bucle de 8s) */
.pt-frame--in { animation: pdu-in 8s infinite; }
.pt-frame--out { animation: pdu-out 8s infinite; }

@keyframes pdu-in {
    0%, 44% { opacity: 1; }
    56%, 100% { opacity: 0; }
}

@keyframes pdu-out {
    0%, 44% { opacity: 0; }
    56%, 100% { opacity: 1; }
}

.pt-legend {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.2rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.pt-legend .sw {
    width: 12px;
    height: 9px;
    border-radius: 2px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.35rem;
}

.pt-note {
    margin-top: 1.2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    text-align: center;
}

.pt-note .c-accent {
    font-weight: 700;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    border-top: 1px solid var(--card-border);
    padding: var(--spacing-md);
    background: rgba(2, 4, 10, 0.6);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.footer-container .accent {
    color: var(--accent-main);
    background: none;
    -webkit-text-fill-color: var(--accent-main);
}

.hidden {
    display: none !important;
}

/* --- Demo 06 · Correu: correu entrant + resposta assistida --- */
.nav-badge {
    display: inline-block;
    min-width: 16px;
    padding: 0 5px;
    margin-left: 6px;
    border-radius: 10px;
    background: #ff5f56;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    vertical-align: 2px;
}

.new-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--accent-main);
    color: #0a0a0a;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.mail-email-head {
    padding: 10px 0 6px;
}

.mail-email-body {
    margin: 8px 0 4px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 220px;
    overflow: auto;
}

#mail-reply-text {
    width: 100%;
    margin: 8px 0 10px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-main);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
}

#mail-reply-text:focus {
    outline: none;
    border-color: var(--accent-main);
}

/* ==========================================================================
   Porta d'accés (gate) — presentació de Vori + LOPD + nom
   ========================================================================== */
.gate {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.25rem;
    position: relative;
}

.gate-card {
    position: relative;
    width: 100%;
    max-width: 620px;
    padding: 2.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    text-align: center;
}

.gate-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--accent-main);
    box-shadow: 0 0 24px var(--accent-glow);
    background: rgba(244, 142, 36, 0.08);
}

.gate-title {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin-bottom: 6px;
}

.gate-sub {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 22px;
}

.gate-speech {
    text-align: left;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--card-border);
    border-left: 3px solid var(--accent-main);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 18px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.gate-speech p + p {
    margin-top: 10px;
}

.gate-lopd {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    text-align: left;
    background: rgba(244, 142, 36, 0.06);
    border: 1px solid rgba(244, 142, 36, 0.28);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.gate-lopd svg {
    flex-shrink: 0;
    color: var(--accent-main);
    margin-top: 2px;
}

.gate-error {
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(220, 38, 38, 0.45);
    color: #fca5a5;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.88rem;
    text-align: left;
}

.gate-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.gate-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.gate-field span {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.gate-field input {
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-main);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.gate-field input:focus {
    outline: none;
    border-color: var(--accent-main);
}

.gate-btn {
    padding: 13px 20px;
    background: var(--accent-main);
    color: var(--bg-main);
    border: none;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.gate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--shadow-accent-30);
}

.gate-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 18px;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gate-or::before,
.gate-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--card-border);
}

.gate-qr {
    padding: 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 10px;
}

.gate-pair {
    margin-bottom: 20px;
}

.gate-pair-label {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.gate-qr-big {
    display: inline-block;
    padding: 12px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    box-shadow: 0 0 32px var(--accent-glow);
}

.gate-qr-big img {
    display: block;
    width: 220px;
    height: 220px;
    border-radius: 4px;
    image-rendering: pixelated;
}

.gate-pair-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.gate-spinner {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    border: 2px solid var(--card-border);
    border-top-color: var(--accent-main);
    border-radius: 50%;
    animation: gate-spin 0.8s linear infinite;
}

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

.gate-pair-hint {
    margin-top: 14px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.gate-done {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    background: rgba(39, 201, 63, 0.08);
    border: 1px solid rgba(39, 201, 63, 0.35);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.gate-done svg {
    flex-shrink: 0;
}

.gate-qr-label {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
}

.gate-qr img {
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: #fff;
    padding: 5px;
}

.gate-qr p {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.gate-exit {
    display: inline-block;
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-decoration: underline;
}

.gate-exit:hover {
    color: var(--accent-main);
}

@media (max-width: 768px) {
    .gate-card {
        padding: 1.75rem;
    }

    .gate-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}

.gate-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0;
    text-align: left;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
    cursor: pointer;
}

.gate-checkbox input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--accent-main);
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.gate-checkbox a {
    color: var(--accent-main);
    text-decoration: underline;
}

.gate-checkbox a:hover {
    color: #ffffff;
}

/* Honeypot anti-bot: camp invisible per a humans, visible per a bots */
/* NO usar display:none (els bots el detecten) — usar posicionament fora de pantalla */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    tab-index: -1;
}

/* ==========================================================================
   DAIA Modal (UX Modal sense scroll)
   ========================================================================== */
.daia-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.daia-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.daia-modal {
    background: #090d16;
    border: 1px solid rgba(244, 142, 36, 0.25);
    border-radius: 14px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px var(--accent-glow);
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96) translateY(12px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Capçalera del Modal */
.daia-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--card-border);
    gap: 1rem;
}

.daia-modal-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.daia-modal-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.daia-modal-privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #27c93f;
    background: rgba(39, 201, 63, 0.1);
    border: 1px solid rgba(39, 201, 63, 0.25);
    border-radius: 20px;
    padding: 3px 10px;
    width: fit-content;
}

.daia-modal-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    font-size: 1.3rem;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.daia-modal-close-btn:hover {
    color: #ffffff;
    background: rgba(244, 142, 36, 0.2);
    border-color: var(--accent-main);
}

/* Cos en 2 columnes */
.daia-modal-body {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.5rem;
    padding: 1.5rem 1.75rem;
    overflow-y: auto;
    flex: 1;
}

@media (max-width: 860px) {
    .daia-modal-body {
        grid-template-columns: 1fr;
    }
}

/* Columna Esquerra: Document amb Bounding Boxes */
.daia-doc-viewer {
    background: #04060c;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.daia-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.daia-doc-canvas {
    position: relative;
    background: #0e121e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 1.2rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.5;
    user-select: none;
    min-height: 320px;
    overflow: hidden;
}

/* Bounding box highlighter */
.daia-bbox {
    position: relative;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 1px 2px;
    border: 1px dashed var(--accent-main);
    background: rgba(244, 142, 36, 0.12);
    transition: all 0.2s ease;
}

.daia-bbox:hover, .daia-bbox.active {
    background: rgba(244, 142, 36, 0.28);
    box-shadow: 0 0 10px rgba(244, 142, 36, 0.4);
    border-style: solid;
}

.daia-bbox-tag {
    position: absolute;
    top: -15px;
    left: -1px;
    background: var(--accent-main);
    color: #02040a;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0 4px;
    border-radius: 3px;
    white-space: nowrap;
    opacity: 0.9;
    pointer-events: none;
}

/* Columna Dreta: Dades Estructurades / JSON */
.daia-data-viewer {
    background: #04060c;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.daia-data-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.6rem;
}

.daia-tab-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.daia-tab-toggle.active {
    color: var(--accent-main);
    background: rgba(244, 142, 36, 0.12);
}

.daia-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    color: var(--text-main);
}

.daia-table th, .daia-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
}

.daia-table th {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-weight: 500;
}

.daia-table td.field-name {
    color: #94a3b8;
    font-family: var(--font-mono);
}

.daia-table td.field-val {
    font-weight: 600;
    color: #f1f5f9;
}

.daia-json-pre {
    background: #02040a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #38bdf8;
    overflow-x: auto;
    max-height: 320px;
    line-height: 1.45;
}

/* Peu del Modal */
.daia-modal-footer {
    padding: 1.1rem 1.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.daia-modal-metrics {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.daia-metric-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.daia-metric-val {
    color: #27c93f;
    font-weight: 600;
}

.daia-modal-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--accent-main), var(--accent-studio));
    color: #02040a;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(244, 142, 36, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.daia-modal-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 142, 36, 0.4);
}

/* Botó o targeta per provar solució */
.demo-card {
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.demo-card:hover {
    border-color: var(--accent-main);
    transform: translateY(-3px);
}

.demo-card-action {
    margin-top: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-main);
    font-weight: 600;
}

/* ==========================================================================
   Modul Desactivat: Overlay & Segell Stamp Vermell a 45 graus
   ========================================================================== */
.module-deactivated-card {
    position: relative;
    overflow: hidden;
    filter: grayscale(0.85);
    opacity: 0.65;
    pointer-events: none;
    user-select: none;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.module-deactivated-card .demo-card-action {
    color: #ef4444 !important;
}

.workspace-panel-disabled-wrap {
    position: relative;
    min-height: 480px;
}

.stamp-banner-overlay {
    position: absolute;
    inset: 0;
    z-index: 100;
    background: rgba(2, 4, 10, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    pointer-events: all;
    user-select: none;
}

.stamp-badge-45 {
    display: inline-block;
    transform: rotate(-12deg);
    padding: 0.8rem 2.8rem;
    color: #ef4444;
    border: 4px dashed #ef4444;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 900;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.25), inset 0 0 20px rgba(239, 68, 68, 0.15);
    background: rgba(239, 68, 68, 0.08);
    margin-bottom: 1.5rem;
    animation: stampPulse 3s ease-in-out infinite alternate;
}

@keyframes stampPulse {
    0% {
        transform: rotate(-12deg) scale(0.98);
        box-shadow: 0 0 25px rgba(239, 68, 68, 0.2);
    }
    100% {
        transform: rotate(-12deg) scale(1.02);
        box-shadow: 0 0 45px rgba(239, 68, 68, 0.4);
    }
}

.stamp-card-tag {
    position: absolute;
    top: 18px;
    right: -32px;
    transform: rotate(45deg);
    background: #ef4444;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    padding: 4px 38px;
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.stamp-banner-overlay p {
    max-width: 460px;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
    margin-top: 0.5rem;
}

.stamp-banner-overlay .stamp-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 8px 18px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.stamp-banner-overlay .stamp-contact-link:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}