/**
 * ════════════════════════════════════════════════════════════════
 * TUNNEL CLUB CSS v5.0 — 2026 CUTTING EDGE
 * @layer · @property · color-mix · @starting-style · :has()
 * container queries · interpolate-size · text-wrap:balance
 * light-dark() · animation-timeline (scroll/view)
 * ════════════════════════════════════════════════════════════════
 */

/* ── Layer stack ── */
@layer reset, tokens, layout, components, states, animations, responsive;

/* ══════════════════════════════════════════════════════════════
   ANIMATABLE CUSTOM PROPERTIES (@property)
══════════════════════════════════════════════════════════════ */

@property --tc-glow-opacity {
    syntax: '<number>';
    inherits: false;
    initial-value: 0;
}

@property --tc-card-lift {
    syntax: '<length>';
    inherits: false;
    initial-value: 0px;
}

@property --tc-border-alpha {
    syntax: '<number>';
    inherits: true;
    initial-value: 0.08;
}

@property --tc-shimmer-pos {
    syntax: '<percentage>';
    inherits: false;
    initial-value: -100%;
}

@property --stat-color {
    syntax: '<color>';
    inherits: true;
    initial-value: #6366f1;
}

@property --card-color {
    syntax: '<color>';
    inherits: true;
    initial-value: #6366f1;
}

/* ══════════════════════════════════════════════════════════════
   DESIGN TOKENS
══════════════════════════════════════════════════════════════ */

@layer tokens {

    :root {
        /* ── Core accent (hérite de l'app) ── */
        --tc-h: 238;                          /* teinte HSL de l'accent */
        --tc-accent:      var(--accent, hsl(238 84% 67%));
        --tc-accent-2:    var(--accent-light, hsl(265 83% 68%));
        --tc-accent-3:    hsl(316 73% 65%);   /* rose pour 3-stop gradient */

        /* ── Gradients ── */
        --tc-grad-primary: linear-gradient(135deg, var(--tc-accent), var(--tc-accent-2));
        --tc-grad-vivid:   linear-gradient(135deg, var(--tc-accent), var(--tc-accent-2), var(--tc-accent-3));
        --tc-grad-glow:    radial-gradient(ellipse 80% 80% at 50% -20%,
                               color-mix(in oklch, var(--tc-accent) 22%, transparent),
                               transparent 70%);

        /* ── Semantic surfaces — dark mode fixe ── */
        --tc-bg:         #0a0a0f;
        --tc-bg-2:       #111118;
        --tc-surface:    #16161f;
        --tc-surface-2:  #1c1c27;
        --tc-border:     rgba(255,255,255,.07);
        --tc-border-2:   rgba(255,255,255,.04);
        --tc-text:       #f2f2fc;
        --tc-text-2:     #8484a8;
        --tc-text-3:     #5a5a78;

        /* ── Status colours ── */
        --tc-ok:   #10b981;
        --tc-warn: #f59e0b;
        --tc-err:  #ef4444;

        /* ── Spacing / Radius scale ── */
        --tc-r-xs:  6px;
        --tc-r-sm:  10px;
        --tc-r-md:  14px;
        --tc-r-lg:  20px;
        --tc-r-xl:  28px;
        --tc-r-full: 9999px;

        /* ── Elevation ── */
        --tc-shadow-1: 0 1px 2px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.04);
        --tc-shadow-2: 0 4px 16px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.06);
        --tc-shadow-3: 0 12px 40px rgba(0,0,0,.22), 0 4px 12px rgba(0,0,0,.1);
        --tc-shadow-4: 0 24px 64px rgba(0,0,0,.36), 0 8px 24px rgba(0,0,0,.16);
        --tc-shadow-glow: 0 0 0 1px color-mix(in oklch, var(--tc-accent) 35%, transparent),
                          0 8px 32px color-mix(in oklch, var(--tc-accent) 25%, transparent);

        /* ── Motion ── */
        --tc-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
        --tc-ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
        --tc-ease-out:    cubic-bezier(0, 0, 0.2, 1);
        --tc-dur-fast:   150ms;
        --tc-dur-base:   220ms;
        --tc-dur-slow:   380ms;
        --tc-dur-xslow:  600ms;

        /* ── Typography ── */
        --tc-font-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
        --tc-font-body:    'Inter', system-ui, sans-serif;
        --tc-font-mono:    'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    }
}

/* ══════════════════════════════════════════════════════════════
   RESET
══════════════════════════════════════════════════════════════ */

@layer reset {
    .tc-wrapper, .tc-wrapper * {
        box-sizing: border-box;
    }
}

/* ══════════════════════════════════════════════════════════════
   LAYOUT — Vue + Wrapper
══════════════════════════════════════════════════════════════ */

@layer layout {

    color-scheme: dark;

    #view-tunnel-club {
        flex-direction: column;
        height: 100%;
        overflow-y: auto;
        color-scheme: dark;
        background:
            var(--tc-grad-glow),
            radial-gradient(ellipse 55% 45% at 85% 95%,
                color-mix(in oklch, var(--tc-accent-2) 6%, transparent),
                transparent 70%),
            var(--bg-primary, var(--tc-bg));
        /* scroll-timeline pour future utilisation */
        scroll-timeline: --tc-scroll-view block;
    }

    #view-tunnel-club.active { display: flex; }

    .tc-wrapper {
        max-width: 1440px;
        margin: 0 auto;
        padding: 32px 28px;
        width: 100%;
        position: relative;
        z-index: 1;
        color-scheme: dark;
        container-type: inline-size;
        container-name: tc-main;
    }
}

/* ══════════════════════════════════════════════════════════════
   COMPONENTS
══════════════════════════════════════════════════════════════ */

@layer components {

/* ── HEADER ────────────────────────────────────────────────── */

.tc-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--tc-border);
    flex-wrap: wrap;
    gap: 20px;
    /* Glassmorphism underline */
    background:
        linear-gradient(to bottom, transparent 95%, color-mix(in oklch, var(--tc-accent) 12%, transparent)) bottom / 100% 1px no-repeat;
    border-bottom: none;
    padding-bottom: 33px;
}

.tc-header-left { display: flex; flex-direction: column; gap: 0; }

.tc-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--tc-r-full);
    background: color-mix(in oklch, var(--tc-accent) 14%, transparent);
    border: 1px solid color-mix(in oklch, var(--tc-accent) 30%, transparent);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: color-mix(in oklch, var(--tc-accent) 80%, white);
    margin-bottom: 10px;
    width: fit-content;
    /* Shimmer animé */
    position: relative;
    overflow: hidden;
}

.tc-header-badge::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg,
        transparent 40%,
        color-mix(in oklch, white 20%, transparent) 50%,
        transparent 60%);
    --tc-shimmer-pos: -100%;
    transform: translateX(var(--tc-shimmer-pos));
    animation: tc-badge-shimmer 3s var(--tc-ease-smooth) infinite 1s;
}

@keyframes tc-badge-shimmer {
    0%, 30% { --tc-shimmer-pos: -100%; }
    60%, 100% { --tc-shimmer-pos: 200%; }
}

.tc-header-title {
    font-family: var(--tc-font-display);
    font-size: clamp(22px, 3cqi, 32px);
    font-weight: 900;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg,
        var(--tc-text) 0%,
        color-mix(in oklch, var(--tc-text) 70%, var(--tc-accent)) 60%,
        color-mix(in oklch, var(--tc-accent) 80%, white) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 6px;
    line-height: 1.1;
    display: flex;
    align-items: center;
    gap: 10px;
    text-wrap: balance;
}

.tc-header-logo {
    display: inline-block;
    -webkit-text-fill-color: initial;
    filter: drop-shadow(0 0 8px color-mix(in oklch, var(--tc-accent) 70%, transparent));
    animation: tc-logo-float 3s ease-in-out infinite;
}

@keyframes tc-logo-float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        filter: drop-shadow(0 0 6px color-mix(in oklch, var(--tc-accent) 55%, transparent));
    }
    50% {
        transform: translateY(-3px) rotate(5deg);
        filter: drop-shadow(0 4px 16px color-mix(in oklch, var(--tc-accent) 90%, transparent));
    }
}

.tc-header-sub {
    color: var(--tc-text-2);
    font-size: 14px;
    margin: 0;
    text-wrap: balance;
}

.tc-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ── BUTTONS ───────────────────────────────────────────────── */

.tc-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--tc-r-sm);
    font-family: var(--tc-font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    transition:
        transform var(--tc-dur-base) var(--tc-ease-spring),
        box-shadow var(--tc-dur-base) var(--tc-ease-smooth),
        background var(--tc-dur-base) var(--tc-ease-smooth),
        color var(--tc-dur-base) var(--tc-ease-smooth),
        border-color var(--tc-dur-base) var(--tc-ease-smooth);
    /* @starting-style pour l'apparition initiale */
    @starting-style {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Ripple effect universel */
.tc-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--tc-ripple-x, 50%) var(--tc-ripple-y, 50%),
        rgba(255,255,255,0.18) 0%,
        transparent 65%);
    opacity: 0;
    transition: opacity var(--tc-dur-fast);
}

.tc-btn:hover::before { opacity: 1; }
.tc-btn:active { transform: scale(0.975) !important; }

/* Primary */
.tc-btn-primary {
    background: var(--tc-grad-primary);
    color: #fff;
    box-shadow:
        0 4px 14px color-mix(in oklch, var(--tc-accent) 40%, transparent),
        inset 0 1px 0 rgba(255,255,255,0.18);
}

.tc-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px color-mix(in oklch, var(--tc-accent) 52%, transparent),
        inset 0 1px 0 rgba(255,255,255,0.22);
}

/* Secondary */
.tc-btn-secondary {
    background: var(--tc-surface-2);
    color: var(--tc-text);
    border: 1px solid var(--tc-border);
    box-shadow: var(--tc-shadow-1);
}

.tc-btn-secondary:hover {
    transform: translateY(-1px);
    border-color: color-mix(in oklch, var(--tc-accent) 50%, var(--tc-border));
    box-shadow: var(--tc-shadow-2);
}

/* Ghost */
.tc-btn-ghost {
    background: transparent;
    color: var(--tc-text-2);
    border: 1px solid var(--tc-border);
}

.tc-btn-ghost:hover {
    color: var(--tc-text);
    border-color: color-mix(in oklch, var(--tc-accent) 45%, transparent);
    background: color-mix(in oklch, var(--tc-accent) 7%, transparent);
}

/* Danger */
.tc-btn-danger {
    background: color-mix(in oklch, var(--tc-err) 12%, transparent);
    color: var(--tc-err);
    border: 1px solid color-mix(in oklch, var(--tc-err) 22%, transparent);
}

.tc-btn-danger:hover {
    background: color-mix(in oklch, var(--tc-err) 22%, transparent);
    box-shadow: 0 4px 14px color-mix(in oklch, var(--tc-err) 28%, transparent);
}

/* Tailles */
.tc-btn-sm  { padding: 6px 14px; font-size: 12px; }
.tc-btn-xs  { padding: 4px 10px; font-size: 11px; border-radius: var(--tc-r-xs); }
.tc-btn-icon-only { padding: 6px 10px; }

/* Glow button — Créer */
.tc-btn-glow {
    background: var(--tc-grad-vivid);
    color: #fff;
    box-shadow:
        0 4px 16px color-mix(in oklch, var(--tc-accent) 42%, transparent),
        0 0 0 1px color-mix(in oklch, var(--tc-accent) 20%, transparent);
    transition:
        transform var(--tc-dur-base) var(--tc-ease-spring),
        box-shadow var(--tc-dur-base) var(--tc-ease-smooth),
        filter var(--tc-dur-base) var(--tc-ease-smooth);
}

.tc-btn-glow:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 10px 32px color-mix(in oklch, var(--tc-accent) 55%, transparent),
        0 0 0 1px color-mix(in oklch, var(--tc-accent) 35%, transparent),
        0 0 60px color-mix(in oklch, var(--tc-accent-3) 20%, transparent);
    filter: brightness(1.08);
}

.tc-btn-icon-sparkle {
    display: inline-block;
    animation: tc-sparkle 2s ease-in-out infinite;
}

@keyframes tc-sparkle {
    0%, 100% { transform: rotate(0deg) scale(1); opacity: 1; }
    30% { transform: rotate(12deg) scale(1.18); opacity: 0.9; }
    60% { transform: rotate(-8deg) scale(1.1); opacity: 1; }
}

/* Express button */
.tc-btn-express {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 15px;
    border-radius: var(--tc-r-sm);
    border: 1px solid color-mix(in oklch, var(--tc-warn) 35%, transparent);
    background: color-mix(in oklch, var(--tc-warn) 9%, transparent);
    color: color-mix(in oklch, var(--tc-warn) 90%, white);
    font-family: var(--tc-font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition:
        background var(--tc-dur-base) var(--tc-ease-smooth),
        border-color var(--tc-dur-base),
        box-shadow var(--tc-dur-base) var(--tc-ease-smooth),
        transform var(--tc-dur-base) var(--tc-ease-spring);
}

.tc-btn-express:hover {
    background: color-mix(in oklch, var(--tc-warn) 17%, transparent);
    border-color: color-mix(in oklch, var(--tc-warn) 55%, transparent);
    box-shadow: 0 4px 20px color-mix(in oklch, var(--tc-warn) 28%, transparent);
    transform: translateY(-1px);
}

/* ── STATS GRID ────────────────────────────────────────────── */

.tc-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 44px;
    container-type: inline-size;
}

.tc-stat-card {
    position: relative;
    background: linear-gradient(145deg,
        color-mix(in oklch, var(--stat-color) 6%, #16161f) 0%,
        #16161f 60%,
        color-mix(in oklch, var(--stat-color) 3%, #12121a) 100%);
    border: 1px solid color-mix(in oklch, var(--stat-color) 16%, rgba(255,255,255,.05));
    border-radius: 16px;
    padding: 20px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    isolation: isolate;
    --tc-glow-opacity: 0;
    --tc-card-lift: 0px;
    transition:
        --tc-glow-opacity var(--tc-dur-slow) var(--tc-ease-smooth),
        --tc-card-lift var(--tc-dur-base) var(--tc-ease-spring),
        border-color var(--tc-dur-base) var(--tc-ease-smooth),
        box-shadow var(--tc-dur-base) var(--tc-ease-smooth);
    transform: translateY(calc(-1 * var(--tc-card-lift)));
    @starting-style {
        opacity: 0;
        transform: translateY(14px);
    }
}

/* Left accent bar */
.tc-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom,
        color-mix(in oklch, var(--stat-color) 90%, white),
        color-mix(in oklch, var(--stat-color) 45%, transparent));
    border-radius: 0 0 0 0;
    opacity: 0.7;
}

/* Ambient radial glow corner */
.tc-stat-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 85% 75% at 95% 105%,
        color-mix(in oklch, var(--stat-color) 14%, transparent),
        transparent 65%
    );
    opacity: var(--tc-glow-opacity);
    pointer-events: none;
    transition: opacity var(--tc-dur-slow) var(--tc-ease-smooth);
}

/* Top shimmer line */
.tc-stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 3px; right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        color-mix(in oklch, var(--stat-color) 55%, transparent),
        transparent 70%);
    opacity: 0.4;
}

.tc-stat-card:hover {
    --tc-glow-opacity: 1;
    --tc-card-lift: 4px;
    border-color: color-mix(in oklch, var(--stat-color) 42%, rgba(255,255,255,.05));
    box-shadow:
        0 12px 36px rgba(0,0,0,.32),
        0 4px 12px rgba(0,0,0,.18),
        0 0 0 1px color-mix(in oklch, var(--stat-color) 18%, transparent),
        0 0 32px color-mix(in oklch, var(--stat-color) 10%, transparent);
}

/* Top row: icon + trend */
.tc-stat-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.tc-stat-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: color-mix(in oklch, var(--stat-color) 14%, rgba(255,255,255,.03));
    border: 1px solid color-mix(in oklch, var(--stat-color) 28%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--stat-color);
    transition: transform var(--tc-dur-base) var(--tc-ease-spring),
                box-shadow var(--tc-dur-base);
}

.tc-stat-card:hover .tc-stat-icon-wrap {
    transform: scale(1.08) rotate(-5deg);
    box-shadow: 0 4px 14px color-mix(in oklch, var(--stat-color) 38%, transparent);
}

/* Trend badge */
.tc-stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 7px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: color-mix(in oklch, var(--stat-color) 12%, transparent);
    color: color-mix(in oklch, var(--stat-color) 90%, white);
    border: 1px solid color-mix(in oklch, var(--stat-color) 22%, transparent);
}

.tc-stat-content { position: relative; z-index: 1; }

.tc-stat-value {
    font-family: var(--tc-font-display);
    font-size: 30px;
    font-weight: 900;
    color: var(--tc-text);
    line-height: 1;
    margin-bottom: 4px;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.tc-stat-label {
    font-size: 12px;
    color: var(--tc-text-2);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

/* Progress bar under value */
.tc-stat-bar {
    height: 3px;
    background: rgba(255,255,255,.06);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}
.tc-stat-bar-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg,
        var(--stat-color),
        color-mix(in oklch, var(--stat-color) 60%, white));
    transition: width 0.8s var(--tc-ease-out);
}

.tc-stat-sub {
    font-size: 10px;
    color: color-mix(in oklch, var(--stat-color) 75%, var(--tc-text-2));
    margin-top: 6px;
    font-weight: 700;
    letter-spacing: 0.01em;
    position: relative;
    z-index: 1;
}

/* ── SECTION HEADER ─────────────────────────────────────────── */

.tc-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.tc-section-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tc-section-title {
    font-family: var(--tc-font-display);
    font-size: 18px;
    font-weight: 800;
    color: var(--tc-text);
    margin: 0;
    letter-spacing: -0.02em;
}

.tc-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border-radius: var(--tc-r-full);
    background: color-mix(in oklch, var(--tc-accent) 14%, transparent);
    color: color-mix(in oklch, var(--tc-accent) 85%, white);
    font-size: 12px;
    font-weight: 800;
    border: 1px solid color-mix(in oklch, var(--tc-accent) 22%, transparent);
    font-variant-numeric: tabular-nums;
}

.tc-section-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ── SEARCH ────────────────────────────────────────────────── */

.tc-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.tc-search-icon {
    position: absolute;
    left: 10px;
    font-size: 13px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
}

.tc-search-input {
    width: 220px;
    background: var(--tc-surface);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-r-sm);
    padding: 7px 12px 7px 32px;
    font-family: var(--tc-font-body);
    font-size: 13px;
    color: var(--tc-text);
    transition:
        border-color var(--tc-dur-base),
        box-shadow var(--tc-dur-base),
        width var(--tc-dur-slow) var(--tc-ease-smooth);
    outline: none;
}

.tc-search-input::placeholder { color: var(--tc-text-3); }

.tc-search-input:focus {
    width: 280px;
    border-color: color-mix(in oklch, var(--tc-accent) 55%, transparent);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--tc-accent) 12%, transparent);
}

/* ── FILTERS ───────────────────────────────────────────────── */

.tc-filters {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tc-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 15px;
    border-radius: var(--tc-r-full);
    font-family: var(--tc-font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--tc-border);
    background: transparent;
    color: var(--tc-text-2);
    transition:
        background var(--tc-dur-base) var(--tc-ease-smooth),
        color var(--tc-dur-base),
        border-color var(--tc-dur-base),
        box-shadow var(--tc-dur-base),
        transform var(--tc-dur-base) var(--tc-ease-spring);
}

.tc-filter-btn.active,
.tc-filter-btn:hover {
    background: var(--tc-grad-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 3px 12px color-mix(in oklch, var(--tc-accent) 38%, transparent);
    transform: translateY(-1px);
}

.tc-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--tc-r-full);
    background: rgba(255,255,255,0.22);
    font-size: 11px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.tc-filter-btn:not(.active) .tc-filter-count {
    background: rgba(255,255,255,0.07);
    color: #5a5a78;
}

/* ── TUNNELS GRID ──────────────────────────────────────────── */

.tc-tunnels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
    /* View transitions sur les cartes */
    view-transition-name: tc-grid;
}

/* ══════════════════════════════════════════════════════════════
   CARTE CRÉER — GALAXIE PREMIUM v2
══════════════════════════════════════════════════════════════ */

.tc-tunnel-card-create {
    position: relative;
    background: radial-gradient(ellipse 120% 90% at 50% 60%,
        #0f0d28 0%,
        #0a0815 40%,
        #06040f 100%);
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: var(--tc-r-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    min-height: 360px;
    cursor: pointer;
    overflow: hidden;
    text-align: center;
    padding: 0 24px 28px;
    isolation: isolate;
    transition: border-color 0.5s ease, transform 0.35s var(--tc-ease-spring), box-shadow 0.5s ease;
}

.tc-tunnel-card-create:hover {
    border-color: rgba(139,92,246,0.65);
    transform: translateY(-5px);
    box-shadow:
        0 0 80px rgba(99,102,241,0.22),
        0 0 40px rgba(139,92,246,0.15),
        0 24px 72px rgba(0,0,0,0.6),
        inset 0 0 80px rgba(99,102,241,0.04);
}

/* Fond étoilé statique (texture de fond) */
.tc-tunnel-card-create::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 15% 20%, rgba(255,255,255,0.55) 0%, transparent 100%),
        radial-gradient(1px 1px at 72% 8%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 88% 35%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 34% 65%, rgba(255,255,255,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 78%, rgba(255,255,255,0.35) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 8% 85%, rgba(255,255,255,0.45) 0%, transparent 100%),
        radial-gradient(1px 1px at 45% 12%, rgba(255,255,255,0.35) 0%, transparent 100%),
        radial-gradient(1px 1px at 92% 70%, rgba(255,255,255,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 25% 42%, rgba(255,255,255,0.25) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 78% 55%, rgba(255,255,255,0.4) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* Nébuleuse basse */
.tc-tunnel-card-create::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 65%;
    background: linear-gradient(to top,
        rgba(99,102,241,0.07) 0%,
        rgba(139,92,246,0.04) 40%,
        transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* Orbes de fond atmosphériques */
.tc-create-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}
.tc-create-orb-1 {
    width: 280px; height: 280px;
    top: -100px; left: -80px;
    background: radial-gradient(circle, rgba(99,102,241,0.32) 0%, transparent 65%);
    filter: blur(50px);
    animation: tc-orb-drift 10s ease-in-out infinite;
}
.tc-create-orb-2 {
    width: 240px; height: 240px;
    bottom: -60px; right: -60px;
    background: radial-gradient(circle, rgba(236,72,153,0.28) 0%, transparent 65%);
    filter: blur(50px);
    animation: tc-orb-drift 12s ease-in-out infinite reverse;
    animation-delay: -4s;
}
.tc-create-orb-3 {
    width: 180px; height: 180px;
    top: 30%; left: 50%;
    background: radial-gradient(circle, rgba(167,139,250,0.2) 0%, transparent 60%);
    filter: blur(35px);
    animation: tc-orb-center 7s ease-in-out infinite;
}

@keyframes tc-orb-drift {
    0%,100% { transform: translate(0,0) scale(1); }
    33%  { transform: translate(18px,-12px) scale(1.1); }
    66%  { transform: translate(-12px,16px) scale(0.92); }
}
@keyframes tc-orb-center {
    0%,100% { transform: translate(-50%,-50%) scale(1); opacity:0.7; }
    50%  { transform: translate(-50%,-50%) scale(1.7); opacity:0.25; }
}

/* Étoiles orbitales */
.tc-create-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}
.tc-star {
    position: absolute;
    top: 50%; left: 50%;
    border-radius: 50%;
    background: #fff;
    width: var(--sz, 2px);
    height: var(--sz, 2px);
    transform: rotate(var(--d)) translateX(var(--dist)) translateY(-50%);
    animation: tc-star-twinkle 2.8s ease-in-out infinite;
    animation-delay: var(--del, 0s);
}
/* Étoiles colorées pour la variété */
.tc-star-0 { background: #a5b4fc; }
.tc-star-1 { background: #f9a8d4; }
.tc-star-2 { background: #ffffff; }
.tc-star-3 { background: #c4b5fd; }
.tc-star-4 { background: #fbcfe8; }
.tc-star-5 { background: #e0e7ff; }

@keyframes tc-star-twinkle {
    0%,100% { opacity: 0.2; transform: rotate(var(--d)) translateX(var(--dist)) scale(0.7); }
    50% { opacity: 1; transform: rotate(var(--d)) translateX(var(--dist)) scale(1.6); }
}

/* Lignes de constellation (SVG dans le JS) */
.tc-constellation-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0.12;
}

/* Noyau central — LA PIÈCE MAÎTRESSE */
.tc-create-core {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 68%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    flex-shrink: 0;
}

/* Halo atmosphérique externe */
.tc-create-halo {
    position: absolute;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(99,102,241,0.15) 0%,
        rgba(139,92,246,0.08) 40%,
        transparent 70%);
    animation: tc-halo-breathe 4s ease-in-out infinite;
}
@keyframes tc-halo-breathe {
    0%,100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.35); opacity: 1; }
}

.tc-create-ring {
    position: absolute;
    border-radius: 50%;
    animation: tc-ring-rotate 12s linear infinite;
}
/* Anneau extérieur — gradient + tirets */
.tc-ring-outer {
    width: 120px; height: 120px;
    border: 1.5px solid transparent;
    background: linear-gradient(#0a0815, #0a0815) padding-box,
                linear-gradient(135deg,
                    rgba(139,92,246,0.7),
                    rgba(99,102,241,0.2) 40%,
                    rgba(236,72,153,0.6) 70%,
                    rgba(139,92,246,0.7)) border-box;
    animation-duration: 16s;
    animation-direction: normal;
}
.tc-ring-mid {
    width: 88px; height: 88px;
    border: 1px solid transparent;
    background: linear-gradient(#0a0815, #0a0815) padding-box,
                linear-gradient(225deg,
                    rgba(236,72,153,0.55),
                    rgba(139,92,246,0.2) 40%,
                    rgba(99,102,241,0.5)) border-box;
    animation-direction: reverse;
    animation-duration: 10s;
}
/* 3ème anneau — petit, rapide */
.tc-ring-inner {
    width: 60px; height: 60px;
    border: 1px dashed rgba(167,139,250,0.3);
    animation-duration: 6s;
    animation-direction: normal;
}

@keyframes tc-ring-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Points sur les anneaux */
.tc-ring-dot {
    position: absolute;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: rgba(167,139,250,0.9);
    box-shadow: 0 0 8px rgba(167,139,250,0.8);
    animation: tc-ring-rotate 16s linear infinite;
}
.tc-ring-dot:nth-child(2) {
    background: rgba(236,72,153,0.9);
    box-shadow: 0 0 8px rgba(236,72,153,0.8);
    animation-duration: 10s;
    animation-direction: reverse;
}

.tc-create-nucleus {
    position: relative;
    z-index: 1;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%,
        rgba(200,180,255,0.55) 0%,
        rgba(139,92,246,0.35) 35%,
        rgba(99,102,241,0.18) 70%,
        transparent 100%);
    border: 1.5px solid rgba(167,139,250,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 0 6px rgba(99,102,241,0.07),
        0 0 24px rgba(139,92,246,0.55),
        0 0 60px rgba(99,102,241,0.25),
        inset 0 0 18px rgba(167,139,250,0.2);
    animation: tc-nucleus-pulse 3.5s ease-in-out infinite;
}
@keyframes tc-nucleus-pulse {
    0%,100% {
        box-shadow:
            0 0 0 6px rgba(99,102,241,0.07),
            0 0 24px rgba(139,92,246,0.55),
            0 0 60px rgba(99,102,241,0.25),
            inset 0 0 18px rgba(167,139,250,0.2);
    }
    50% {
        box-shadow:
            0 0 0 12px rgba(99,102,241,0.05),
            0 0 45px rgba(139,92,246,0.85),
            0 0 100px rgba(99,102,241,0.4),
            0 0 140px rgba(139,92,246,0.15),
            inset 0 0 30px rgba(167,139,250,0.35);
    }
}

.tc-tunnel-card-create:hover .tc-create-nucleus {
    box-shadow:
        0 0 0 16px rgba(99,102,241,0.06),
        0 0 55px rgba(139,92,246,1),
        0 0 120px rgba(99,102,241,0.5),
        0 0 180px rgba(236,72,153,0.2),
        inset 0 0 35px rgba(167,139,250,0.4);
    border-color: rgba(200,180,255,0.85);
}

/* Texte + CTA en bas */
.tc-create-text {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-bottom: 18px;
}

.tc-create-title {
    font-family: var(--tc-font-display);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #f2f2fc 0%, #c4b5fd 50%, #f9a8d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tc-create-sub {
    font-size: 11.5px;
    color: rgba(167,139,250,0.6);
    font-weight: 500;
}

/* CTA principal — pill gradient avec shimmer */
.tc-create-cta-main {
    position: relative;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 999px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    background-size: 200% 200%;
    border: none;
    color: #fff;
    font-family: var(--tc-font-body);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: transform 0.25s var(--tc-ease-spring), box-shadow 0.25s ease;
    box-shadow:
        0 4px 24px rgba(99,102,241,0.5),
        0 0 0 1px rgba(255,255,255,0.12) inset;
    animation: tc-gradient-shift 3.5s ease-in-out infinite;
    margin-bottom: 12px;
    overflow: hidden;
}
.tc-create-cta-main::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg,
        transparent 35%,
        rgba(255,255,255,0.2) 50%,
        transparent 65%);
    transform: translateX(-100%);
    animation: tc-cta-shimmer 3s ease infinite 1.5s;
}
@keyframes tc-cta-shimmer {
    0%   { transform: translateX(-100%); }
    60%,100% { transform: translateX(200%); }
}
@keyframes tc-gradient-shift {
    0%,100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.tc-create-cta-main:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow:
        0 10px 36px rgba(99,102,241,0.65),
        0 0 60px rgba(139,92,246,0.25),
        0 0 0 1px rgba(255,255,255,0.2) inset;
}

.tc-create-or {
    position: relative;
    z-index: 4;
    font-size: 10px;
    color: rgba(255,255,255,0.18);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 68%;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.tc-create-or::before,
.tc-create-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139,92,246,0.25), transparent);
}

.tc-create-express-btn {
    position: relative;
    z-index: 4;
    background: rgba(139,92,246,0.06);
    border: 1px solid rgba(139,92,246,0.2);
    border-radius: 999px;
    color: rgba(167,139,250,0.65);
    font-size: 11.5px;
    font-family: var(--tc-font-body);
    font-weight: 600;
    padding: 8px 20px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--tc-ease-spring);
    letter-spacing: 0.02em;
}
.tc-create-express-btn:hover {
    background: rgba(139,92,246,0.15);
    color: rgba(200,180,255,0.9);
    border-color: rgba(139,92,246,0.45);
    transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════════
   CARTE TUNNEL — ULTRA PREMIUM v2
══════════════════════════════════════════════════════════════ */

.tc-tunnel-card {
    background: linear-gradient(160deg,
        color-mix(in oklch, var(--card-color) 5%, #14131e) 0%,
        #111019 50%,
        #0e0d17 100%);
    border: 1px solid color-mix(in oklch, var(--card-color) 18%, rgba(255,255,255,0.05));
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    isolation: isolate;
    transition:
        border-color 0.3s ease,
        transform 0.3s var(--tc-ease-spring),
        box-shadow 0.3s ease;
    --tc-glow-opacity: 0;
}

.tc-tunnel-card:hover {
    border-color: color-mix(in oklch, var(--card-color) 55%, rgba(255,255,255,0.08));
    transform: translateY(-6px) scale(1.01);
    box-shadow:
        0 20px 56px rgba(0,0,0,0.55),
        0 8px 24px rgba(0,0,0,0.3),
        0 0 0 1px color-mix(in oklch, var(--card-color) 22%, transparent),
        0 0 40px color-mix(in oklch, var(--card-color) 10%, transparent);
}

/* Ambient corner glow that appears on hover */
.tc-tunnel-card::before {
    content: '';
    position: absolute;
    bottom: -20px; right: -20px;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle,
        color-mix(in oklch, var(--card-color) 20%, transparent),
        transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.tc-tunnel-card:hover::before { opacity: 1; }

/* Bottom glow bar */
.tc-tunnel-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        color-mix(in oklch, var(--card-color) 70%, transparent) 40%,
        color-mix(in oklch, var(--card-color) 70%, white) 50%,
        color-mix(in oklch, var(--card-color) 70%, transparent) 60%,
        transparent 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
}
.tc-tunnel-card:hover::after { opacity: 0.9; }

/* ── Thumbnail ── */

.tc-tunnel-thumb {
    height: 160px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.tc-thumb-bg {
    position: absolute;
    inset: 0;
    transition: transform 0.5s ease;
}
.tc-tunnel-card:hover .tc-thumb-bg { transform: scale(1.06); }

/* Pattern texture overlay — unique à chaque couleur */
.tc-thumb-pattern {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.55;
    transition: opacity 0.3s ease;
}
.tc-tunnel-card:hover .tc-thumb-pattern { opacity: 0.4; }

/* Grille perspective fine */
.tc-thumb-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(160deg,
        transparent 0%, rgba(0,0,0,0.5) 30%,
        black 60%, transparent 100%);
    z-index: 2;
}

/* Vignette en bas du thumb */
.tc-thumb-vignette {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 70%;
    background: linear-gradient(to top,
        rgba(10,9,20,0.8) 0%,
        rgba(10,9,20,0.3) 50%,
        transparent 100%);
    z-index: 3;
    pointer-events: none;
}

.tc-thumb-icon {
    position: absolute;
    top: 42%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    filter:
        drop-shadow(0 4px 16px rgba(0,0,0,0.6))
        drop-shadow(0 0 24px color-mix(in oklch, var(--card-color) 50%, transparent));
    z-index: 4;
    transition:
        transform 0.4s cubic-bezier(.34,1.56,.64,1),
        filter 0.4s ease;
    line-height: 1;
}
.tc-tunnel-card:hover .tc-thumb-icon {
    transform: translate(-50%, -58%) scale(1.15) rotate(-6deg);
    filter:
        drop-shadow(0 8px 24px rgba(0,0,0,0.75))
        drop-shadow(0 0 40px color-mix(in oklch, var(--card-color) 75%, transparent));
}

/* Pips pages */
.tc-thumb-pips {
    position: absolute;
    bottom: 10px; left: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 5;
}
.tc-pip {
    width: 5px; height: 5px;
    border-radius: 99px;
    background: rgba(255,255,255,0.28);
    transition: width 0.2s ease, background 0.2s ease;
}
.tc-pip-active {
    width: 16px;
    background: rgba(255,255,255,0.9);
    box-shadow: 0 0 8px rgba(255,255,255,0.4);
}
.tc-pip-label {
    font-size: 9px;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.05em;
    margin-left: 4px;
    font-family: var(--tc-font-mono);
}

/* Status pill */
.tc-status-pill {
    position: absolute;
    top: 11px; right: 11px;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 88px;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    background: rgba(0,0,0,0.65);
    border: 1px solid color-mix(in oklch, var(--sc) 40%, transparent);
    color: var(--sc);
    backdrop-filter: blur(10px);
    z-index: 5;
    white-space: nowrap;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.tc-status-dot {
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--sc);
    box-shadow: 0 0 5px var(--sc);
    flex-shrink: 0;
    animation: tc-status-blink 2s ease-in-out infinite;
}
.tc-status-pill.tc-status-published .tc-status-dot {
    animation-play-state: running;
}
.tc-status-pill.tc-status-draft .tc-status-dot,
.tc-status-pill.tc-status-paused .tc-status-dot {
    animation-play-state: paused;
}
@keyframes tc-status-blink {
    0%,100% { opacity: 1; box-shadow: 0 0 4px var(--sc); }
    50% { opacity: 0.5; box-shadow: 0 0 10px var(--sc); }
}

/* Overlay hover */
.tc-thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.22s ease;
    z-index: 6;
}
.tc-tunnel-card:hover .tc-thumb-overlay { opacity: 1; }

.tc-ov-btn {
    padding: 9px 18px;
    border-radius: var(--tc-r-sm);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.22);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--tc-font-body);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s var(--tc-ease-spring), box-shadow 0.15s;
    backdrop-filter: blur(4px);
}
.tc-ov-btn:hover {
    background: rgba(255,255,255,0.22);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}
.tc-ov-ai {
    background: color-mix(in oklch, var(--card-color) 25%, rgba(0,0,0,0.2));
    border-color: color-mix(in oklch, var(--card-color) 55%, transparent);
}
.tc-ov-ai:hover {
    background: color-mix(in oklch, var(--card-color) 42%, rgba(0,0,0,0.1));
    box-shadow: 0 6px 20px color-mix(in oklch, var(--card-color) 35%, transparent);
}

/* ── Card body ── */

.tc-card-body {
    padding: 15px 16px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0;
}

/* Couleur accent line en haut du body */
.tc-card-body::before {
    content: '';
    display: block;
    height: 1px;
    background: linear-gradient(90deg,
        color-mix(in oklch, var(--card-color) 40%, transparent) 0%,
        transparent 80%);
    margin-bottom: 12px;
    opacity: 0.5;
}

.tc-card-name {
    font-family: var(--tc-font-display);
    font-size: 14.5px;
    font-weight: 700;
    color: #eeeeff;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

.tc-card-product {
    font-size: 11.5px;
    color: color-mix(in oklch, var(--card-color) 65%, #8484a8);
    margin: 0 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* URL */
.tc-card-url {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--tc-r-xs);
    padding: 5px 9px;
    min-width: 0;
    color: #5a5a78;
    margin-bottom: 10px;
    transition: border-color 0.2s, background 0.2s;
}
.tc-card-url:hover {
    background: rgba(255,255,255,0.055);
    border-color: color-mix(in oklch, var(--card-color) 28%, transparent);
}
.tc-card-url-text {
    flex: 1;
    font-size: 10px;
    font-family: var(--tc-font-mono, monospace);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: color-mix(in oklch, var(--card-color) 75%, #6366f1);
}
.tc-card-url-copy {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #5a5a78;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
}
.tc-card-url-copy:hover { color: #f2f2fc; background: rgba(255,255,255,0.1); }

/* Métriques — 3 colonnes avec ligne de séparation */
.tc-card-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-radius: var(--tc-r-sm);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 11px;
    background: rgba(255,255,255,0.025);
}

.tc-metric-item {
    padding: 9px 5px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: background 0.15s;
    position: relative;
}
.tc-metric-item + .tc-metric-item::before {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 1px;
    background: rgba(255,255,255,0.06);
}
.tc-metric-item:hover { background: rgba(255,255,255,0.04); }

.tc-metric-rev .tc-mi-val {
    color: #34d399;
    text-shadow: 0 0 16px rgba(52,211,153,0.4);
}

.tc-mi-val {
    font-family: var(--tc-font-display);
    font-size: 17px;
    font-weight: 900;
    color: #eeeeff;
    line-height: 1;
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
}

.tc-mi-lbl {
    font-size: 8.5px;
    color: #5a5a78;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

/* Actions — layout horizontal propre */
.tc-card-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
}

.tc-act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 600;
    font-family: var(--tc-font-body);
    cursor: pointer;
    border: 1px solid transparent;
    transition:
        background 0.15s,
        transform 0.12s var(--tc-ease-spring),
        border-color 0.15s,
        box-shadow 0.15s;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.tc-act-btn:active { transform: scale(0.96) !important; }

.tc-act-edit {
    background: color-mix(in oklch, var(--card-color) 14%, rgba(255,255,255,.03));
    border-color: color-mix(in oklch, var(--card-color) 28%, transparent);
    color: color-mix(in oklch, var(--card-color) 90%, white);
    flex: 1;
}
.tc-act-edit:hover {
    background: color-mix(in oklch, var(--card-color) 26%, rgba(255,255,255,.04));
    border-color: color-mix(in oklch, var(--card-color) 50%, transparent);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px color-mix(in oklch, var(--card-color) 25%, transparent);
}

.tc-act-publish {
    background: rgba(16,185,129,0.1);
    border-color: rgba(16,185,129,0.22);
    color: #6ee7b7;
    flex: 1;
}
.tc-act-publish:hover {
    background: rgba(16,185,129,0.22);
    border-color: rgba(16,185,129,0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16,185,129,0.2);
}

.tc-act-pause {
    background: rgba(245,158,11,0.09);
    border-color: rgba(245,158,11,0.18);
    color: #fcd34d;
    padding: 7px 11px;
}
.tc-act-pause:hover {
    background: rgba(245,158,11,0.18);
    transform: translateY(-1px);
}

.tc-act-icon {
    background: rgba(255,255,255,0.035);
    border-color: rgba(255,255,255,0.06);
    color: #5a5a78;
    padding: 7px 9px;
    font-size: 13px;
}
.tc-act-icon:hover {
    background: rgba(255,255,255,0.09);
    color: #c4c4e0;
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-1px);
}

.tc-act-del {
    background: rgba(239,68,68,0.07);
    border-color: rgba(239,68,68,0.13);
    color: #f87171;
    padding: 7px 9px;
    font-size: 13px;
}
.tc-act-del:hover {
    background: rgba(239,68,68,0.18);
    border-color: rgba(239,68,68,0.32);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239,68,68,0.18);
}

/* ── ÉTAT VIDE ─────────────────────────────────────────────── */

.tc-empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--tc-text-2);
    @starting-style { opacity: 0; transform: translateY(12px); }
}

.tc-empty-icon-wrap {
    font-size: 60px;
    margin-bottom: 16px;
    opacity: 0.45;
    display: block;
    animation: tc-float 3s ease-in-out infinite;
}

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

.tc-empty-state h3 {
    font-family: var(--tc-font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--tc-text);
    margin: 0 0 8px;
    text-wrap: balance;
}

.tc-empty-state p {
    font-size: 14px;
    color: var(--tc-text-2);
    margin: 0 0 24px;
    text-wrap: balance;
}

/* ── SKELETON ──────────────────────────────────────────────── */

.tc-skeleton-header,
.tc-skeleton-stats,
.tc-skeleton-card {
    background: linear-gradient(
        105deg,
        var(--tc-surface)    0%,
        var(--tc-surface)    35%,
        color-mix(in oklch, var(--tc-surface) 70%, white) 50%,
        var(--tc-surface)    65%,
        var(--tc-surface)    100%
    );
    background-size: 300% 100%;
    animation: tc-shimmer 1.6s var(--tc-ease-smooth) infinite;
    border-radius: var(--tc-r-sm);
    border: 1px solid var(--tc-border);
}

.tc-skeleton-header { height: 84px; margin-bottom: 32px; border-radius: var(--tc-r-md); }
.tc-skeleton-stats  { height: 108px; margin-bottom: 24px; border-radius: var(--tc-r-md); }

.tc-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 20px;
}

.tc-skeleton-card { height: 270px; border-radius: var(--tc-r-lg); }

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

/* ── INPUTS ────────────────────────────────────────────────── */

.tc-input,
.tc-textarea,
.tc-select {
    width: 100%;
    background: var(--tc-surface);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-r-sm);
    padding: 10px 14px;
    font-family: var(--tc-font-body);
    font-size: 14px;
    color: var(--tc-text);
    transition:
        border-color var(--tc-dur-base),
        box-shadow var(--tc-dur-base);
    box-sizing: border-box;
    outline: none;
}

.tc-input::placeholder,
.tc-textarea::placeholder { color: var(--tc-text-3); }

.tc-input:focus,
.tc-textarea:focus,
.tc-select:focus {
    border-color: color-mix(in oklch, var(--tc-accent) 65%, transparent);
    box-shadow:
        0 0 0 3px color-mix(in oklch, var(--tc-accent) 13%, transparent),
        0 1px 4px rgba(0,0,0,0.06);
}

.tc-textarea { resize: vertical; min-height: 100px; }
.tc-select { appearance: none; cursor: pointer; }

.tc-form-group { margin-bottom: 20px; }

.tc-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--tc-text);
    margin-bottom: 8px;
}
.tc-form-label span { color: var(--tc-text-2); font-weight: 400; }

/* ── MODAL ─────────────────────────────────────────────────── */

.tc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tc-modal-overlay.active { display: flex; }

.tc-modal {
    background: var(--tc-surface);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-r-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--tc-shadow-4), 0 0 0 1px color-mix(in oklch, var(--tc-accent) 10%, transparent);
    animation: tc-modal-in var(--tc-dur-slow) var(--tc-ease-spring);
}

@keyframes tc-modal-in {
    from { opacity: 0; transform: scale(0.93) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

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

.tc-modal-title {
    font-family: var(--tc-font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--tc-text);
    margin: 0 0 4px;
    letter-spacing: -0.02em;
}

.tc-modal-sub {
    font-size: 13px;
    color: var(--tc-text-2);
    margin: 0;
}

.tc-modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--tc-r-sm);
    border: 1px solid var(--tc-border);
    background: var(--tc-surface-2);
    color: var(--tc-text-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition:
        background var(--tc-dur-base),
        color var(--tc-dur-base),
        transform var(--tc-dur-base) var(--tc-ease-spring);
    flex-shrink: 0;
    font-family: inherit;
}

.tc-modal-close:hover {
    background: color-mix(in oklch, var(--tc-err) 18%, transparent);
    color: var(--tc-err);
    transform: scale(1.08) rotate(90deg);
}

.tc-modal-body { flex: 1; overflow-y: auto; padding: 22px 24px; }

.tc-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--tc-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Modal domaines */
.tc-domains-modal-inner { max-width: 580px; }

.tc-domain-info-box {
    background: var(--tc-surface-2);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-r-md);
    padding: 16px;
    margin-bottom: 20px;
}

.tc-domain-info-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--tc-text);
    margin-bottom: 12px;
}

.tc-domain-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.tc-domain-info-lbl {
    color: var(--tc-text-2);
    font-weight: 500;
    min-width: 80px;
}

.tc-domain-info-row code {
    background: color-mix(in oklch, var(--tc-accent) 12%, transparent);
    color: color-mix(in oklch, var(--tc-accent) 85%, white);
    padding: 2px 8px;
    border-radius: var(--tc-r-xs);
    font-family: var(--tc-font-mono);
    font-size: 12px;
    border: 1px solid color-mix(in oklch, var(--tc-accent) 20%, transparent);
}

.tc-domain-info-note {
    font-size: 12px;
    color: var(--tc-text-2);
    margin: 8px 0 0;
    text-wrap: balance;
}

.tc-domain-add-row { display: flex; gap: 10px; margin-bottom: 20px; }
.tc-domain-input { flex: 1; }
.tc-domain-list { display: flex; flex-direction: column; gap: 8px; }

.tc-domain-empty {
    text-align: center;
    color: var(--tc-text-2);
    font-size: 13px;
    padding: 24px 0;
}

.tc-domain-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--tc-surface-2);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-r-sm);
    padding: 12px 14px;
    transition: border-color var(--tc-dur-base);
}

.tc-domain-item:hover {
    border-color: color-mix(in oklch, var(--tc-accent) 30%, var(--tc-border));
}

.tc-domain-item-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }

.tc-domain-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--tc-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--tc-font-mono);
}

.tc-domain-status {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--tc-r-full);
}

.tc-domain-verified-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tc-ok);
    flex-shrink: 0;
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--tc-ok) 22%, transparent);
    animation: tc-dot-pulse 2s ease-in-out infinite;
}

@keyframes tc-dot-pulse {
    0%, 100% { box-shadow: 0 0 0 3px color-mix(in oklch, var(--tc-ok) 20%, transparent); }
    50% { box-shadow: 0 0 0 6px color-mix(in oklch, var(--tc-ok) 8%, transparent); }
}

.tc-domain-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.tc-domain-plan-note { font-size: 12px; color: var(--tc-text-2); text-align: center; padding: 12px 0 0; }

/* ── WIZARD ────────────────────────────────────────────────── */

.tc-wizard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.78);
    backdrop-filter: blur(14px) saturate(1.3);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tc-wizard-overlay.active { display: flex; }

.tc-wizard {
    background: var(--tc-surface);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-r-xl);
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--tc-shadow-4), 0 0 0 1px color-mix(in oklch, var(--tc-accent) 10%, transparent);
    animation: tc-modal-in var(--tc-dur-slow) var(--tc-ease-spring);
}

.tc-wizard-header {
    padding: 22px 28px 18px;
    border-bottom: 1px solid var(--tc-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tc-wizard-title {
    font-family: var(--tc-font-display);
    font-size: 20px;
    font-weight: 800;
    color: var(--tc-text);
    margin: 0;
    letter-spacing: -0.03em;
}

.tc-wizard-close {
    width: 34px;
    height: 34px;
    border-radius: var(--tc-r-sm);
    border: 1px solid var(--tc-border);
    background: var(--tc-surface-2);
    color: var(--tc-text-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    transition:
        background var(--tc-dur-base),
        color var(--tc-dur-base),
        transform var(--tc-dur-base) var(--tc-ease-spring);
    font-family: inherit;
}

.tc-wizard-close:hover {
    background: color-mix(in oklch, var(--tc-err) 18%, transparent);
    color: var(--tc-err);
    transform: scale(1.08) rotate(90deg);
}

.tc-wizard-steps {
    display: flex;
    padding: 20px 28px 0;
    position: relative;
}

.tc-wizard-steps::after {
    content: '';
    position: absolute;
    top: 36px;
    left: 44px;
    right: 44px;
    height: 1px;
    background: linear-gradient(90deg,
        color-mix(in oklch, var(--tc-accent) 40%, var(--tc-border)),
        var(--tc-border) 50%,
        var(--tc-border));
    z-index: 0;
}

.tc-wizard-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.tc-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--tc-surface-2);
    border: 1px solid var(--tc-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--tc-text-2);
    transition:
        background var(--tc-dur-base),
        border-color var(--tc-dur-base),
        color var(--tc-dur-base),
        box-shadow var(--tc-dur-base);
}

.tc-wizard-step.active .tc-step-circle {
    background: var(--tc-grad-primary);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 16px color-mix(in oklch, var(--tc-accent) 52%, transparent);
}

.tc-wizard-step.done .tc-step-circle {
    background: color-mix(in oklch, var(--tc-ok) 90%, transparent);
    border-color: transparent;
    color: #fff;
}

.tc-step-label {
    font-size: 11px;
    color: var(--tc-text-3);
    text-align: center;
    font-weight: 500;
}

.tc-wizard-step.active .tc-step-label {
    color: color-mix(in oklch, var(--tc-accent) 85%, white);
}

.tc-wizard-body { flex: 1; overflow-y: auto; padding: 24px 28px; }

.tc-step-title {
    font-family: var(--tc-font-display);
    font-size: 17px;
    font-weight: 700;
    color: var(--tc-text);
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

.tc-step-description {
    font-size: 14px;
    color: var(--tc-text-2);
    margin-bottom: 24px;
    text-wrap: balance;
}

.tc-wizard-step-content { display: none; }

.tc-wizard-step-content.active {
    display: block;
    animation: tc-step-in var(--tc-dur-base) var(--tc-ease-spring);
}

@keyframes tc-step-in {
    from { opacity: 0; transform: translateX(18px) scale(0.98); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

.tc-wizard-footer {
    padding: 16px 28px;
    border-top: 1px solid var(--tc-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

/* ── STYLE PICKER ──────────────────────────────────────────── */

.tc-style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.tc-style-option {
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-r-md);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition:
        border-color var(--tc-dur-base),
        background var(--tc-dur-base),
        transform var(--tc-dur-base) var(--tc-ease-spring),
        box-shadow var(--tc-dur-base);
}

.tc-style-option:hover {
    border-color: color-mix(in oklch, var(--tc-accent) 55%, transparent);
    background: color-mix(in oklch, var(--tc-accent) 6%, transparent);
    transform: translateY(-2px);
    box-shadow: var(--tc-shadow-2);
}

.tc-style-option.selected {
    border-color: color-mix(in oklch, var(--tc-accent) 70%, transparent);
    background: color-mix(in oklch, var(--tc-accent) 10%, transparent);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--tc-accent) 14%, transparent);
}

.tc-style-option-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.tc-style-option-label { font-size: 13px; font-weight: 600; color: var(--tc-text); margin-bottom: 4px; }
.tc-style-option-desc { font-size: 11px; color: var(--tc-text-2); }

/* Color picker */
.tc-color-picker { display: flex; gap: 8px; flex-wrap: wrap; }

.tc-color-swatch {
    width: 36px;
    height: 36px;
    border-radius: var(--tc-r-sm);
    cursor: pointer;
    border: 2px solid transparent;
    outline: 2px solid transparent;
    transition:
        transform var(--tc-dur-base) var(--tc-ease-spring),
        outline-color var(--tc-dur-base),
        box-shadow var(--tc-dur-base);
}

.tc-color-swatch:hover { transform: scale(1.1); }
.tc-color-swatch.selected {
    transform: scale(1.12);
    outline-color: var(--tc-text);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Icon picker */
.tc-icon-picker { display: flex; gap: 6px; flex-wrap: wrap; }

.tc-icon-option {
    width: 40px;
    height: 40px;
    border-radius: var(--tc-r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    border: 1px solid transparent;
    background: var(--tc-surface-2);
    transition:
        border-color var(--tc-dur-base),
        background var(--tc-dur-base),
        transform var(--tc-dur-base) var(--tc-ease-spring),
        box-shadow var(--tc-dur-base);
}

.tc-icon-option:hover {
    border-color: color-mix(in oklch, var(--tc-accent) 50%, transparent);
    background: color-mix(in oklch, var(--tc-accent) 10%, transparent);
    transform: scale(1.12);
}

.tc-icon-option.selected {
    border-color: var(--tc-accent);
    background: color-mix(in oklch, var(--tc-accent) 16%, transparent);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--tc-accent) 14%, transparent);
}

/* ── LOADER IA ─────────────────────────────────────────────── */

.tc-ai-loader { text-align: center; padding: 52px 24px; }

.tc-ai-loader-icon {
    font-size: 60px;
    animation: tc-ai-spin 1.8s linear infinite;
    display: block;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px color-mix(in oklch, var(--tc-accent) 60%, transparent));
}

@keyframes tc-ai-spin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

.tc-ai-loader h3 {
    font-family: var(--tc-font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--tc-text);
    margin: 0 0 8px;
}

.tc-ai-loader p { font-size: 14px; color: var(--tc-text-2); margin: 0 0 24px; text-wrap: balance; }

.tc-ai-progress {
    height: 3px;
    background: var(--tc-border);
    border-radius: var(--tc-r-full);
    overflow: hidden;
    max-width: 400px;
    margin: 0 auto;
}

.tc-ai-progress-bar {
    height: 100%;
    background: var(--tc-grad-vivid);
    border-radius: var(--tc-r-full);
    transition: width 0.6s var(--tc-ease-smooth);
    box-shadow: 0 0 12px color-mix(in oklch, var(--tc-accent) 60%, transparent);
}

.tc-ai-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 20px auto;
    text-align: left;
    max-width: 360px;
}

.tc-ai-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--tc-text-3);
    transition: color var(--tc-dur-base);
}

.tc-ai-step.active { color: var(--tc-text); font-weight: 600; }
.tc-ai-step.done { color: var(--tc-ok); }

/* Input + AI */
.tc-input-with-ai { display: flex; gap: 8px; }
.tc-input-with-ai .tc-input { flex: 1; }

.tc-ai-btn {
    padding: 10px 16px;
    border-radius: var(--tc-r-sm);
    background: var(--tc-grad-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: var(--tc-font-body);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition:
        transform var(--tc-dur-base) var(--tc-ease-spring),
        box-shadow var(--tc-dur-base),
        filter var(--tc-dur-base);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tc-ai-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px color-mix(in oklch, var(--tc-accent) 42%, transparent);
    filter: brightness(1.06);
}

.tc-ai-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: none; }

/* ── UTILITAIRES ───────────────────────────────────────────── */

.tc-link {
    color: color-mix(in oklch, var(--tc-accent) 85%, white);
    cursor: pointer;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color var(--tc-dur-fast), text-decoration-color var(--tc-dur-fast);
}
.tc-link:hover { text-decoration: underline; }

.tc-divider-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--tc-text-3);
    margin: 16px 0;
}
.tc-divider-label::before,
.tc-divider-label::after { content: ''; flex: 1; height: 1px; background: var(--tc-border); }

/* ── TABS ──────────────────────────────────────────────────── */

.tc-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--tc-border);
    margin-bottom: 24px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tc-tabs::-webkit-scrollbar { display: none; }

.tc-tab {
    padding: 11px 20px;
    font-family: var(--tc-font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--tc-text-2);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition:
        color var(--tc-dur-base),
        border-color var(--tc-dur-base);
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.tc-tab.active { color: var(--tc-text); border-bottom-color: var(--tc-accent); }
.tc-tab:hover:not(.active) { color: var(--tc-text); }

.tc-tab-content { display: none; }
.tc-tab-content.active { display: block; animation: tc-step-in var(--tc-dur-base) var(--tc-ease-spring); }

/* ── LEADS TABLE ───────────────────────────────────────────── */

.tc-leads-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.tc-leads-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--tc-text-3);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 1px solid var(--tc-border);
}

.tc-leads-table td {
    padding: 12px;
    border-bottom: 1px solid var(--tc-border-2);
    color: var(--tc-text);
    transition: background var(--tc-dur-fast);
}

.tc-leads-table tr:hover td { background: color-mix(in oklch, var(--tc-accent) 4%, transparent); }
.tc-leads-table tr:last-child td { border-bottom: none; }

/* ── PAYMENTS ──────────────────────────────────────────────── */

.tc-payments-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

.tc-payment-card {
    background: var(--tc-surface);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-r-md);
    padding: 22px;
    transition:
        border-color var(--tc-dur-base),
        box-shadow var(--tc-dur-base),
        transform var(--tc-dur-base) var(--tc-ease-spring);
}

.tc-payment-card:hover {
    border-color: color-mix(in oklch, var(--tc-accent) 35%, var(--tc-border));
    box-shadow: var(--tc-shadow-2);
    transform: translateY(-2px);
}

.tc-payment-logo { font-size: 32px; margin-bottom: 12px; }
.tc-payment-name { font-family: var(--tc-font-display); font-size: 16px; font-weight: 700; color: var(--tc-text); margin: 0 0 4px; }
.tc-payment-desc { font-size: 13px; color: var(--tc-text-2); margin: 0 0 16px; }

/* ── ACCORDION ─────────────────────────────────────────────── */

.tc-accordion {
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-r-sm);
    overflow: hidden;
    margin-bottom: 8px;
    transition: border-color var(--tc-dur-base);
}

.tc-accordion:hover { border-color: color-mix(in oklch, var(--tc-accent) 28%, var(--tc-border)); }

.tc-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--tc-text);
    background: var(--tc-surface);
    transition: background var(--tc-dur-fast);
    user-select: none;
}

.tc-accordion-header:hover { background: var(--tc-surface-2); }

.tc-accordion-chevron {
    transition: transform var(--tc-dur-base) var(--tc-ease-smooth);
    font-size: 12px;
    color: var(--tc-text-3);
}
.tc-accordion.open .tc-accordion-chevron { transform: rotate(180deg); color: var(--tc-accent); }

.tc-accordion-content {
    font-size: 13px;
    color: var(--tc-text-2);
    line-height: 1.6;
    /* interpolate-size pour animer height: auto */
    interpolate-size: allow-keywords;
    height: 0;
    overflow: hidden;
    transition: height var(--tc-dur-slow) var(--tc-ease-smooth);
}

.tc-accordion.open .tc-accordion-content {
    height: auto;
    padding: 14px 16px;
    border-top: 1px solid var(--tc-border);
}

/* ══════════════════════════════════════════════════════════════
   ONBOARDING
══════════════════════════════════════════════════════════════ */

.tc-onboarding { max-width: 560px; margin: 0 auto; padding: 32px 24px; }

.tc-onboarding-header { text-align: center; margin-bottom: 40px; }

.tc-onboarding-icon {
    font-size: 60px;
    margin-bottom: 16px;
    display: block;
    filter: drop-shadow(0 8px 24px color-mix(in oklch, var(--tc-accent) 50%, transparent));
    animation: tc-float 3s ease-in-out infinite;
}

.tc-onboarding-title {
    font-family: var(--tc-font-display);
    font-size: 26px;
    font-weight: 900;
    background: var(--tc-grad-vivid);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 8px;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.tc-onboarding-sub { font-size: 15px; color: var(--tc-text-2); margin: 0; line-height: 1.65; text-wrap: balance; }

.tc-onboarding-step { display: none; }
.tc-onboarding-step.active { display: block; animation: tc-step-in var(--tc-dur-slow) var(--tc-ease-spring); }
.tc-onboarding-step-title { font-family: var(--tc-font-display); font-size: 18px; font-weight: 700; color: var(--tc-text); margin: 0 0 20px; }

.tc-subdomain-wrap {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-r-sm);
    overflow: hidden;
    background: var(--tc-surface);
    transition: border-color var(--tc-dur-base), box-shadow var(--tc-dur-base);
}

.tc-subdomain-wrap:focus-within {
    border-color: color-mix(in oklch, var(--tc-accent) 60%, transparent);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--tc-accent) 12%, transparent);
}

.tc-subdomain-input {
    flex: 1;
    background: none;
    border: none;
    padding: 11px 14px;
    font-family: var(--tc-font-body);
    font-size: 14px;
    color: var(--tc-text);
    outline: none;
    min-width: 0;
}

.tc-subdomain-suffix {
    padding: 11px 14px;
    font-size: 13px;
    color: var(--tc-text-2);
    border-left: 1px solid var(--tc-border);
    white-space: nowrap;
    background: var(--tc-surface-2);
    font-family: var(--tc-font-mono);
}

.tc-subdomain-check {
    font-size: 12px;
    margin-top: 6px;
    font-weight: 600;
    min-height: 20px;
    transition: color var(--tc-dur-base);
}

.tc-subdomain-check.ok      { color: var(--tc-ok); }
.tc-subdomain-check.error   { color: var(--tc-err); }
.tc-subdomain-check.checking { color: var(--tc-text-3); }

.tc-onboarding-footer { margin-top: 32px; display: flex; justify-content: flex-end; gap: 10px; }

.tc-success-state { text-align: center; padding: 20px 0 8px; }

.tc-success-icon {
    font-size: 70px;
    margin-bottom: 20px;
    display: block;
    animation: tc-success-bounce var(--tc-dur-xslow) var(--tc-ease-spring);
    filter: drop-shadow(0 8px 28px color-mix(in oklch, var(--tc-ok) 55%, transparent));
}

@keyframes tc-success-bounce {
    from { transform: scale(0.4) rotate(-10deg); opacity: 0; }
    60% { transform: scale(1.15) rotate(3deg); opacity: 1; }
    to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

.tc-success-title {
    font-family: var(--tc-font-display);
    font-size: 24px;
    font-weight: 800;
    color: var(--tc-text);
    margin: 0 0 10px;
    letter-spacing: -0.03em;
}

.tc-success-msg { font-size: 14px; color: var(--tc-text-2); margin: 0 0 20px; text-wrap: balance; }
.tc-success-url { color: color-mix(in oklch, var(--tc-accent) 85%, white); font-weight: 700; font-family: var(--tc-font-mono); }

} /* end @layer components */

/* ══════════════════════════════════════════════════════════════
   STATES — :has(), focus-visible
══════════════════════════════════════════════════════════════ */

@layer states {

    /* Filtre actif — la grille s'adapte avec :has() */
    .tc-tunnels-grid:has(.tc-tunnel-card[data-status="published"]) .tc-tunnel-card:not([data-status="published"]) {
        /* subtle de-emphasis */
    }

    /* Carte avec URL publiée — highlight la row */
    .tc-tunnel-url-row:not(.tc-url-empty) {
        border-color: color-mix(in oklch, var(--tc-ok) 20%, var(--tc-border));
    }

    .tc-tunnel-url-row:not(.tc-url-empty) .tc-url-text {
        color: color-mix(in oklch, var(--tc-ok) 75%, var(--tc-text-2));
    }

    /* Focus-visible pour accessibilité clavier */
    .tc-btn:focus-visible,
    .tc-filter-btn:focus-visible,
    .tc-thumb-action:focus-visible {
        outline: 2px solid color-mix(in oklch, var(--tc-accent) 80%, transparent);
        outline-offset: 2px;
    }

    /* Card publish en train de hover — pulse le badge */
    .tc-tunnel-card:hover .tc-status-badge.published {
        animation: none;
        box-shadow: 0 0 0 4px color-mix(in oklch, var(--tc-ok) 22%, transparent);
    }

    /* Section search focus — expand */
    .tc-section-actions:has(.tc-search-input:focus) .tc-btn-express {
        opacity: 0.7;
    }
}

/* ══════════════════════════════════════════════════════════════
   ANIMATIONS — @keyframes globaux
══════════════════════════════════════════════════════════════ */

@layer animations {

    /* Entrée des cards avec stagger via CSS counter */
    .tc-tunnels-grid > * {
        animation: tc-card-in var(--tc-dur-slow) var(--tc-ease-spring) both;
    }

    .tc-tunnels-grid > *:nth-child(1) { animation-delay: 0ms; }
    .tc-tunnels-grid > *:nth-child(2) { animation-delay: 50ms; }
    .tc-tunnels-grid > *:nth-child(3) { animation-delay: 100ms; }
    .tc-tunnels-grid > *:nth-child(4) { animation-delay: 150ms; }
    .tc-tunnels-grid > *:nth-child(5) { animation-delay: 200ms; }
    .tc-tunnels-grid > *:nth-child(6) { animation-delay: 250ms; }
    .tc-tunnels-grid > *:nth-child(n+7) { animation-delay: 300ms; }

    @keyframes tc-card-in {
        from {
            opacity: 0;
            transform: translateY(20px) scale(0.97);
            filter: blur(2px);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
            filter: blur(0);
        }
    }

    /* Stats stagger */
    .tc-stats-grid > *:nth-child(1) { animation-delay: 0ms; }
    .tc-stats-grid > *:nth-child(2) { animation-delay: 60ms; }
    .tc-stats-grid > *:nth-child(3) { animation-delay: 120ms; }
    .tc-stats-grid > *:nth-child(4) { animation-delay: 180ms; }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — Container Queries + Media Queries
══════════════════════════════════════════════════════════════ */

@layer responsive {

    /* Container queries sur .tc-wrapper */
    @container tc-main (max-width: 1100px) {
        .tc-stats-grid { grid-template-columns: repeat(2, 1fr); }
    }

    @container tc-main (max-width: 700px) {
        .tc-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
        .tc-tunnels-grid { grid-template-columns: 1fr; }
        .tc-stat-value { font-size: 24px; }
        .tc-section-header { flex-direction: column; align-items: flex-start; }
        .tc-header { flex-direction: column; align-items: flex-start; }
        .tc-header-actions { width: 100%; }
        .tc-style-grid { grid-template-columns: repeat(2, 1fr); }
        .tc-search-input,
        .tc-search-input:focus { width: 100%; }
    }

    @container tc-main (max-width: 480px) {
        .tc-stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
        .tc-header-title { font-size: 20px; }
        .tc-filter-btn { padding: 5px 10px; font-size: 12px; }
        .tc-filters { gap: 4px; }
    }

    /* Media query fallback pour navigateurs sans container queries */
    @supports not (container-type: inline-size) {
        @media (max-width: 1100px) {
            .tc-stats-grid { grid-template-columns: repeat(2, 1fr); }
        }
        @media (max-width: 768px) {
            .tc-wrapper { padding: 16px; }
            .tc-tunnels-grid { grid-template-columns: 1fr; }
            .tc-header { flex-direction: column; align-items: flex-start; }
        }
    }

    /* Wizard */
    @media (max-width: 768px) {
        .tc-wizard { max-height: 95vh; border-radius: var(--tc-r-lg) var(--tc-r-lg) 0 0; }
        .tc-wizard-steps::after { display: none; }
        .tc-step-label { display: none; }
        .tc-payments-grid { grid-template-columns: 1fr; }
    }

    /* Reduced motion */
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}

/* ============================================================
   TUNNEL EDITOR OVERLAY — Full-screen page editor
   ============================================================ */

.tc-editor-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary, #0f0f14);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.tc-editor-overlay.active { display: flex; }

.tc-editor-header {
    height: 56px;
    background: var(--bg-secondary, #1a1a24);
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    flex-shrink: 0;
    overflow: hidden;
}
.tc-editor-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.tc-editor-tabs {
    display: flex;
    gap: 4px;
}
.tc-editor-tab {
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--text-muted, #888);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.tc-editor-tab.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}
.tc-editor-tab:hover:not(.active) {
    background: rgba(255,255,255,0.06);
    color: var(--text, #fff);
}
.tc-editor-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Sidebar */
.tc-editor-sidebar {
    width: 240px;
    background: var(--bg-secondary, #1a1a24);
    border-right: 1px solid var(--border, rgba(255,255,255,0.08));
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}
.tc-editor-sidebar-section {
    padding: 14px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
}
.tc-editor-sidebar-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted, #666);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}
.tc-section-block {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 7px;
    cursor: pointer;
    border: 1px solid var(--border, rgba(255,255,255,0.07));
    margin-bottom: 6px;
    transition: border-color 0.15s, background 0.15s;
    background: rgba(255,255,255,0.03);
}
.tc-section-block:hover {
    border-color: #8b5cf6;
    background: rgba(139,92,246,0.08);
}
.tc-section-block.active {
    border-color: #8b5cf6;
    background: rgba(139,92,246,0.12);
}
.tc-section-block-icon { font-size: 16px; flex-shrink: 0; }
.tc-section-block-name { font-size: 12px; font-weight: 500; color: var(--text, #fff); }

/* Preview area */
.tc-editor-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-tertiary, #111118);
    min-width: 0;
}
.tc-editor-preview-toolbar {
    background: var(--bg-secondary, #1a1a24);
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.tc-device-btns { display: flex; gap: 4px; }
.tc-device-btn {
    width: 30px; height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    background: transparent;
    color: var(--text-muted, #888);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tc-device-btn.active {
    background: rgba(255,255,255,0.08);
    color: var(--text, #fff);
    border-color: #8b5cf6;
}
.tc-editor-preview-content {
    flex: 1;
    overflow: auto;
    padding: 20px;
    display: flex;
    justify-content: center;
}
.tc-page-frame {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    width: 100%;
    max-width: 800px;
    min-height: 400px;
    overflow: auto;
}
.tc-page-frame.mobile { max-width: 375px; }
.tc-page-frame.tablet { max-width: 768px; }

/* Props panel */
.tc-editor-props {
    width: 260px;
    background: var(--bg-secondary, #1a1a24);
    border-left: 1px solid var(--border, rgba(255,255,255,0.08));
    overflow-y: auto;
    flex-shrink: 0;
    padding: 14px;
}
.tc-editor-props-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted, #666);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 14px;
}

/* Accordion */
.tc-accordion { border: 1px solid var(--border, rgba(255,255,255,0.08)); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.tc-accordion-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; cursor: pointer;
    font-size: 12px; font-weight: 600; color: var(--text, #fff);
    background: rgba(255,255,255,0.03);
    user-select: none;
}
.tc-accordion-content { padding: 10px 12px; }

/* Color swatch */
.tc-color-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.tc-color-swatch {
    width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
    border: 2px solid transparent; transition: border-color 0.15s, transform 0.15s;
}
.tc-color-swatch.selected, .tc-color-swatch:hover { border-color: #fff; transform: scale(1.15); }

/* Form elements inside editor */
.tc-form-group { margin-bottom: 12px; }
.tc-form-label { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted, #888); margin-bottom: 5px; }
.tc-input, .tc-textarea, .tc-select {
    width: 100%; padding: 7px 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 6px;
    color: var(--text, #fff);
    font-size: 12px;
    font-family: inherit;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.tc-input:focus, .tc-textarea:focus, .tc-select:focus {
    outline: none;
    border-color: #8b5cf6;
}
.tc-textarea { resize: vertical; min-height: 60px; }
.tc-input-sm { padding: 4px 8px; font-size: 11px; }
.tc-select option { background: #1a1a24; color: #fff; }

/* ── Email Sequence UI ── */
.tc-seq-card { transition: border-color 0.15s, background 0.15s; }
.tc-seq-card:hover { border-color: rgba(139,92,246,0.4) !important; background: rgba(139,92,246,0.05) !important; }
.tc-seq-step-item { transition: border-color 0.15s; }
.tc-seq-step-item:hover { border-color: rgba(255,255,255,0.2) !important; }

/* Countdown timer mode tags */
.tb-ct-mode-tag {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.tb-ct-mode-tag--deadline { background: rgba(239,68,68,0.15); color: #f87171; }
.tb-ct-mode-tag--visit    { background: rgba(59,130,246,0.15); color: #60a5fa; }
.tb-ct-mode-tag--recurring{ background: rgba(16,185,129,0.15); color: #34d399; }

/* AI chat button in editor header */
.tc-btn-ai-chat {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(139,92,246,0.4);
    background: rgba(139,92,246,0.1);
    color: #a78bfa;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.tc-btn-ai-chat:hover { background: rgba(139,92,246,0.2); border-color: rgba(139,92,246,0.7); }

/* URL display in preview toolbar */
.tc-url-display {
    font-size: 11px;
    color: var(--text-muted, #666);
    padding: 4px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

@media (max-width: 768px) {
    .tc-editor-sidebar,
    .tc-editor-props { display: none; }
}

/* ── LIVE PREVIEW IFRAME ──────────────────────────────────── */

/* Iframe de preview dans le panneau éditeur */
.tc-preview-iframe {
    display: block;
    width: 100%;
    border: none;
    min-height: 500px;
    background: #fff;
    border-radius: 0 0 8px 8px;
    transition: opacity 0.2s;
}

.tc-preview-iframe--loading {
    opacity: 0.4;
    pointer-events: none;
}

/* Mobile frame: contraint la largeur à 390px comme un iPhone */
.tc-page-frame.mobile {
    max-width: 390px;
    margin: 0 auto;
    box-shadow: 0 0 0 8px #1e1e2e, 0 0 0 12px #2d2d42;
    border-radius: 16px;
    overflow: hidden;
}

.tc-page-frame.mobile .tc-preview-iframe,
.tc-page-frame.mobile #tc-preview-content {
    min-height: 700px;
}

/* ── FULLSCREEN PREVIEW OVERLAY ───────────────────────────── */

.tc-preview-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1999999;
    background: #0f0f1a;
    display: flex;
    flex-direction: column;
}

.tc-preview-fullscreen-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #1a1a2e;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    min-height: 46px;
}

.tc-preview-fullscreen-content {
    flex: 1;
    overflow: auto;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* Desktop frame: prend toute la largeur */
.tc-preview-fs-frame.desktop {
    width: 100%;
    height: calc(100vh - 86px);
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.tc-preview-fs-frame.desktop iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Mobile frame plein écran: 390px de large, hauteur 844px (iPhone 14) */
.tc-preview-fs-frame.mobile {
    width: 390px;
    height: 844px;
    background: #fff;
    border-radius: 44px;
    overflow: hidden;
    box-shadow:
        0 0 0 10px #1e1e2e,
        0 0 0 14px #2d2d42,
        0 20px 60px rgba(0,0,0,0.6);
    position: relative;
}

.tc-preview-fs-frame.mobile iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Notch décoratif sur le frame mobile fullscreen */
.tc-preview-fs-frame.mobile::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 28px;
    background: #1e1e2e;
    border-radius: 20px;
    z-index: 10;
    pointer-events: none;
}

/* Bouton Live actif */
#tc-btn-live-preview.tc-btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

/* ═══════════════════════════════════════════════════════
   ANIMATIONS & EFFETS TUNNEL — particules, survol, apparitions
   ═══════════════════════════════════════════════════════ */

/* ── Animations d'apparition (scroll/load) ── */
@keyframes tc-fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes tc-fadeInScale {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes tc-slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes tc-slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes tc-blurIn {
    from { opacity: 0; filter: blur(12px); }
    to   { opacity: 1; filter: blur(0); }
}
@keyframes tc-bounceIn {
    0%   { opacity: 0; transform: scale(0.3); }
    50%  { transform: scale(1.05); }
    70%  { transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes tc-countPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* Classes d'animation applicables */
.tc-anim-fadeUp    { animation: tc-fadeInUp 0.6s ease-out both; }
.tc-anim-fadeScale { animation: tc-fadeInScale 0.5s ease-out both; }
.tc-anim-slideL    { animation: tc-slideInLeft 0.6s ease-out both; }
.tc-anim-slideR    { animation: tc-slideInRight 0.6s ease-out both; }
.tc-anim-blurIn    { animation: tc-blurIn 0.5s ease-out both; }
.tc-anim-bounce    { animation: tc-bounceIn 0.6s ease-out both; }
.tc-anim-delay-1   { animation-delay: 0.1s; }
.tc-anim-delay-2   { animation-delay: 0.2s; }
.tc-anim-delay-3   { animation-delay: 0.3s; }
.tc-anim-delay-4   { animation-delay: 0.4s; }
.tc-anim-delay-5   { animation-delay: 0.5s; }

/* ── Effets de survol (hover) pour sections tunnel ── */
.tc-hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.tc-hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(99,102,241,0.15);
}
.tc-hover-glow {
    transition: box-shadow 0.4s ease;
}
.tc-hover-glow:hover {
    box-shadow: 0 0 30px rgba(99,102,241,0.25), 0 0 60px rgba(99,102,241,0.1);
}
.tc-hover-scale {
    transition: transform 0.25s ease;
}
.tc-hover-scale:hover {
    transform: scale(1.03);
}

/* ── Effet particules flottantes (background) ── */
@keyframes tc-float {
    0% { transform: translateY(-10px); opacity: 0; }
    10% { opacity: 0.5; }
    90% { opacity: 0.3; }
    100% { transform: translateY(calc(100vh + 20px)); opacity: 0; }
}
.tc-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.tc-particle {
    position: absolute;
    width: 1.5px !important;
    height: 12px !important;
    border-radius: 1px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.4), rgba(255,255,255,0.05)) !important;
    animation: tc-float linear infinite;
    opacity: 0;
}

/* ── Effet shimmer / shine ── */
@keyframes tc-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.tc-shimmer {
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.06) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: tc-shimmer 2s ease-in-out infinite;
}

/* ── Compteur animé ── */
.tc-countdown-digit {
    display: inline-block;
    animation: tc-countPulse 1s ease-in-out infinite;
}

/* ── Gradient border animé ── */
@keyframes tc-borderGlow {
    0%, 100% { border-color: rgba(99,102,241,0.3); }
    50% { border-color: rgba(99,102,241,0.7); }
}
.tc-border-glow {
    animation: tc-borderGlow 2s ease-in-out infinite;
}

/* ── Templates grid : catégories avec filtre ── */
.tc-tpl-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.tc-tpl-cat-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: #888;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
}
.tc-tpl-cat-btn:hover,
.tc-tpl-cat-btn.active {
    background: rgba(99,102,241,0.15);
    border-color: rgba(99,102,241,0.4);
    color: #a5b4fc;
}

/* ── Template card améliorée ── */
.tc-tpl-card {
    animation: tc-fadeInUp 0.4s ease-out both;
}
.tc-tpl-card:nth-child(2) { animation-delay: 0.05s; }
.tc-tpl-card:nth-child(3) { animation-delay: 0.1s; }
.tc-tpl-card:nth-child(4) { animation-delay: 0.15s; }
.tc-tpl-card:nth-child(5) { animation-delay: 0.2s; }
.tc-tpl-card:nth-child(6) { animation-delay: 0.25s; }

/* ── Banque d'images panel ── */
.tc-img-bank-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}
.tc-img-bank-item {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
    aspect-ratio: 16/10;
}
.tc-img-bank-item:hover {
    border-color: rgba(99,102,241,0.5);
    transform: scale(1.03);
}
.tc-img-bank-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ══════════════════════════════════════════
   Template Preview Cards v2
   Visual mini-thumbnails showing tunnel layout
   ══════════════════════════════════════════ */

.tc-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 4px 0;
}

.tc-tpl-card {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .3s cubic-bezier(.4,0,.2,1), background .3s ease-out, border-color .3s ease-out, opacity .3s ease-out;
    display: flex;
    flex-direction: column;
}
.tc-tpl-card:hover {
    border-color: var(--tpl-color, #6366f1);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,.3), 0 0 0 1px var(--tpl-color, #6366f1), inset 0 1px 0 rgba(255,255,255,.05);
}

/* ── Mini preview thumbnail ── */
.tc-tpl-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 0;
    font-family: Inter, system-ui, sans-serif;
    -webkit-user-select: none;
    user-select: none;
    display: flex;
    flex-direction: column;
}

.tc-tpl-pv-hero {
    flex: 0 0 55%;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}
.tc-tpl-pv-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 8px;
    position: relative;
    z-index: 1;
}
.tc-tpl-pv-hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 10px 6px;
    position: relative;
    z-index: 1;
    gap: 2px;
}
.tc-tpl-pv-badge {
    font-size: 5px;
    font-weight: 700;
    letter-spacing: .6px;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.tc-tpl-pv-cta {
    font-size: 5px;
    font-weight: 700;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    letter-spacing: .3px;
    margin-top: 3px;
}
.tc-tpl-pv-body {
    flex: 1;
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.tc-tpl-pv-section {
    padding: 2px 0;
}
.tc-tpl-pv-pricing {
    border-top: 1px solid rgba(255,255,255,.06);
    padding-top: 3px;
    text-align: center;
    margin-top: auto;
    padding-bottom: 4px;
}

/* Shimmer hover effect on preview */
.tc-tpl-card:hover .tc-tpl-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,.06) 50%, transparent 60%);
    animation: tc-tpl-shimmer .8s ease-out;
    pointer-events: none;
    z-index: 2;
}
@keyframes tc-tpl-shimmer {
    from { transform: translateX(-100%) translateY(-100%); }
    to { transform: translateX(100%) translateY(100%); }
}

/* ── Card body (name + niche) ── */
.tc-tpl-body {
    padding: 10px 12px 4px;
}
.tc-tpl-name {
    font-size: 13px;
    font-weight: 700;
    color: #f0f0f5;
    margin-bottom: 2px;
}
.tc-tpl-niche {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--tpl-color, #888);
    opacity: .8;
}

/* ── CTA button ── */
/* ── CTA button premium ── */
.tc-tpl-cta {
    padding: 8px 10px 12px;
    margin-top: auto;
}
.tc-tpl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    color: #fff;
    background: linear-gradient(135deg, color-mix(in srgb, var(--tpl-color, #6366f1) 85%, #000), var(--tpl-color, #6366f1));
    border: none;
    box-shadow: 0 2px 12px color-mix(in srgb, var(--tpl-color, #6366f1) 35%, transparent);
    transition: transform .25s cubic-bezier(.4,0,.2,1), background .25s ease-out, border-color .25s ease-out, opacity .25s ease-out;
    white-space: nowrap;
    cursor: pointer;
}
.tc-tpl-card:hover .tc-tpl-btn {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px color-mix(in srgb, var(--tpl-color, #6366f1) 50%, transparent);
    filter: brightness(1.15);
}
/* ── Responsive ── */
@media (max-width: 768px) {
    .tc-templates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}


/* ══════════════════════════════════════════
   Templates Section Header — Dark Premium
   ══════════════════════════════════════════ */
.tc-templates-section {
    margin-bottom: 32px;
}
.tc-templates-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.tc-templates-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tc-templates-title {
    font-size: 18px;
    font-weight: 700;
    color: #f0f0f5;
    margin: 0;
    letter-spacing: -.2px;
}
.tc-templates-sub {
    font-size: 12px;
    color: #888;
    margin: 0;
    font-weight: 400;
}
