/* =============================================================================
   TUNNEL CREATE CHAT — Layout chat+preview pour création
   Prefix : .tcc-*
   ============================================================================= */

.tcc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    z-index: 1100;
    display: none;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
}
.tcc-overlay.active { display: flex; }

.tcc-modal {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #0e0e18;
    position: relative;
    overflow: hidden;
}

/* ── Header ── */
.tcc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
    flex-shrink: 0;
    gap: 16px;
    height: 58px;
}

.tcc-back {
    background: none;
    border: none;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 0;
    transition: color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.tcc-back:hover { color: var(--text, #fff); }

.tcc-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.tcc-title-pulse {
    display: inline-block;
    animation: tcc-pulse 2s ease-in-out infinite;
}
@keyframes tcc-pulse {
    0%,100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(99,102,241,0.5)); }
    50%      { transform: scale(1.2); filter: drop-shadow(0 0 10px rgba(139,92,246,0.8)); }
}

.tcc-header-right { flex-shrink: 0; }

.tcc-btn-publish {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    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;
    box-shadow: 0 0 20px rgba(99,102,241,0.3);
    animation: tcc-publish-appear 0.4s ease both;
}
@keyframes tcc-publish-appear {
    from { opacity: 0; transform: scale(0.9) translateY(-4px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.tcc-btn-publish:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(99,102,241,0.5);
}
.tcc-btn-publish:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ── Corps ── */
.tcc-body {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

/* ── Preview (gauche, 60%) ── */
.tcc-preview-pane {
    flex: 0 0 60%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.08);
    background: #0a0a12;
    overflow: hidden;
}

.tcc-preview-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    flex-shrink: 0;
}

.tcc-preview-dots {
    display: flex;
    gap: 5px;
}
.tcc-preview-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
}
.tcc-preview-dots span:nth-child(1) { background: #ff5f57; }
.tcc-preview-dots span:nth-child(2) { background: #ffbd2e; }
.tcc-preview-dots span:nth-child(3) { background: #28c840; }

.tcc-preview-url {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 5px 12px;
    border: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tcc-url-text {
    font-size: 12px;
    font-family: monospace;
    color: #a5b4fc;
}

.tcc-preview-frame {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* ── Empty preview ── */
.tcc-pv-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    padding: 40px;
    text-align: center;
    color: var(--text-muted, #64748b);
}
.tcc-pv-empty-icon { font-size: 56px; margin-bottom: 20px; opacity: 0.5; }
.tcc-pv-empty h3 { font-size: 20px; font-weight: 700; color: rgba(255,255,255,0.5); margin: 0 0 10px; }
.tcc-pv-empty p  { font-size: 14px; margin: 0 0 32px; line-height: 1.6; }

.tcc-pv-empty-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 16px 20px;
    border: 1px solid rgba(255,255,255,0.06);
}
.tcc-pv-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}
.tcc-pv-step span {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(99,102,241,0.2);
    border: 1px solid rgba(99,102,241,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #a5b4fc;
    flex-shrink: 0;
}

/* ── Generating preview ── */
.tcc-pv-generating {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    padding: 40px;
    text-align: center;
}
.tcc-pv-gen-anim {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-bottom: 24px;
}
.tcc-gen-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #6366f1;
    border-right-color: #8b5cf6;
    animation: tcc-spin 1s linear infinite;
}
@keyframes tcc-spin { to { transform: rotate(360deg); } }

.tcc-pv-generating h3 {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255,255,255,0.8);
    margin: 0 0 24px;
}

.tcc-gen-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
    width: 100%;
    max-width: 320px;
}
.tcc-gen-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(255,255,255,0.3);
    padding: 8px 14px;
    border-radius: 8px;
    transition: transform 0.3s ease-out, background 0.3s ease-out, border-color 0.3s ease-out, color 0.3s ease-out, opacity 0.3s ease-out;
}
.tcc-gen-step.active {
    color: rgba(255,255,255,0.9);
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.25);
}
.tcc-gen-step.done {
    color: rgba(16,185,129,0.7);
}
.tcc-gen-step.done::before { content: '✓ '; }

/* ── Preview tunnel ── */
.tcc-pv-page {
    font-family: -apple-system, system-ui, sans-serif;
    background: #fff;
    color: #111;
    min-height: 100%;
}

.tcc-pv-hero {
    padding: 56px 32px 48px;
    background: linear-gradient(160deg, #0f0c29, #302b63, #24243e);
    color: #fff;
    text-align: center;
}
.tcc-pv-hero-inner { max-width: 600px; margin: 0 auto; }

.tcc-pv-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    margin-bottom: 18px;
}

.tcc-pv-headline {
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 900;
    line-height: 1.2;
    margin: 0 0 14px;
    color: #fff;
}

.tcc-pv-sub {
    font-size: 16px;
    color: rgba(255,255,255,0.75);
    line-height: 1.6;
    margin: 0 0 28px;
}

.tcc-pv-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border-radius: 12px;
    border: none;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.tcc-pv-urgency {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    margin: 16px 0 0;
    font-style: italic;
}

.tcc-pv-section {
    padding: 40px 32px;
    max-width: 680px;
    margin: 0 auto;
}

.tcc-pv-section-title {
    font-size: 20px;
    font-weight: 800;
    color: #111;
    margin: 0 0 20px;
    text-align: center;
}

.tcc-pv-features { background: #f8fafc; }
.tcc-pv-features-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.tcc-pv-feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}
.tcc-pv-fi { font-size: 22px; flex-shrink: 0; }
.tcc-pv-ft { font-size: 14px; font-weight: 700; color: #1e293b; margin-bottom: 3px; }
.tcc-pv-fd { font-size: 13px; color: #64748b; line-height: 1.5; }

.tcc-pv-testimonials { background: #fff; }
.tcc-pv-testi {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 12px;
}
.tcc-pv-testi-q { font-size: 14px; color: #1e293b; line-height: 1.6; font-style: italic; margin: 0 0 10px; }
.tcc-pv-testi-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}
.tcc-pv-testi-av { font-size: 22px; }

.tcc-pv-pricing {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    text-align: center;
}
.tcc-pv-price-box {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    border: 2px solid color-mix(in srgb, var(--cta) 30%, transparent);
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    max-width: 360px;
    margin: 0 auto;
}
.tcc-pv-price-old { font-size: 18px; color: #94a3b8; text-decoration: line-through; margin-bottom: 6px; }
.tcc-pv-price-main { font-size: 40px; font-weight: 900; color: #0f172a; }
.tcc-pv-price-desc { font-size: 14px; color: #64748b; margin: 8px 0 0; }
.tcc-pv-guarantee { font-size: 13px; color: #64748b; margin: 12px 0 0; }

.tcc-pv-faq { background: #fff; }
.tcc-pv-faq-item {
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}
.tcc-pv-faq-q { font-size: 14px; font-weight: 700; color: #1e293b; margin-bottom: 6px; }
.tcc-pv-faq-a { font-size: 13px; color: #64748b; line-height: 1.6; }

/* ── Chat (droite, 40%) ── */
.tcc-chat-pane {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: #0c0c16;
}

.tcc-chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.tcc-toolbar-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    color: var(--text-muted, #94a3b8);
    font-size: 12px;
    padding: 5px 10px;
    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;
}
.tcc-toolbar-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.06);
    color: #fff;
}
.tcc-toolbar-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.tcc-phase-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
}
.tcc-phase-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #475569;
}
.tcc-phase-dot.generating {
    background: #f59e0b;
    animation: tcc-blink 0.8s ease-in-out infinite;
}
.tcc-phase-dot.created {
    background: #10b981;
    animation: tcc-dot-pulse 2s ease-in-out infinite;
}
.tcc-phase-dot.published { background: #6366f1; animation: none; }

@keyframes tcc-blink  { 0%,100%{opacity:1} 50%{opacity:0.3} }
@keyframes tcc-dot-pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }

.tcc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}
.tcc-messages::-webkit-scrollbar { width: 4px; }
.tcc-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── Welcome ── */
.tcc-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 8px 8px;
}
.tcc-welcome-avatar { font-size: 40px; margin-bottom: 12px; }
.tcc-welcome h3 { font-size: 16px; font-weight: 700; color: #fff; margin: 0 0 8px; }
.tcc-welcome p  { font-size: 13px; color: var(--text-muted, #94a3b8); margin: 0 0 16px; line-height: 1.5; }

.tcc-suggestions {
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 100%;
}
.tcc-suggestion {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 9px;
    color: rgba(255,255,255,0.75);
    font-size: 12px;
    padding: 9px 12px;
    cursor: pointer;
    text-align: left;
    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;
    line-height: 1.4;
}
.tcc-suggestion:hover {
    background: rgba(99,102,241,0.12);
    border-color: rgba(99,102,241,0.3);
    color: #fff;
}

/* ── Messages ── */
.tcc-msg {
    display: flex;
    gap: 8px;
    animation: tcc-msg-in 0.25s ease;
}
@keyframes tcc-msg-in {
    from { opacity:0; transform: translateY(8px); }
    to   { opacity:1; transform: translateY(0); }
}

.tcc-msg-user { flex-direction: row-reverse; }

.tcc-msg-user .tcc-bubble {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-radius: 16px 16px 4px 16px;
    max-width: 85%;
    align-self: flex-end;
}

.tcc-msg-bot { align-items: flex-start; }

.tcc-bot-av {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(99,102,241,0.2);
    border: 1px solid rgba(99,102,241,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.tcc-msg-bot .tcc-bubble {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
    border-radius: 4px 16px 16px 16px;
    flex: 1;
}

.tcc-msg-error .tcc-bubble {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.2);
}

.tcc-bubble {
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.6;
    word-break: break-word;
}

/* Dots d'attente */
.tcc-dots {
    display: flex;
    gap: 5px;
    align-items: center;
    height: 18px;
}
.tcc-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    animation: tcc-dot 1.4s ease-in-out infinite;
}
.tcc-dots span:nth-child(2) { animation-delay: 0.2s; }
.tcc-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes tcc-dot { 0%,80%,100%{transform:scale(0.8);opacity:0.4} 40%{transform:scale(1.1);opacity:1} }

.tcc-load-hint {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-top: 6px;
    font-style: italic;
}

/* ── Input ── */
.tcc-input-area {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
    background: rgba(255,255,255,0.02);
}

.tcc-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.tcc-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    padding: 10px 14px;
    resize: none;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color 0.2s;
    min-height: 44px;
    max-height: 140px;
    overflow-y: auto;
}
.tcc-input:focus {
    outline: none;
    border-color: rgba(99,102,241,0.5);
    background: rgba(255,255,255,0.08);
}
.tcc-input::placeholder { color: rgba(255,255,255,0.3); }
.tcc-input:disabled { opacity: 0.5; cursor: not-allowed; }

.tcc-send {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    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;
}
.tcc-send:hover { transform: scale(1.05); box-shadow: 0 0 14px rgba(99,102,241,0.4); }
.tcc-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.tcc-send.loading {
    background: rgba(255,255,255,0.08);
    animation: tcc-spin 1s linear infinite;
}

.tcc-input-hint {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    margin-top: 8px;
    text-align: center;
    transition: color 0.3s;
}

/* ── Overlay succès publication ── */
.tcc-publish-success {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.88);
    backdrop-filter: blur(16px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: tcc-fade-in 0.3s ease;
}
@keyframes tcc-fade-in { from{opacity:0} to{opacity:1} }

.tcc-success-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    animation: tcc-success-pop 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes tcc-success-pop {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.tcc-success-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: tcc-bounce 0.6s ease 0.2s both;
}
@keyframes tcc-bounce {
    0%   { transform: translateY(-20px) scale(0.8); opacity:0; }
    60%  { transform: translateY(6px) scale(1.1); }
    100% { transform: translateY(0) scale(1); opacity:1; }
}

.tcc-success-title {
    font-size: 28px;
    font-weight: 900;
    color: #fff;
    margin: 0 0 10px;
    background: linear-gradient(135deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tcc-success-sub {
    font-size: 15px;
    color: rgba(255,255,255,0.6);
    margin: 0 0 28px;
}

.tcc-success-url {
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 28px;
}
.tcc-success-url-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.tcc-success-url-text {
    font-family: monospace;
    font-size: 14px;
    color: #a5b4fc;
    word-break: break-all;
}
.tcc-success-url-copy {
    background: rgba(99,102,241,0.2);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 7px;
    color: #a5b4fc;
    font-size: 12px;
    padding: 5px 10px;
    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;
    white-space: nowrap;
}
.tcc-success-url-copy:hover { background: rgba(99,102,241,0.35); }

.tcc-success-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tcc-btn {
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    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;
    border: 1px solid transparent;
    width: 100%;
}
.tcc-btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
}
.tcc-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.4); }
.tcc-btn-secondary {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.8);
}
.tcc-btn-secondary:hover { background: rgba(255,255,255,0.1); color: #fff; }
.tcc-btn-ghost {
    background: none;
    border-color: transparent;
    color: rgba(255,255,255,0.4);
}
.tcc-btn-ghost:hover { color: rgba(255,255,255,0.7); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .tcc-body { flex-direction: column; }
    .tcc-preview-pane { flex: 0 0 50%; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.08); }
    .tcc-chat-pane { flex: 0 0 50%; }
}
