/* ── Page de démo (contenu de l'iframe de la vitrine) ───────────────────── */
html, body { margin: 0; padding: 0; background: transparent; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: #0f172a; overflow: hidden; }
*, *::before, *::after { box-sizing: border-box; }

.demo-bar { display: flex; align-items: center; gap: 12px; padding: 0 2px 12px; }
.demo-badge { flex-shrink: 0; background: #e15615; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; padding: 5px 10px; border-radius: 20px; }
.demo-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.demo-chips::-webkit-scrollbar { display: none; }
.demo-label { font-size: 12px; color: #64748b; white-space: nowrap; align-self: center; }
.demo-chip { flex-shrink: 0; border: 1px solid #cbd5e1; background: #fff; color: #0f172a; font: 600 12.5px/1 inherit; font-family: inherit; padding: 8px 12px; border-radius: 20px; cursor: pointer; white-space: nowrap; transition: all .15s; }
.demo-chip:hover { border-color: #e15615; color: #e15615; }
.demo-chip[disabled] { opacity: .4; cursor: not-allowed; border-color: #cbd5e1; color: #0f172a; }
.demo-chip.vera { border-color: #fecaca; color: #b91c1c; }

/* ── portal.css : conteneur, mobile first ───────────────────────────────── */
.yachtsecure-portal-container { position: relative; width: 100%; height: calc(100vh - 52px); overflow: hidden; }
.ys-iframe-wrapper { position: absolute; inset: 0; overflow: hidden; background: #e2e8f0; }
.ys-chat-wrapper { display: none; }
/* ≥ 1200 px (largeur de la fenêtre du navigateur, comme portal-chat.js) */
.desk .yachtsecure-portal-container { display: flex; gap: 20px; }
.desk .ys-iframe-wrapper { position: relative; flex: 1; height: 100%; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.desk .ys-chat-wrapper { display: block; width: 30%; min-width: 300px; max-width: 450px; height: 100%; position: relative; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.1); overflow: hidden; background: #fff; }
.ys-powered-by { position: absolute; bottom: 12px; right: 31px; background: #f0f2f5; color: #1A3C6E; font-size: 11px; font-weight: 600; padding: 10px 14px; letter-spacing: .3px; z-index: 5; border-radius: 6px; min-height: 38px; display: flex; align-items: center; }

/* Chargement du portail */
.ys-iframe-loader { position: absolute; inset: 0; background: linear-gradient(135deg, #1A3C6E 0%, #102646 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 50; border-radius: 8px; transition: opacity .5s ease; }
.ys-iframe-loader.hidden { opacity: 0; pointer-events: none; }
.ys-loader-logo { font-size: 2.2rem; margin-bottom: 20px; animation: ys-pulse 2s ease-in-out infinite; }
.ys-loader-spinner { width: 44px; height: 44px; border: 4px solid rgba(255,255,255,.15); border-top-color: #e15615; border-radius: 50%; animation: ys-spin .85s linear infinite; margin-bottom: 22px; }
.ys-loader-text { color: #fff; font-size: .95rem; font-weight: 500; letter-spacing: .3px; margin-bottom: 6px; }
.ys-loader-subtext { color: rgba(255,255,255,.45); font-size: .75rem; letter-spacing: 1px; text-transform: uppercase; }
@keyframes ys-pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.08); opacity: .8; } }
@keyframes ys-spin { to { transform: rotate(360deg); } }

/* ── @n8n/chat (thème par défaut + surcharges de portal.css) ────────────── */
.n8n-chat { --p: #e15615; --dark: #101330; --light: #f2f4f8; font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 16px; }
.n8n-chat { height: 100%; }
.chat-layout { display: flex; flex-direction: column; height: 100%; background: var(--light); position: relative; }
.chat-header { background: var(--dark); color: var(--light); padding: 8px 15px; display: flex; flex-direction: row; align-items: baseline; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
.chat-header h1 { font-size: 1.1rem; margin: 0; line-height: 1.2; font-weight: 700; color: #fff; }
.chat-header p { font-size: .8rem; opacity: .9; margin: 0; line-height: 1.2; }
.chat-header .ys-chat-faq-btn { margin-left: auto; align-self: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(255,255,255,.7); background: transparent; color: #fff; font-size: 14px; font-weight: 700; line-height: 24px; text-align: center; cursor: pointer; padding: 0; }
.chat-header .ys-chat-faq-btn:hover, .ys-mode-switch:hover { background: rgba(255,255,255,.15); }
.ys-mode-switch { margin-left: auto; align-self: center; border: 1px solid rgba(255,255,255,.7); background: transparent; color: #fff; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; font-family: inherit; }
.ys-chat-faq-btn + .ys-mode-switch { margin-left: 8px; }
.chat-close-button { align-self: center; border: none; background: transparent; color: #fff; font-size: 18px; cursor: pointer; padding: 0 2px; margin-left: 8px; }
.n8n-chat.claim .chat-header { background: #dc2626; }

.ys-claim-subbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; background: #7f1d1d; border-bottom: 1px solid rgba(255,255,255,.15); color: #fff; font-size: 12px; flex-shrink: 0; animation: ysFadeIn .2s ease-in-out; gap: 8px; }
.ys-claim-subbar-label { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: #fecaca; }
.ys-claim-subbar-dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 6px #ef4444; animation: ysPulse 1.8s infinite; }
.ys-claim-cancel-btn { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.35); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; font-family: inherit; }
.ys-claim-cancel-btn:hover { background: #dc2626; border-color: #ef4444; }
.ys-claim-subbar--closed { background: #064e3b; }
.ys-claim-subbar--closed .ys-claim-subbar-label { color: #a7f3d0; }
.ys-claim-subbar-dot--closed { background: #10b981; box-shadow: 0 0 6px #10b981; animation: none; }
@keyframes ysPulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.85); } }
@keyframes ysFadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.chat-body { flex: 1; overflow-y: auto; position: relative; }
.chat-messages-list { display: flex; flex-direction: column; padding: 1rem; }
.chat-message { max-width: 80%; font-size: 1rem; line-height: 1.8; padding: 1rem; border-radius: .25rem; margin-bottom: .5rem; word-wrap: break-word; }
.chat-message + .chat-message { margin-top: .5rem; }
.chat-message-from-bot { align-self: flex-start; background: #fff; color: var(--dark); border-bottom-left-radius: 0; }
.chat-message-from-user { align-self: flex-end; background: var(--p); color: #fff; border-bottom-right-radius: 0; }
.chat-message-markdown p { margin: 0 0 .5rem; }
.chat-message-markdown p:last-child { margin-bottom: 0; }
.chat-message-markdown ul { margin: .25rem 0 .5rem; padding-left: 1.25rem; }
.chat-message-markdown strong { font-weight: bold; }
.chat-message a[href="#open-faq"], .chat-message a.ys-md-link { color: #e15615; font-weight: 600; text-decoration: underline; cursor: pointer; }
.ys-md-table { border-collapse: collapse; font-size: .85rem; line-height: 1.4; margin: .5rem 0; width: 100%; }
.ys-md-table th, .ys-md-table td { border: 1px solid #e2e8f0; padding: 6px 8px; text-align: left; }
.ys-md-table th { background: #f8fafc; }
.chat-message-typing { display: flex; gap: 4px; align-items: center; padding: 1.1rem 1rem; }
.chat-message-typing span { width: 8px; height: 8px; border-radius: 50%; background: #404040; animation: n8nTyping 1.2s infinite; opacity: .35; }
.chat-message-typing span:nth-child(2) { animation-delay: .2s; } .chat-message-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes n8nTyping { 0%,60%,100% { opacity: .35; } 30% { opacity: 1; } }

.chat-footer { padding: 10px 12px 12px; background: #fff; border-top: 1px solid #e5e7eb; flex-shrink: 0; }
.chat-inputs { display: flex; align-items: center; background: #fff; border: 1.5px solid rgba(225,86,21,.45); border-radius: 16px; padding: 2px 2px 2px 4px; box-shadow: 0 2px 10px rgba(15,23,42,.08); transition: border-color .15s, box-shadow .15s; }
.chat-inputs:focus-within { border-color: #e15615; box-shadow: 0 0 0 3px rgba(225,86,21,.15), 0 2px 10px rgba(15,23,42,.08); }
.chat-inputs textarea { flex: 1; border: none; outline: none; resize: none; min-height: 56px; max-height: 140px; padding: 16px 10px; font-size: 16px; font-family: inherit; background: transparent; color: #111827; line-height: 1.4; }
.chat-inputs textarea::placeholder { color: #6b7280; opacity: 1; }
.chat-inputs textarea:disabled { cursor: not-allowed; }
.chat-inputs-controls { display: flex; align-items: center; gap: 2px; }
.chat-input-file-button, .chat-input-mic-button, .chat-input-send-button { width: 38px; height: 38px; border: none; background: transparent; color: #e15615; cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 8px; transition: background .15s, color .15s; }
.chat-input-file-button, .chat-input-mic-button { color: #777980; }
.chat-input-file-button:hover, .chat-input-mic-button:hover { color: #e15615; background: rgba(225, 86, 21, 0.08); }
.chat-input-send-button:disabled { opacity: .35; cursor: default; }
.chat-input-file-button svg, .chat-input-mic-button svg, .chat-input-send-button svg { width: 22px; height: 22px; }

.ys-chat-disabled-overlay { position: absolute; inset: 0; background: rgba(255,255,255,.93); display: flex; align-items: center; justify-content: center; z-index: 10; border-radius: 8px; }
.ys-chat-disabled-msg { text-align: center; padding: 28px 24px; color: #1A3C6E; font-size: .95rem; line-height: 1.7; max-width: 300px; }
.ys-claim-closed-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 8px 12px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px; color: #065f46; font-size: 12px; line-height: 1.4; animation: ysFadeIn .3s ease; }
.ys-claim-closed-bar strong { color: #047857; }

/* Boutons de choix, sources, sélecteur (portal.css / portal-interceptors.js) */
.ys-qa-question-text { margin: 10px 0 10px; font-weight: 500; line-height: 1.4; }
.ys-qa-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; padding: 4px 0; }
.ys-qa-choice-btn { padding: 8px 18px; border: 2px solid #e15615; border-radius: 20px; background: transparent; color: #e15615; cursor: pointer; font-size: .88rem; font-weight: 500; font-family: inherit; transition: background .2s, color .2s; line-height: 1.3; }
.ys-qa-choice-btn:hover:not(:disabled) { background: #e15615; color: #fff; }
.ys-qa-choice-btn.selected { background: #e15615; color: #fff; cursor: default; }
.ys-qa-choice-btn:disabled:not(.selected) { opacity: .4; cursor: not-allowed; }
.ys-source-container { margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(225,86,21,.2); }
.ys-source-section-title { font-size: .82rem; font-weight: 700; color: #1A3C6E; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.ys-source-group-title { font-size: .85rem; color: #1A3C6E; margin-bottom: 8px; line-height: 1.3; }
.ys-source-btns-wrapper { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ys-source-btn { background: transparent; color: #e15615; border: 1px solid #e15615; border-radius: 16px; padding: 6px 12px; font-size: .8rem; font-weight: 500; cursor: pointer; font-family: inherit; }
.ys-source-btn:hover { background: #e15615; color: #fff; }

/* Bouton flottant et fenêtre (mode « window » de @n8n/chat, < 1200 px) */
.chat-window-wrapper { display: none; }
body:not(.desk) .chat-window-wrapper { display: block; position: fixed; right: 16px; bottom: 12px; z-index: 999; }
.chat-window-toggle { width: 64px; height: 64px; border-radius: 50%; border: none; background: #e15615; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(0,0,0,.2); margin-left: auto; transition: transform .15s, background .15s; position: relative; }
.chat-window-toggle:hover { transform: scale(1.05); background: #c94a12; }
.chat-window-toggle.ys-chat-open { background: #1A3C6E; }
.chat-window-toggle.ys-chat-open:hover { background: #2558A6; }
.claim-on .chat-window-toggle { background: #dc2626; }
.chat-window-toggle.is-disabled { filter: grayscale(.8) opacity(.55); cursor: not-allowed; }
.chat-window-toggle svg { width: 30px; height: 30px; }
.chat-window { display: none; width: min(400px, calc(100vw - 32px)); height: min(600px, calc(100vh - 150px)); margin-bottom: 12px; border-radius: .25rem; overflow: hidden; box-shadow: 0 4px 32px rgba(0,0,0,.16); background: #fff; }
.chat-window.open { display: block; animation: ysFadeIn .2s ease; }
.tab .chat-window { width: 90vw; height: calc(90vh - 130px); }
.ys-chat-disabled-toast { position: fixed; bottom: 90px; right: 20px; max-width: 280px; background: rgba(26,60,110,.95); color: #fff; padding: 14px 18px; border-radius: 12px; font-size: .88rem; line-height: 1.6; z-index: 9999; opacity: 0; transform: translateY(10px); transition: all .25s; pointer-events: none; }
.ys-chat-disabled-toast.visible { opacity: 1; transform: translateY(0); }

/* Guide FAQ, modale d'extrait, annulation (portal.css) */
.ys-faq-overlay, .ys-claim-modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.7); display: flex; align-items: center; justify-content: center; z-index: 99999; padding: 16px; animation: ysFadeIn .2s ease-out; }
.ys-faq-dialog { background: #fff; color: #111827; border-radius: 16px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 18px 18px 16px; box-shadow: 0 20px 50px rgba(0,0,0,.3); font-family: "Open Sans", system-ui, sans-serif; }
.ys-faq-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ys-faq-title { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; color: #1a3c6e; }
.ys-faq-x { border: 0; background: transparent; font-size: 24px; line-height: 1; color: #64748b; cursor: pointer; }
.ys-faq-privacy { display: flex; gap: 12px; padding: 10px 12px; margin-bottom: 10px; border-radius: 12px; background: rgba(26,39,85,.07); border: 1px solid rgba(26,39,85,.25); }
.ys-faq-privacy-title { font-size: 14px; font-weight: 700; color: #1a2755; }
.ys-faq-privacy-text, .ys-faq-card-desc { margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: #374151; }
.ys-faq-list { display: flex; flex-direction: column; gap: 8px; }
.ys-faq-card { display: flex; gap: 12px; padding: 10px 12px; border-radius: 12px; background: #f4f5f8; border: 1px solid rgba(0,0,0,.06); }
.ys-faq-card--soon { opacity: .75; }
.ys-faq-icon, .ys-faq-privacy-icon { font-size: 18px; line-height: 1.3; }
.ys-faq-card-title { font-size: 14px; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ys-faq-badge-soon { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: rgba(26,60,110,.1); color: #1a3c6e; }
.ys-faq-tip { margin: 12px 0 0; font-size: 12px; font-style: italic; color: #64748b; text-align: center; }
.ys-faq-close { display: block; width: 100%; margin-top: 12px; padding: 11px; border: 0; border-radius: 10px; background: #1a3c6e; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.ys-source-modal { background: #fff; border-radius: 14px; width: 92vw; max-width: 720px; max-height: 82vh; display: flex; flex-direction: column; box-shadow: 0 12px 48px rgba(0,0,0,.25); overflow: hidden; }
.ys-source-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid #e8e8e8; background: #f8f9fa; }
.ys-source-modal-title { font-size: 1rem; font-weight: 700; color: #1A3C6E; margin: 0; }
.ys-source-modal-close { background: none; border: none; font-size: 1.6rem; color: #888; cursor: pointer; }
.ys-source-modal-body { padding: 24px; overflow-y: auto; font-size: .92rem; line-height: 1.7; color: #333; }
.ys-source-modal-body h3 { color: #1A3C6E; font-size: 1.05rem; margin: 12px 0 6px; }
.ys-source-modal-body strong { color: #1A3C6E; }
.ys-claim-modal-dialog { background: #fff; border-radius: 16px; max-width: 420px; width: 100%; padding: 24px; text-align: center; box-shadow: 0 20px 25px -5px rgba(0,0,0,.2); }
.ys-claim-modal-icon { font-size: 36px; margin-bottom: 12px; }
.ys-claim-modal-title { font-size: 18px; font-weight: 700; color: #0f172a; margin: 0 0 8px; }
.ys-claim-modal-body { font-size: 13px; line-height: 1.5; color: #64748b; margin: 0 0 20px; }
.ys-claim-modal-actions { display: flex; gap: 10px; }
.ys-claim-modal-btn { flex: 1; padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; font-family: inherit; }
.ys-claim-modal-btn-keep { background: #f1f5f9; color: #475569; }
.ys-claim-modal-btn-confirm { background: #dc2626; color: #fff; }
