/* ========================================================
   Scriflow — Premium Dark Design System
   Inspired by Linear, Vercel, Raycast
   ======================================================== */

/* System font stack — no external font request needed */

/* ─── Tokens ─── */
:root {
    --bg: #030303;
    --bg-accent: #111111;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-2: rgba(255, 255, 255, 0.07);
    --surface-3: rgba(255, 255, 255, 0.10);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.12);
    --border-hover: rgba(255, 255, 255, 0.18);
    --text: #ffffff;
    --text-2: #8a8a93;
    --text-muted: #5e5e66;
    --accent: #00e5c9;
    --accent-2: #4f9eff;
    --accent-purple: #a78bfa;
    --accent-glow: rgba(0, 229, 201, 0.12);
    --header-h: 56px;
    --sidebar-w: 250px;
    --radius-lg: 24px;
    --radius-md: 12px;
    --copilot-w: 380px;
}

/* ─── User Auth Section (header) ─── */
.user-auth-section {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

html,
body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* ════════════════════════════════════
   HEADER
════════════════════════════════════ */
header {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--header-h);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
}

.logo {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #00e5c9 0%, #4f9eff 60%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    user-select: none;
    cursor: default;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 13px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.18s ease;
    white-space: nowrap;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-ghost {
    background: var(--surface-2);
    color: var(--text-2);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--surface-3);
    color: var(--text);
    border-color: var(--border-hover);
}

.btn-primary {
    background: linear-gradient(135deg, #00e5c9 0%, #4f9eff 100%);
    color: #050508;
    font-weight: 700;
    box-shadow: 0 0 20px rgba(0, 229, 201, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 24px rgba(0, 229, 201, 0.35);
    filter: brightness(1.08);
}

.btn-n8n {
    background: linear-gradient(135deg, #f84f39 0%, #c42314 100%);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 0 16px rgba(248, 79, 57, 0.2);
}

.btn-n8n:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(248, 79, 57, 0.35);
}

.btn-n8n:disabled {
    opacity: 0.5;
}

.n8n-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.8);
    flex-shrink: 0;
}

/* ════════════════════════════════════
   LAYOUT
════════════════════════════════════ */
body {
    display: block;
    /* Change from grid to block for landing */
    height: 100vh;
    overflow: hidden;
}

header {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--header-h);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.icon-btn-header {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-2);
    cursor: pointer;
    padding: 6px;
    margin-right: 12px;
    border-radius: 8px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.icon-btn-header:hover {
    color: var(--accent);
    background: var(--surface-hover);
    border-color: rgba(0, 229, 201, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.icon-btn-header svg {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.icon-btn-header:hover svg {
    transform: scale(1.1);
}

body.sidebar-closed header {
    left: 0;
}

.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.breadcrumb-item {
    color: var(--text-muted);
}

.breadcrumb-item.active {
    color: var(--text);
    font-weight: 700;
}

.breadcrumb-sep {
    color: var(--text-muted);
    opacity: 0.5;
}

main {
    position: absolute;
    top: var(--header-h);
    left: var(--sidebar-w);
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body.sidebar-closed main {
    left: 0;
}

aside {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    bottom: 0;
    border-right: 1px solid var(--border);
    background: var(--bg-accent);
    z-index: 110;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body.sidebar-closed aside {
    transform: translateX(-100%);
}


@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ════════════════════════════════════
   PROMPT BAR — Modo centrado (idle) y modo barra (activo)
════════════════════════════════════ */
.prompt-bar {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-2);
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    flex-shrink: 0;
    position: relative;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Fade-in al entrar al app */
@keyframes fadeInApp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-entering {
    animation: fadeInApp 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Estado IDLE: prompt bar siempre al fondo, sin layout centrado */

/* idle-hero siempre oculto (eliminamos el layout chat) */
#app-main.idle-mode .idle-hero,
.idle-hero {
    display: none !important;
}

/* La prompt bar SIEMPRE en la parte inferior, sin cambios de posición */
#app-main.idle-mode .prompt-bar {
    position: relative;
    width: 100%;
    border: none;
    border-radius: 0;
    background: var(--bg-2);
    box-shadow: none;
    order: unset;
    margin-bottom: 0;
}

/* Mostrar tabs en idle */
#app-main.idle-mode .view-tabs-container {
    display: flex !important;
}

/* Mostrar canvas con idle-layer (una sola animación) */
#app-main.idle-mode #canvas-wrapper {
    display: flex !important;
    flex: 1;
}

/* Ocultar en idle: empty-state (duplica animación), json, loading */
#app-main.idle-mode #json-wrapper,
#app-main.idle-mode #empty-state,
#app-main.idle-mode #loading-state {
    display: none !important;
}

.prompt-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
}

#app-main.idle-mode .prompt-bar::after {
    display: block;
}

.prompt-bar textarea {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.875rem;
    font-family: inherit;
    padding: 12px 14px;
    resize: none;
    outline: none;
    min-height: 80px;
    max-height: 55vh;
    overflow-y: auto;
    scrollbar-width: none;
    line-height: 1.6;
    transition: border-color 0.2s, box-shadow 0.2s;
    letter-spacing: -0.01em;
}

.prompt-bar textarea::-webkit-scrollbar {
    display: none;
}

.prompt-bar textarea:focus {
    border-color: rgba(0, 229, 201, 0.35);
    box-shadow: 0 0 0 3px rgba(0, 229, 201, 0.06), inset 0 0 20px rgba(0, 229, 201, 0.02);
}

.prompt-bar textarea::placeholder {
    color: var(--text-muted);
}

.prompt-controls {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.model-select-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Opción de modelo bloqueada (plan free) */
select option.locked-model {
    color: var(--text-muted);
}

.model-lock-badge {
    font-size: 0.65rem;
    background: rgba(167, 139, 250, 0.12);
    color: var(--accent-purple);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 5px;
    padding: 1px 6px;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.prompt-controls label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

select {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0 10px;
    height: 34px;
    border-radius: 9px;
    outline: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-family: inherit;
    font-weight: 500;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2355556a' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

select option {
    background: var(--bg-accent);
    color: var(--text);
}

select:focus {
    border-color: rgba(0, 229, 201, 0.35);
}

#generateBtn {
    height: 44px;
    padding: 0 24px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    gap: 8px;
    white-space: nowrap;
}

/* ════════════════════════════════════
   VIEW TABS
════════════════════════════════════ */
.view-tabs-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: var(--bg-accent);
    padding-right: 12px;
    flex-shrink: 0;
}

.view-tabs {
    display: flex;
    padding: 0 10px;
    gap: 2px;
}

.view-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.btn-sm {
    height: 36px;
    padding: 0 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-sm svg {
    width: 16px;
    height: 16px;
}

.btn-accent {
    background: rgba(0, 229, 201, 0.05);
    color: var(--accent);
    border: 1px solid rgba(0, 229, 201, 0.2);
    font-weight: 600;
    transition: all 0.2s;
}

.btn-accent:hover {
    background: rgba(0, 229, 201, 0.12);
    border-color: rgba(0, 229, 201, 0.4);
}

.tab {
    height: 38px;
    padding: 0 14px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.18s;
    position: relative;
    top: 1px;
    letter-spacing: -0.01em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tab svg {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab.active svg {
    color: var(--accent);
}


.tab:hover {
    color: var(--text-2);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ════════════════════════════════════
   STATES (Empty / Loading)
════════════════════════════════════ */
#empty-state,
#loading-state {
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

#loading-state {
    justify-content: center;
    align-items: center;
}

#loading-state::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

#loading-particle-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.loading-progress {
    position: absolute;
    bottom: 22%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 260px;
    opacity: 0;
    animation: fadeInProgress 0.6s ease 0.8s forwards;
}

@keyframes fadeInProgress {
    to { opacity: 1; }
}

.loading-progress span {
    font-size: 0.82rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    text-align: center;
    transition: opacity 0.3s ease;
}

.loading-percent {
    font-size: 0.75rem !important;
    font-variant-numeric: tabular-nums;
    color: var(--accent) !important;
    opacity: 0.8;
}

.loading-progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.loading-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent), rgba(79, 158, 255, 0.8));
    transition: width 0.5s ease;
    box-shadow: 0 0 8px rgba(0, 229, 201, 0.3);
}

#idle-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.loading-orbital {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Idle state: same orbital, slower + more visible so it's not missed */
#idle-layer .idle-orbital {
    z-index: 1;
}

#idle-layer .idle-orbital .loading-orbital-rings {
    width: 140px;
    height: 140px;
}

#idle-layer .idle-orbital .loading-ring-outer {
    animation-duration: 12s;
    border-color: rgba(0, 229, 201, 0.35);
}

#idle-layer .idle-orbital .loading-ring-mid {
    animation-duration: 8s;
    border-color: rgba(79, 158, 255, 0.4);
}

#idle-layer .idle-orbital .loading-ring-inner {
    animation-duration: 5s;
    border-color: rgba(0, 229, 201, 0.5);
    border-width: 2px;
}

#idle-layer .idle-orbital .loading-orbit-outer {
    animation-duration: 12s;
}

#idle-layer .idle-orbital .loading-orbit-inner {
    animation-duration: 5s;
}

#idle-layer .idle-orbital .loading-core::before {
    animation-duration: 3s;
    opacity: 1;
    width: 40px;
    height: 40px;
    box-shadow: 0 0 24px rgba(0, 229, 201, 0.7), 0 0 48px rgba(0, 229, 201, 0.25);
}

#idle-layer .idle-orbital .loading-dot-outer {
    box-shadow: 0 0 12px var(--accent), 0 0 24px rgba(0, 229, 201, 0.6);
}

#idle-layer .idle-orbital .loading-dot-inner {
    box-shadow: 0 0 10px #00aaff, 0 0 20px rgba(0, 170, 255, 0.5);
}

.loading-orbital-rings {
    position: relative;
    width: 120px;
    height: 120px;
}

.loading-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(0, 229, 201, 0.15);
}

.loading-ring-outer {
    inset: 0;
    border-color: rgba(0, 229, 201, 0.15);
    animation: loadingSpin 8s linear infinite;
}

.loading-ring-mid {
    inset: 15px;
    border-color: rgba(79, 158, 255, 0.2);
    animation: loadingSpinReverse 5s linear infinite;
}

.loading-ring-inner {
    inset: 30px;
    border-width: 1.5px;
    border-color: rgba(0, 229, 201, 0.4);
    animation: loadingSpin 3s linear infinite;
}

.loading-orbit {
    position: absolute;
}

.loading-orbit-outer {
    inset: 0;
    animation: loadingSpin 8s linear infinite;
}

.loading-orbit-inner {
    inset: 30px;
    animation: loadingSpinReverse 3s linear infinite;
}

.loading-dot {
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
}

.loading-dot-outer {
    width: 8px;
    height: 8px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent), 0 0 20px rgba(0, 229, 201, 0.5);
}

.loading-dot-inner {
    width: 6px;
    height: 6px;
    background: #00aaff;
    box-shadow: 0 0 8px #00aaff;
}

.loading-core {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-core::before {
    content: '';
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 229, 201, 0.8) 0%, rgba(0, 229, 201, 0.1) 60%, transparent 100%);
    box-shadow: 0 0 20px rgba(0, 229, 201, 0.6), 0 0 40px rgba(0, 229, 201, 0.2);
    animation: loadingCorePulse 2s ease-in-out infinite;
}

@keyframes loadingSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes loadingSpinReverse {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

@keyframes loadingCorePulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Dot grid */
#empty-state::before,
#canvas-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

/* Canvas: dot grid with radial mask (fade at edges) */
#canvas-wrapper::before {
    animation: canvasGridPulse 5s ease-in-out infinite;
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 0%, transparent 72%);
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 0%, transparent 72%);
}

@keyframes canvasGridPulse {

    0%,
    100% {
        opacity: 0.9;
    }

    50% {
        opacity: 1;
    }
}

/* Ambient radial glow — behind orbital so orbital stays visible */
#empty-state::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(0, 229, 201, 0.06) 0%, rgba(79, 158, 255, 0.04) 35%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: ambientPulse 4s ease-in-out infinite;
}

@keyframes ambientPulse {

    0%,
    100% {
        opacity: 0.7;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.08);
    }
}

.empty-icon {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 2;
    animation: floatIcon 3s ease-in-out infinite;
}

.empty-icon svg {
    width: 64px;
    height: 64px;
    color: var(--accent);
    filter: drop-shadow(0 0 20px rgba(0, 229, 201, 0.5)) drop-shadow(0 0 40px rgba(0, 229, 201, 0.2));
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0) rotate(-2deg);
    }

    50% {
        transform: translateY(-10px) rotate(2deg);
    }
}

.empty-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    position: relative;
    z-index: 2;
}

.empty-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
    max-width: 280px;
    text-align: center;
    line-height: 1.65;
    position: relative;
    z-index: 2;
}

/* Loading */
.spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2.5px solid var(--surface-3);
    border-top-color: var(--accent);
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    font-size: 0.85rem;
    color: var(--text-2);
    font-weight: 500;
    letter-spacing: -0.01em;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* ════════════════════════════════════
   CANVAS WRAPPER
════════════════════════════════════ */
#canvas-wrapper {
    display: none;
    flex: 1;
    position: relative;
    background: var(--bg);
    overflow: hidden;
}

#canvas-wrapper.active {
    display: block;
}

#canvas-wrapper.reveal-nodes {
    animation: revealNodes 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes revealNodes {
    from {
        opacity: 0;
        filter: blur(6px);
    }
    to {
        opacity: 1;
        filter: blur(0px);
    }
}

/* Canvas: corner glows + centered ambient glow */
#canvas-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 70% at 50% 50%, rgba(0, 229, 201, 0.06) 0%, rgba(79, 158, 255, 0.03) 40%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 5% 5%, rgba(0, 229, 201, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 95% 95%, rgba(79, 158, 255, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
    animation: canvasGlowPulse 6s ease-in-out infinite;
}

@keyframes canvasGlowPulse {

    0%,
    100% {
        opacity: 0.85;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

#flowCanvas {
    width: 100%;
    height: 100%;
    cursor: grab;
    position: relative;
    overflow: hidden;
}

#flowCanvas:active {
    cursor: grabbing;
}

#canvasInner {
    position: absolute;
    transform-origin: 0 0;
    transition: transform 0.05s linear;
}

/* ─── Canvas Toolbar (Zoom) — glassmorphism ─── */
.canvas-toolbar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(10, 20, 18, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 229, 201, 0.12);
    border-radius: 14px;
    z-index: 1000;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#app-main[style*="display: flex"] .canvas-toolbar {
    display: flex;
    /* Only show when app main is flex */
}

.canvas-tool {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.canvas-tool svg {
    width: 15px;
    height: 15px;
}

.canvas-tool:hover {
    background: var(--surface-2);
    color: var(--text);
}

/* ════════════════════════════════════
   JSON WRAPPER
════════════════════════════════════ */
#json-wrapper {
    display: none;
    flex: 1;
    overflow: auto;
    background: var(--bg);
    padding: 20px;
}

#json-wrapper.active {
    display: flex;
}

#jsonOutput {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.8rem;
    color: var(--text-2);
    overflow: auto;
    white-space: pre;
    line-height: 1.7;
    width: 100%;
}

/* ════════════════════════════════════
   FLOW NODES
════════════════════════════════════ */
.flow-sticky-note {
    position: absolute;
    background: rgba(255, 255, 255, 0.03);
    /* Fondo muy sutil y general */
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    padding: 24px 20px;
    color: #94a3b8;
    /* Gris azulado suave */
    font-size: 13px;
    line-height: 1.6;
    z-index: 0;
    /* Por debajo del SVG de conexiones (que es 1) y nodos (que son 2) */
    overflow: hidden;
    pointer-events: auto;
}

.flow-sticky-note strong {
    color: #e2e8f0;
    font-size: 15px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 6px;
    margin-top: -2px;
}

.flow-sticky-note .sticky-content {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: pre-wrap;
    padding-right: 8px; /* space for scrollbar */
}

/* Scrollbar for sticky note to match aesthetic */
.flow-sticky-note .sticky-content::-webkit-scrollbar {
    width: 6px;
}
.flow-sticky-note .sticky-content::-webkit-scrollbar-track {
    background: transparent;
}
.flow-sticky-note .sticky-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
.flow-sticky-note .sticky-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.flow-node {
    position: absolute;
    width: 148px;
    z-index: 2;
    /* Nodos siempre encima de SVG(1) y Sticky Notes(0) */
    --node-accent: #00e5c9;
    background: linear-gradient(145deg, rgba(12, 18, 16, 0.96), rgba(6, 12, 10, 0.96));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid color-mix(in srgb, var(--node-accent) 25%, transparent);
    border-radius: 16px;
    padding: 16px 16px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.65),
        0 0 0 1px color-mix(in srgb, var(--node-accent) 12%, transparent),
        0 0 20px color-mix(in srgb, var(--node-accent) 8%, transparent);
    transition:
        transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.28s ease,
        border-color 0.2s ease,
        background 0.25s ease;
}

/* Glowing gradient border via ::before (per-node accent) */
.flow-node::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 17px;
    padding: 1px;
    background: var(--node-border, linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.flow-node::after {
    /* Subtle shimmer line on top edge */
    content: '';
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    opacity: 0.4;
    pointer-events: none;
}

.flow-node:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--node-accent) 30%, transparent),
        0 10px 36px rgba(0, 0, 0, 0.75),
        0 0 24px color-mix(in srgb, var(--node-accent) 18%, transparent);
    border-color: color-mix(in srgb, var(--node-accent) 35%, rgba(255, 255, 255, 0.06));
    background: linear-gradient(145deg, rgba(10, 20, 18, 0.98), rgba(6, 14, 12, 0.98));
}

/* ── Type: Trigger (amber) ── */
.flow-node.trigger {
    --node-border: linear-gradient(135deg, rgba(251, 191, 36, 0.6), rgba(251, 191, 36, 0.1));
    --node-accent: #f5a623;
}

.flow-node.trigger:hover {
    box-shadow:
        0 0 0 1px rgba(251, 191, 36, 0.32),
        0 10px 36px rgba(0, 0, 0, 0.75),
        0 0 40px rgba(251, 191, 36, 0.25);
}

/* ── Type: Action (cyan) ── */
.flow-node.action {
    --node-border: linear-gradient(135deg, rgba(0, 229, 201, 0.5), rgba(0, 229, 201, 0.08));
    --node-accent: #00c896;
}

.flow-node.action:hover {
    box-shadow:
        0 0 0 1px rgba(0, 200, 150, 0.32),
        0 10px 36px rgba(0, 0, 0, 0.75),
        0 0 40px rgba(0, 200, 150, 0.25);
}

/* ── Type: AI (purple) ── */
.flow-node.ai {
    --node-border: linear-gradient(135deg, rgba(167, 139, 250, 0.6), rgba(167, 139, 250, 0.1));
    --node-accent: #7c6af7;
}

.flow-node.ai:hover {
    box-shadow:
        0 0 0 1px rgba(124, 106, 247, 0.32),
        0 10px 36px rgba(0, 0, 0, 0.75),
        0 0 40px rgba(124, 106, 247, 0.28);
}

/* ── Type: DB (green) ── */
.flow-node.db {
    --node-border: linear-gradient(135deg, rgba(52, 211, 153, 0.5), rgba(52, 211, 153, 0.08));
    --node-accent: #34d399;
}

.flow-node.db:hover {
    box-shadow:
        0 0 0 1px rgba(52, 211, 153, 0.32),
        0 10px 36px rgba(0, 0, 0, 0.75),
        0 0 40px rgba(52, 211, 153, 0.25);
}

/* ── Node Icon (gradient container) ── */
.node-icon-wrap {
    width: 54px;
    height: 54px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    border: 1px solid color-mix(in srgb, var(--node-accent) 28%, transparent);
    position: relative;
    flex-shrink: 0;
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--node-accent) 25%, transparent),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    background: linear-gradient(145deg,
            color-mix(in srgb, var(--node-accent) 35%, transparent) 0%,
            color-mix(in srgb, var(--node-accent) 12%, transparent) 50%,
            color-mix(in srgb, var(--node-accent) 5%, transparent) 100%);
}

.flow-node.trigger .node-icon-wrap {
    background: radial-gradient(circle at 40% 30%, rgba(251, 191, 36, 0.32), rgba(251, 191, 36, 0.05));
    border-color: rgba(251, 191, 36, 0.35);
}

.flow-node.action .node-icon-wrap {
    background: radial-gradient(circle at 40% 30%, rgba(0, 229, 201, 0.26), rgba(0, 229, 201, 0.03));
    border-color: rgba(0, 229, 201, 0.35);
}

.flow-node.ai .node-icon-wrap {
    background: radial-gradient(circle at 40% 30%, rgba(167, 139, 250, 0.3), rgba(167, 139, 250, 0.04));
    border-color: rgba(167, 139, 250, 0.35);
}

.flow-node.db .node-icon-wrap {
    background: radial-gradient(circle at 40% 30%, rgba(52, 211, 153, 0.26), rgba(52, 211, 153, 0.03));
    border-color: rgba(52, 211, 153, 0.35);
}

.node-label {
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    color: #e8f5f0;
    line-height: 1.3;
    max-width: 120px;
    letter-spacing: 0.03em;
    word-break: break-word;
}

.node-type-badge {
    font-family: 'DM Mono', 'SF Mono', 'Consolas', monospace;
    font-size: 0.6rem;
    color: var(--node-accent);
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
}

.node-notes {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    color: #e2e8f0;
    font-size: 0.68rem;
    text-align: center;
    width: 220px;
    pointer-events: none;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 10px;
}

/* ── Connection Ports ── */
.node-port {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #09140f;
    border: 1.5px solid color-mix(in srgb, var(--node-accent) 70%, rgba(0, 0, 0, 0.6));
    border-radius: 50%;
    transition: all 0.18s;
    box-shadow: 0 0 6px color-mix(in srgb, var(--node-accent) 45%, transparent);
    z-index: 5;
}

.node-port.right {
    left: calc(100% - 6px);
    top: 50%;
    transform: translateY(-50%);
}

.node-port.left {
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
}

.flow-node:hover .node-port.right {
    background: var(--node-accent);
    border-color: var(--node-accent);
    box-shadow: 0 0 10px color-mix(in srgb, var(--node-accent) 80%, transparent);
}

.flow-node:hover .node-port.left {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.7);
}

/* Node status indicator: green = done, yellow blinking = running */
.flow-node .node-status-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
}

.flow-node .node-status-dot.done {
    background: #00ffb4;
    box-shadow: 0 0 8px rgba(0, 255, 180, 0.8);
}

.flow-node .node-status-dot.running {
    background: #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
    animation: statusBlink 1s ease-in-out infinite;
}

@keyframes statusBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.35;
    }
}

/* SVG Edge */
#svgLayer {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: visible;
}

/* ════════════════════════════════════
   SIDEBAR — HISTORY
════════════════════════════════════ */
.sidebar-header {
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.badge-count {
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1px 7px;
    min-width: 22px;
    text-align: center;
}

#historyList {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#historyList::-webkit-scrollbar {
    width: 3px;
}

#historyList::-webkit-scrollbar-track {
    background: transparent;
}

#historyList::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: 3px;
}

.history-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px 16px;
    text-align: center;
}

.history-empty-icon {
    font-size: 1.6rem;
    opacity: 0.3;
}

.history-empty-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ─── History Card ─── */
.history-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 10px 8px;
    cursor: pointer;
    transition: all 0.18s;
    position: relative;
}

.history-card:hover {
    background: var(--surface-2);
    border-color: var(--border-hover);
    transform: translateX(2px);
}

.history-card.active-card {
    border-color: rgba(0, 229, 201, 0.3);
    background: rgba(0, 229, 201, 0.04);
}

.hc-prompt {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.45;
    margin-bottom: 7px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-right: 16px;
}

.hc-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.hc-chip {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    white-space: nowrap;
}

.hc-chip.nodes {
    background: rgba(0, 229, 201, 0.06);
    border-color: rgba(0, 229, 201, 0.15);
    color: var(--accent);
}

.hc-chip.time {
    background: var(--surface-2);
}

.hc-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-card:hover .hc-delete {
    opacity: 1;
}

.hc-delete:hover {
    color: #f87171;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 10px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.btn-clear-all {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    font-family: inherit;
    letter-spacing: -0.01em;
}

.btn-clear-all:hover {
    border-color: #f87171;
    color: #f87171;
}

/* ════════════════════════════════════
   MODALS (Settings + Error)
════════════════════════════════════ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.18s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-box {
    background: var(--surface);
    border: 1px solid var(--border-hover);
    border-radius: 20px;
    width: 90%;
    max-width: 460px;
    animation: slideUp 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
}


.modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.modal-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.modal-sub {
    font-size: 0.78rem;
    color: var(--text-2);
    margin-top: 2px;
}

.modal-close {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.modal-close:hover {
    color: var(--text);
    border-color: var(--border-hover);
}

.modal-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.field-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.field-input {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    padding: 8px 12px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.field-input:focus {
    border-color: rgba(0, 229, 201, 0.4);
    box-shadow: 0 0 0 3px rgba(0, 229, 201, 0.07);
}

.field-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.field-hint strong {
    color: var(--text-2);
}

.input-row {
    display: flex;
    gap: 6px;
}

.btn-reveal {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 11px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s;
    flex-shrink: 0;
}

.btn-reveal:hover {
    background: var(--surface-3);
}

.modal-steps {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 12px 14px;
}

.step-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-2);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.step-list {
    padding-left: 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.step-list li {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.step-list li strong {
    color: var(--text-2);
}

/* ─── Strength Bar (Auth Modal) ─── */
.strength-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    transition: background 0.3s ease, border-color 0.3s;
}

.strength-bar.weak {
    background: #f87171;
    border-color: #f87171;
}

.strength-bar.fair {
    background: #facc15;
    border-color: #facc15;
}

.strength-bar.good {
    background: #34d399;
    border-color: #34d399;
}

.strength-bar.strong {
    background: var(--accent);
    border-color: var(--accent);
}

#nameFieldsRow {
    display: flex;
    flex-direction: row;
}

#termsRow {
    display: flex;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}


/* ════════════════════════════════════
   TOAST
════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--border-hover);
    border-radius: 12px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 200;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideUp 0.25s ease;
    max-width: 440px;
    letter-spacing: -0.01em;
}

.toast.success {
    border-color: rgba(0, 229, 201, 0.35);
    color: var(--accent);
}

.toast.error {
    border-color: rgba(248, 79, 57, 0.35);
    color: #f87171;
}

.toast a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

.toast a:hover {
    text-decoration: underline;
}

/* ════════════════════════════════════
   LANDING PAGE
════════════════════════════════════ */
.landing-container {
    grid-area: 1 / 1 / 3 / 3;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow-y: auto;
    z-index: 10;
    background: transparent;
    height: 100vh;
    scroll-behavior: smooth;
    /* Transición suave */
    opacity: 1;
    transition: opacity 0.32s ease;
    pointer-events: auto;
}

.landing-container.is-hidden {
    opacity: 0;
    pointer-events: none;
}

@keyframes meshFlow {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 10% 10%;
    }
}

.hero {
    text-align: center;
    max-width: 900px;
    margin-bottom: 120px;
    position: relative;
    padding: 80px 0;
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    filter: blur(60px);
    z-index: -1;
}

.hero-brand {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #00e5c9 0%, #4f9eff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
}

.hero-brand .dot-ai {
    -webkit-text-fill-color: var(--text-muted);
    font-size: 0.8em;
}

.hero-title {
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.05em;
    margin-bottom: 32px;
    color: #fff;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.accent-text {
    background: linear-gradient(to right, #00e5c9, #4f9eff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.hero-subtitle {
    font-size: 1.35rem;
    color: var(--text-2);
    margin-bottom: 48px;
    line-height: 1.6;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 450;
    animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.hero-subtitle strong {
    color: var(--text);
    font-weight: 600;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.btn-large {
    height: 58px;
    padding: 0 44px;
    font-size: 1.15rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary.btn-large {
    box-shadow: 0 20px 40px rgba(0, 229, 201, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1200px;
    width: 100%;
    animation: fadeIn 1.2s ease-out 0.4s both;
}

.feature-card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    padding: 48px 32px;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light beam effect on top of card */
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
    opacity: 0.5;
}

.feature-card:hover {
    transform: translateY(-10px);
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

.feature-icon-wrapper {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.08), transparent);
    border: 1px solid var(--border);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* ─── Replica Sidebar (n8n Style) ─── */
.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 8px;
}

.sidebar-top {
    flex: 1;
    overflow-y: auto;
}

.sidebar-brand-n8n {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
}

.n8n-icon {
    display: flex;
    align-items: center;
    color: var(--text-2);
}

.brand-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.sidebar-header-actions {
    margin-left: auto;
    display: flex;
    gap: 2px;
}

.sidebar-header-actions .icon-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-2);
    padding: 4px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sidebar-header-actions .icon-btn:hover {
    background: var(--surface-hover);
    color: var(--accent);
    border-color: rgba(0, 229, 201, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.sidebar-header-actions .icon-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header-actions .icon-btn:hover svg {
    transform: scale(1.1);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-bottom: 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 2px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.nav-item:hover svg {
    color: var(--text);
    transform: scale(1.1);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(0, 229, 201, 0.08) 0%, transparent 100%);
    color: #fff;
    font-weight: 600;
    border-left: 2px solid var(--accent);
    border-radius: 0 6px 6px 0;
}

.nav-item svg {
    width: 17px;
    height: 17px;
    color: var(--text-muted);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item.active svg {
    color: var(--accent);
    filter: drop-shadow(0 0 4px var(--accent-glow));
    transform: scale(1.05);
}

.nav-item.collapsible {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
}

.nav-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 6px;
    width: 100%;
    cursor: pointer;
}

.nav-item-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.history-count-badge {
    margin-left: auto;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 6px;
    border-radius: 100px;
    color: var(--text-2);
}

.sub-nav {
    margin-left: 20px;
    margin-top: 2px;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    padding-left: 8px;
}

.mini-form {
    padding: 10px 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mini-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mini-field label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

.mini-field input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 6px 8px;
    color: #fff;
    font-size: 0.8rem;
    outline: none;
}

.mini-field input:focus {
    border-color: var(--accent);
}

.btn-save-mini {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-save-mini:hover {
    opacity: 0.9;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    margin-left: auto;
}

.status-dot.connected {
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
}

.sidebar-section {
    margin-top: 16px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.section-header.clickable {
    cursor: pointer;
    user-select: none;
}

.section-header.clickable:hover {
    color: var(--text-2);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.section-chevron {
    width: 12px !important;
    height: 12px !important;
    transition: transform 0.2s ease;
}

.collapsible.collapsed .section-chevron {
    transform: rotate(-90deg);
}

.collapsible.collapsed .history-items {
    display: none;
}

.add-project-icon {
    width: 12px !important;
    height: 12px !important;
    cursor: pointer;
    opacity: 0.5;
}

.add-project-icon:hover {
    opacity: 1;
}

.active-project {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.history-items {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-item-num {
    min-width: 18px;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: right;
    padding-right: 2px;
    opacity: 0.55;
    flex-shrink: 0;
}

.history-item-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.user-profile {
    margin-top: 8px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 24px;
    height: 24px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    color: #fff;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-2);
}

.user-profile .chevron {
    margin-left: auto;
    width: 12px;
    height: 12px;
    opacity: 0.4;
}

.feature-icon-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(0, 229, 201, 0.3));
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-card:hover .feature-icon-img {
    transform: scale(1.1) rotate(5deg);
}

.feature-card h3 {
    font-size: 1.6rem;
    margin-bottom: 20px;
    color: #fff;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.feature-card p {
    color: var(--text-2);
    line-height: 1.6;
    font-size: 1rem;
    font-weight: 400;
}

@media (max-width: 768px) {
    .landing-container {
        padding: 40px 20px;
    }

    .features {
        grid-template-columns: 1fr;
    }
}

/* ─── How it Works ─── */
.how-it-works {
    margin-top: 100px;
    text-align: center;
    width: 100%;
    max-width: 900px;
    padding-bottom: 60px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 50px;
    letter-spacing: -0.02em;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--surface-2);
    border: 1px solid var(--border-hover);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(0, 229, 201, 0.1);
}

.step-item h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.step-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ─── Use Cases Pills ─── */
.use-cases {
    margin-bottom: 120px;
    text-align: center;
    width: 100%;
}

.use-cases-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 24px;
    font-weight: 700;
}

.use-cases-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.use-cases-pills span {
    padding: 8px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.9rem;
    color: var(--text-2);
    transition: all 0.3s ease;
    cursor: default;
}

.use-cases-pills span:hover {
    background: var(--surface-hover);
    border-color: var(--border-light);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 229, 201, 0.1);
}

.landing-footer {
    margin-top: 120px;
    padding: 60px 24px;
    border-top: 1px solid var(--border);
    width: 100%;
    max-width: 1100px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.landing-footer p {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.landing-footer p:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .steps-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* ════════════════════════════════════
   ERROR MODAL
════════════════════════════════════ */
@keyframes errBackdropIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes errBackdropOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes errBoxIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes errBoxOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    to {
        opacity: 0;
        transform: scale(0.96) translateY(6px);
    }
}

.err-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    animation: errBackdropIn 0.2s ease;
}

.err-backdrop.closing {
    animation: errBackdropOut 0.2s ease forwards;
}

.err-box {
    background: #151918;
    border: 1px solid rgba(0, 255, 180, 0.12);
    border-radius: 14px;
    width: 400px;
    max-width: calc(100vw - 32px);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 255, 180, 0.06);
    animation: errBoxIn 0.32s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.err-backdrop.closing .err-box {
    animation: errBoxOut 0.28s ease forwards;
}

.err-topbar {
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            rgba(0, 255, 180, 0.5),
            rgba(0, 200, 255, 0.5),
            transparent);
}

.err-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 18px 16px;
}

.err-icon-wrap {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 180, 0.07);
    border: 1px solid rgba(0, 255, 180, 0.15);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1;
    margin-top: 1px;
}

.err-header-text {
    flex: 1;
    min-width: 0;
}

.err-title {
    font-size: 15px;
    font-weight: 600;
    color: #e2ede9;
    letter-spacing: -0.015em;
}

.err-sub {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 2px;
}

.err-close {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    margin-top: 1px;
}

.err-close:hover {
    background: rgba(0, 255, 180, 0.08);
    color: #00ffb4;
    border-color: rgba(0, 255, 180, 0.2);
}

.err-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 0 18px;
}

.err-body {
    padding: 16px 18px;
}

.err-message {
    border-left: 2px solid rgba(0, 255, 180, 0.35);
    background: rgba(0, 0, 0, 0.25);
    border-radius: 0 8px 8px 0;
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.6;
    color: rgba(200, 240, 225, 0.75);
    font-family: 'DM Mono', ui-monospace, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.err-message .err-keyword {
    color: #00ffb4;
    font-weight: 600;
}

.err-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 18px 16px;
}

.err-btn-cancel {
    height: 32px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.err-btn-cancel:hover {
    border-color: rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.55);
}

.err-btn-accept {
    height: 32px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    background: rgba(0, 255, 180, 0.1);
    border: 1px solid rgba(0, 255, 180, 0.25);
    color: #00ffb4;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.err-btn-accept:hover {
    background: rgba(0, 255, 180, 0.16);
    border-color: rgba(0, 255, 180, 0.4);
    box-shadow: 0 0 20px rgba(0, 255, 180, 0.12);
}

/* Botón "Ver planes" — aparece solo en errores de límite */
.err-btn-upgrade {
    height: auto;
    min-height: 32px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    background: linear-gradient(135deg, rgba(255, 180, 0, 0.15), rgba(255, 120, 0, 0.1));
    border: 1px solid rgba(255, 180, 0, 0.4);
    color: #ffc947;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: all 0.15s;
}

.err-btn-upgrade:hover {
    background: linear-gradient(135deg, rgba(255, 180, 0, 0.25), rgba(255, 120, 0, 0.18));
    border-color: rgba(255, 180, 0, 0.6);
    box-shadow: 0 0 20px rgba(255, 180, 0, 0.15);
    transform: translateY(-1px);
}

/* Google Auth button: visible en todos los modos excepto "forgot password" */
#googleAuthBtn,
#authSeparator {
    display: flex;
}

#authModal[data-mode="forgot"] #googleAuthBtn,
#authModal[data-mode="forgot"] #authSeparator,
#authModal[data-mode="invite"] #googleAuthBtn,
#authModal[data-mode="invite"] #authSeparator,
#authModal[data-mode="magic"] #googleAuthBtn,
#authModal[data-mode="magic"] #authSeparator {
    display: none;
}

/* Background grid styling for multiple pages */
.bg-dot-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='1' cy='1' r='1' fill='rgba(0%2C200%2C220%2C0.65)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    opacity: 0.22;
}

/* ─── Language Selector ─── */
.lang-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: rgba(255, 255, 255, 0.05);
    /* Slight glass effect */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    /* App style radius */
    padding: 6px 32px 6px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    /* Custom carent icon matching lucide UI style */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.lang-select:hover {
    border-color: rgba(0, 229, 201, 0.3);
    /* Slight accent color on hover */
    background-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.lang-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 229, 201, 0.2);
}

.lang-select option {
    background: var(--bg-card, #111);
    color: #fff;
    padding: 8px;
}
/* ─────────────────────────────────────────────────────────
   CAMBIOS DE CONFIANZA — Scriflow Trust Features
   ───────────────────────────────────────────────────────── */

/* CAMBIO 1: Contador de flujos */
.flujos-counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 20px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.875rem;
    color: var(--text-2);
    backdrop-filter: blur(8px);
}
.flujos-counter i { color: var(--accent); width: 16px; height: 16px; }
#flujos-count { font-weight: 700; color: var(--text); font-family: 'DM Mono', monospace; }

/* CAMBIO 2: Demo section */
.demo-section { text-align: center; padding: 64px 24px 48px; }
.demo-section h2 { font-size: 1.75rem; font-weight: 800; margin-bottom: 32px; color: #fff; letter-spacing: -0.03em; }
.demo-video-placeholder {
    position: relative;
    width: 100%;
    max-width: 720px;
    margin: 0 auto 32px;
    aspect-ratio: 16/9;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.demo-duration {
    position: absolute;
    bottom: 14px;
    right: 18px;
    font-size: 0.75rem;
    font-family: 'DM Mono', monospace;
    color: var(--text-2);
    background: rgba(0,0,0,0.55);
    padding: 3px 10px;
    border-radius: 4px;
}
.demo-bullets {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 32px;
    margin: 0;
}
.demo-bullets li { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 0.9rem; }
.demo-bullets li i { color: var(--accent); width: 18px; height: 18px; flex-shrink: 0; }

/* CAMBIO 3: Ejemplos con JSON */
.ejemplos-section { padding: 64px 24px; text-align: center; }
.ejemplos-section h2 { font-size: 1.75rem; font-weight: 800; margin-bottom: 8px; color: #fff; letter-spacing: -0.03em; }
.section-subtitle { color: var(--text-2); margin-bottom: 40px; font-size: 0.95rem; }
.ejemplos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
    text-align: left;
}
.ejemplo-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color 0.2s, transform 0.2s;
}
.ejemplo-card:hover { border-color: rgba(0,229,201,0.3); transform: translateY(-3px); }
.ejemplo-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-family: 'DM Mono', monospace;
    color: var(--accent);
    background: rgba(0,229,201,0.08);
    border: 1px solid rgba(0,229,201,0.2);
    padding: 4px 10px;
    border-radius: 999px;
    width: fit-content;
}
.ejemplo-badge i { width: 12px; height: 12px; }
.ejemplo-prompt { font-size: 0.88rem; color: var(--text-2); line-height: 1.6; font-style: italic; margin: 0; }
.ejemplo-toggle-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--accent);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-family: inherit;
    transition: all 0.2s;
    width: fit-content;
}
.ejemplo-toggle-btn:hover { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }
.ejemplo-json {
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    font-family: 'DM Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-2);
    margin: 0;
    line-height: 1.6;
    white-space: pre;
}
.ejemplo-json::-webkit-scrollbar { height: 6px; }
.ejemplo-json::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
.ejemplo-json.hidden { display: none; }
.ejemplo-json code { background: none; padding: 0; }
/* Formato JSON Syntax */
.ejemplo-json .key { color: #7dd3fc; }
.ejemplo-json .string { color: #c3e88d; }
.ejemplo-json .number { color: #f78c6c; }
.ejemplo-json .boolean, .ejemplo-json .null { color: #c792ea; }

/* CAMBIO 4: Tabla comparativa */
.comparacion-section { padding: 64px 24px; text-align: center; }
.comparacion-section h2 { font-size: 1.75rem; font-weight: 800; margin-bottom: 40px; color: #fff; letter-spacing: -0.03em; }
.comparacion-table-wrapper { overflow-x: auto; max-width: 800px; margin: 0 auto; border-radius: 12px; border: 1px solid var(--border); }
.comparacion-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.comparacion-table th, .comparacion-table td { padding: 14px 20px; text-align: center; border-bottom: 1px solid var(--border); }
.comparacion-table tbody tr:last-child td { border-bottom: none; }
.comparacion-table th:first-child, .comparacion-table td:first-child { text-align: left; color: var(--text-2); }
.comparacion-table th { font-weight: 600; color: var(--text-2); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; background: var(--surface-2); }
.col-highlight { background: rgba(0,229,201,0.05); }
.col-highlight th, th.col-highlight { color: var(--accent) !important; }
.accent-text { color: var(--accent); font-family: 'DM Mono', monospace; font-weight: 700; }
.icon-yes { color: #22c55e; width: 18px; height: 18px; }
.icon-warn { color: #f59e0b; width: 18px; height: 18px; }
.icon-no { color: var(--text-muted); opacity: 0.4; width: 18px; height: 18px; }

/* CAMBIO 5: Founder section */
.founder-section { padding: 64px 24px; }
.founder-card {
    max-width: 720px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    display: flex;
    gap: 32px;
    align-items: flex-start;
    transition: border-color 0.2s;
}
.founder-card:hover { border-color: rgba(0,229,201,0.2); }
@media (max-width: 600px) { .founder-card { flex-direction: column; align-items: center; text-align: center; } }
.founder-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--surface-2);
    border: 2px solid var(--accent);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.founder-avatar img { width: 100%; height: 100%; object-fit: cover; }
.founder-avatar-fallback { position: absolute; color: var(--text-2); }
.founder-avatar-fallback i { width: 36px; height: 36px; }
.founder-content { display: flex; flex-direction: column; gap: 12px; }
.founder-quote {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-2);
    font-style: italic;
    border-left: 3px solid var(--accent);
    padding-left: 16px;
}
.founder-meta { display: flex; flex-direction: column; gap: 2px; }
.founder-name { font-weight: 700; color: var(--text); font-size: 1rem; }
.founder-role { font-size: 0.78rem; color: var(--text-2); font-family: 'DM Mono', monospace; }
.founder-links { display: flex; gap: 12px; }
.founder-link { color: var(--text-2); transition: color 0.2s; }
.founder-link:hover { color: var(--accent); }
.founder-link i { width: 20px; height: 20px; }
.founder-cta { font-size: 0.83rem; color: var(--text-2); margin: 0; }

/* CAMBIO 6: Waitlist */
.btn-waitlist {
    width: 100%;
    padding: 13px;
    border-radius: 10px;
    background: var(--accent);
    color: #000;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s, transform 0.2s;
    margin-top: auto;
}
.btn-waitlist:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-waitlist i { width: 18px; height: 18px; }
.waitlist-form { margin-top: 16px; }
.waitlist-inner {
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 0 30px rgba(0,229,201,0.08);
}
.waitlist-header { display: flex; flex-direction: column; gap: 8px; }
.waitlist-badge { font-size: 0.82rem; font-family: 'DM Mono', monospace; color: var(--accent); }
.waitlist-header p { font-size: 0.88rem; color: var(--text-2); margin: 0; }
.waitlist-input-row { display: flex; gap: 8px; flex-wrap: wrap; }
.waitlist-input-row input {
    flex: 1;
    min-width: 180px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.waitlist-input-row input:focus { border-color: var(--accent); }
.waitlist-input-row button {
    padding: 10px 20px;
    border-radius: 8px;
    background: var(--accent);
    color: #000;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-family: inherit;
    font-size: 0.88rem;
    white-space: nowrap;
    transition: opacity 0.2s;
}
.waitlist-input-row button:hover { opacity: 0.85; }
.waitlist-disclaimer { font-size: 0.75rem; color: var(--text-muted); margin: 0; text-align: center; }

/* CAMBIO 7: Feedback widget */
.feedback-widget {
    margin-top: 20px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.feedback-widget > p { margin: 0; font-size: 0.88rem; color: var(--text-2); }
.feedback-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.feedback-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.82rem;
    font-family: inherit;
    background: var(--surface-2);
    color: var(--text-2);
    transition: all 0.2s;
}
.feedback-btn i { width: 15px; height: 15px; }
.feedback-yes:hover { border-color: #22c55e; color: #22c55e; background: rgba(34,197,94,0.06); }
.feedback-no:hover { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.06); }
.feedback-negative-form { display: flex; flex-direction: column; gap: 8px; }
.feedback-negative-form textarea {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.82rem;
    resize: vertical;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.feedback-negative-form textarea:focus { border-color: var(--accent); }
.feedback-negative-form button {
    align-self: flex-end;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--accent);
    color: #000;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    transition: opacity 0.2s;
}
.feedback-negative-form button:hover { opacity: 0.85; }
.feedback-thanks { color: var(--accent); font-weight: 600; text-align: center; padding: 6px 0; margin: 0; }

/* ════════════════════════════════════
   IMPORTAR DESDE N8N — Modal styles
════════════════════════════════════ */
.import-n8n-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    transition: border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.import-n8n-item:hover {
    border-color: rgba(249, 115, 22, 0.3);
    background: rgba(249, 115, 22, 0.04);
}

.import-n8n-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.import-n8n-name {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.import-n8n-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.import-n8n-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    width: fit-content;
    letter-spacing: 0.02em;
}

.import-n8n-badge.active {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.import-n8n-badge.inactive {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

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


/* ════════════════════════════════════
   COPILOT SIDE-DRAWER
════════════════════════════════════ */
.copilot-sidebar {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
    width: var(--copilot-w) !important;
    height: 100vh !important;
    background: var(--bg-accent);
    border-left: 1px solid var(--border);
    border-right: none !important;
    z-index: 1000;
    display: flex !important;
    flex-direction: column !important;
    transform: translateX(100%) !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: -10px 0 40px rgba(0,0,0,0.6);
}

body.copilot-active .copilot-sidebar {
    transform: translateX(0) !important;
}

body.copilot-active header {
    right: var(--copilot-w);
}

body.copilot-active main {
    right: var(--copilot-w);
}

header, main {
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1), left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Sidebar Elements */
.copilot-sidebar-header {
    height: var(--header-h);
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.bot-icon-circle {
    width: 24px; 
    height: 24px; 
    border-radius: 50%; 
    background: linear-gradient(135deg, var(--accent), #4f9eff); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: #0e0e0e;
}

.close-btn-sidebar {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.copilot-chat {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.chat-bubble.ai {
    background: rgba(0,229,201,0.06);
    border: 1px solid rgba(0,229,201,0.12);
    padding: 12px;
    border-radius: 12px;
    border-bottom-left-radius: 2px;
    color: var(--text);
    line-height: 1.6;
}

.chat-bubble.user {
    background: var(--accent);
    color: #000;
    padding: 12px;
    border-radius: 12px;
    border-bottom-right-radius: 2px;
    align-self: flex-end;
    word-break: break-word;
}

.suggestions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.copilot-sugg-btn {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 8px 14px;
    color: var(--accent);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.copilot-sugg-btn:hover {
    background: rgba(0,229,201,0.1);
    border-color: rgba(0,229,201,0.3);
    transform: scale(1.02);
}

.copilot-input-area {
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    gap: 10px;
}

.copilot-input-area textarea {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 16px;
    color: var(--text);
    font-size: 0.85rem;
    outline: none;
    resize: none;
    min-height: 40px;
    height: 40px;
    max-height: 45vh;
    overflow-y: auto;
    font-family: inherit;
    line-height: 1.4;
    word-break: break-word;
    scrollbar-width: none; /* Firefox */
}

.copilot-input-area textarea::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.send-btn-sidebar {
    background: var(--accent);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0e0e0e;
    transition: all 0.2s;
}

.send-btn-sidebar:hover {
    transform: scale(1.05);
    background: #00f0d3;
}

/* Attention Pulse for Scriflow Bot Button */
@keyframes attentionPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 229, 201, 0.4);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(0, 229, 201, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 229, 201, 0);
    }
}

.pulse-attention {
    animation: attentionPulse 2s infinite;
}

/* Copilot Magic Button */
.copilot-magic-btn {
    position: relative;
    background: linear-gradient(135deg, rgba(0, 229, 201, 0.1), rgba(79, 158, 255, 0.1));
    border: 1px solid rgba(0, 229, 201, 0.4);
    color: var(--accent);
    border-radius: 8px;
    font-weight: 600;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
}

.copilot-magic-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(0, 229, 201, 0.25), rgba(79, 158, 255, 0.25));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.copilot-magic-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 229, 201, 0.8);
    box-shadow: 0 4px 14px rgba(0, 229, 201, 0.25);
}

.copilot-magic-btn:hover::before {
    opacity: 1;
}

.copilot-magic-btn span {
    background: linear-gradient(90deg, #00e5c9, #4f9eff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0,229,201,0.3);
}
