/*
  Page « Discuter avec Lyndia » (ADR 0067) : le descriptif de la fonctionnalité
  à gauche, la conversation façon messagerie web à droite, dans un cadre. Les
  neutres et les bulles reprennent les codes d'une messagerie ; l'orange LyndIA
  sert d'accent.
*/
.wa-page {
    --wa-panel: #ffffff;
    --wa-bar: #f0f2f5;
    --wa-line: #e9edef;
    --wa-text: #111b21;
    --wa-muted: #667781;
    --wa-wallpaper: #efeae2;
    --wa-in: #ffffff;
    --wa-out: #d9fdd3;
    --wa-notice: #ffeecd;
    --wa-read: #53bdeb;
    --wa-accent: var(--color-brand, #f5811e);
    --wa-accent-deep: var(--color-brand-deep, #d45e12);

    /* Sous la barre de menus flottante du site, fixe : elle descend jusqu'à 96 px environ. */
    box-sizing: border-box;
    min-height: 100dvh;
    margin: 0;
    padding: 112px 32px 32px;
    max-width: none;
    background: radial-gradient(ellipse 55% 60% at 80% 40%, #f6e4cc, transparent 70%), #faf7f0;
    color: var(--wa-text);
    font-family: var(--font-sans, system-ui, sans-serif);
}

.wa-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 600px);
    gap: 56px;
    align-items: center;
    max-width: 1180px;
    min-height: calc(100dvh - 144px);
    margin: 0 auto;
}

/* Le descriptif de la fonctionnalité. */
.wa-intro { color: var(--color-ink, #262626); }

.wa-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgb(245 129 30 / 12%);
    color: var(--wa-accent-deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.wa-eyebrow svg { width: 15px; height: 15px; }

.wa-intro h1 {
    margin: 0 0 18px;
    font-family: var(--font-display, Georgia, serif);
    font-size: clamp(30px, 3.2vw, 46px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -.02em;
}
.wa-intro h1 em { display: block; color: var(--wa-accent); font-style: italic; }

.wa-intro-lead {
    max-width: 480px;
    margin: 0 0 26px;
    color: var(--color-ink-soft, #6e6a63);
    font-size: 16px;
    line-height: 1.7;
}

.wa-points { display: grid; gap: 16px; margin: 0 0 28px; padding: 0; list-style: none; }
.wa-points li { display: flex; gap: 14px; max-width: 480px; color: var(--color-ink-soft, #6e6a63); font-size: 14px; line-height: 1.6; }
.wa-points strong { color: var(--color-ink, #262626); }

.wa-point-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 12px;
    background: #fff;
    color: var(--wa-accent);
    box-shadow: 0 4px 14px rgb(35 32 28 / 7%);
}
.wa-point-icon svg { width: 19px; height: 19px; }

.wa-app-teaser {
    max-width: 480px;
    padding: 18px 20px;
    border: 1px solid rgb(38 38 38 / 8%);
    border-radius: 18px;
    background: rgb(255 255 255 / 70%);
}
.wa-app-teaser p { margin: 0 0 10px; color: var(--color-ink-soft, #6e6a63); font-size: 14px; line-height: 1.6; }
.wa-app-teaser strong { color: var(--color-ink, #262626); }
.wa-app-teaser a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--wa-accent-deep);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
.wa-app-teaser a:hover { color: var(--wa-accent); }
.wa-app-teaser svg { width: 16px; height: 16px; }

/* Page « Coach » : l'inscription est l'action principale, et l'avertissement suit. */
.wa-app-teaser a.wa-intro-cta {
    margin-top: 4px;
    padding: 11px 18px;
    border-radius: 999px;
    background: var(--wa-accent);
    color: #fff;
}
.wa-app-teaser a.wa-intro-cta:hover { background: var(--wa-accent-deep); color: #fff; }
.wa-disclaimer {
    max-width: 480px;
    margin: 18px 0 0;
    color: var(--color-ink-soft, #6e6a63);
    font-size: 12px;
    line-height: 1.5;
}

/* Le cadre de la conversation : une bordure épaisse et arrondie, façon écran. */
.wa-frame {
    height: max(560px, calc(100dvh - 144px));
    padding: 10px;
    border: 1px solid rgb(38 38 38 / 10%);
    border-radius: 32px;
    background: #fff;
    box-shadow: 0 30px 70px -20px rgb(63 39 10 / 28%), 0 2px 6px rgb(35 32 28 / 6%);
}

.wa-app {
    display: flex;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--wa-line);
    border-radius: 22px;
    background: var(--wa-panel);
}

/* Barre d'en-tête du fil. */
.wa-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 59px;
    padding: 10px 16px;
    background: var(--wa-bar);
}

.wa-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
}

/* Le fil. */
.wa-chat-pane {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.wa-chat-pane .wa-bar { border-bottom: 1px solid var(--wa-line); }

.wa-contact { flex: 1; min-width: 0; }
.wa-contact h2 {
    margin: 0;
    color: var(--wa-text);
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0;
}
.wa-contact p { margin: 0; color: var(--wa-muted); font-size: 13px; }

.wa-counter {
    flex-shrink: 0;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgb(245 129 30 / 12%);
    color: var(--wa-accent-deep);
    font-size: 12px;
    font-weight: 600;
}

.wa-wallpaper {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background-color: var(--wa-wallpaper);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%23000' stroke-opacity='.06' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M30 38c-8 0-13 7-13 15s6 18 13 18c3 0 4-2 7-2s4 2 7 2c7 0 13-10 13-18s-5-15-13-15c-3 0-5 2-7 2s-4-2-7-2Z'/%3E%3Cpath d='M37 36c0-5 3-9 8-10'/%3E%3Cpath d='M112 22c12 0 20 8 20 20-12 0-20-8-20-20Z'/%3E%3Cpath d='M112 22l20 20'/%3E%3Cpath d='M98 104h30l-4 30h-22Z'/%3E%3Cpath d='M128 110h6a5 5 0 0 1 0 10h-8'/%3E%3Ccircle cx='40' cy='122' r='14'/%3E%3Cpath d='M30 112l20 20M50 112l-20 20'/%3E%3Cpath d='M78 70l4 8 9 1-7 6 2 9-8-5-8 5 2-9-7-6 9-1Z'/%3E%3C/g%3E%3C/svg%3E");
}

.wa-log {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 920px;
    min-height: 100%;
    margin: 0 auto;
    padding: 20px 6% 12px;
}

.wa-day, .wa-notice {
    align-self: center;
    margin: 6px 0 10px;
    text-align: center;
}

.wa-day span {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 7.5px;
    background: #fff;
    color: var(--wa-muted);
    font-size: 12.5px;
    box-shadow: 0 1px .5px rgb(11 20 26 / 13%);
}

.wa-notice {
    display: flex;
    gap: 6px;
    max-width: 480px;
    padding: 6px 12px;
    border-radius: 7.5px;
    background: var(--wa-notice);
    color: #54656f;
    font-size: 12.5px;
    line-height: 1.45;
    box-shadow: 0 1px .5px rgb(11 20 26 / 13%);
}
.wa-notice svg { width: 12px; height: 12px; flex-shrink: 0; margin-top: 3px; }
.wa-notice--error { background: #fde4e2; color: #a63a32; }

.wa-row { display: flex; }
.wa-row--out { justify-content: flex-end; }
.wa-row + .wa-row[data-side]:not(:has(.wa-msg--tail)) { margin-top: 0; }
.wa-row:has(.wa-msg--tail) { margin-top: 10px; }

.wa-msg {
    position: relative;
    max-width: min(65%, 560px);
    padding: 6px 7px 8px 9px;
    border-radius: 7.5px;
    font-size: 14.2px;
    line-height: 1.45;
    box-shadow: 0 1px .5px rgb(11 20 26 / 13%);
}
.wa-msg--in { background: var(--wa-in); }
.wa-msg--out { background: var(--wa-out); }

/* La pointe de bulle, sur le premier message d'une série. */
.wa-msg--tail.wa-msg--in { border-top-left-radius: 0; }
.wa-msg--tail.wa-msg--out { border-top-right-radius: 0; }
.wa-msg--tail::before {
    content: '';
    position: absolute;
    top: 0;
    width: 8px;
    height: 13px;
    background: inherit;
}
.wa-msg--tail.wa-msg--in::before { left: -8px; clip-path: polygon(100% 0, 0 0, 100% 100%); }
.wa-msg--tail.wa-msg--out::before { right: -8px; clip-path: polygon(0 0, 100% 0, 0 100%); }

.wa-text { white-space: pre-line; overflow-wrap: anywhere; }

/* L'heure flotte en bas à droite, et réserve sa place en fin de dernière ligne. */
.wa-meta {
    float: right;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin: 8px 0 -5px 10px;
    color: var(--wa-muted);
    font-size: 11px;
    line-height: 15px;
}
.wa-ticks { width: 16px; height: 11px; color: #8696a0; }
.wa-msg--read .wa-ticks { color: var(--wa-read); }

.wa-typing { display: flex; gap: 4px; padding: 13px 14px; }
.wa-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8696a0;
    animation: wa-typing 1.2s infinite ease-in-out;
}
.wa-typing span:nth-child(2) { animation-delay: .15s; }
.wa-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes wa-typing {
    0%, 60%, 100% { opacity: .35; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

/* Barre de saisie. */
.wa-composer, .wa-ending {
    border-top: 1px solid var(--wa-line);
    background: var(--wa-bar);
}
.wa-composer[hidden], .wa-ending[hidden] { display: none; }

.wa-form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 9px 16px;
}

.wa-form textarea {
    flex: 1;
    min-height: 42px;
    max-height: 132px;
    padding: 10px 14px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: var(--wa-text);
    font: inherit;
    font-size: 15px;
    line-height: 22px;
    resize: none;
    outline: none;
}
.wa-form textarea::placeholder { color: var(--wa-muted); }
.wa-form textarea:focus-visible { box-shadow: 0 0 0 2px rgb(245 129 30 / 35%); }

.wa-send {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: var(--wa-accent);
    color: #fff;
    cursor: pointer;
    transition: background-color .15s, opacity .15s;
}
.wa-send:hover { background: var(--wa-accent-deep); }
.wa-send:disabled { opacity: .45; cursor: default; }
.wa-send svg { width: 19px; height: 19px; }

/* Fin de l'essai : la barre de saisie laisse la place à l'invitation vers l'app. */
.wa-ending {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 16px;
    text-align: center;
}
.wa-ending p { margin: 0; color: #54656f; font-size: 14px; }

.wa-ending-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 999px;
    background: var(--wa-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .15s;
}
.wa-ending-cta:hover { background: var(--wa-accent-deep); color: #fff; }
.wa-ending-cta svg { width: 17px; height: 17px; }

/* Écran moyen : le descriptif passe au-dessus de la conversation. */
@media (max-width: 1023px) {
    .wa-layout { grid-template-columns: 1fr; gap: 28px; min-height: 0; max-width: 680px; }
    .wa-intro h1 em { display: inline; }
    .wa-frame { height: min(720px, calc(100dvh - 96px)); min-height: 520px; }
}

/* Téléphone. */
@media (max-width: 767px) {
    .wa-page { padding: 76px 12px 16px; }
    .wa-points li:nth-child(n+2), .wa-app-teaser, .wa-disclaimer { display: none; }
    .wa-intro-lead { margin-bottom: 16px; font-size: 15px; }
    .wa-points { margin-bottom: 0; }
    .wa-frame { padding: 6px; border-radius: 26px; height: calc(100dvh - 72px); }
    .wa-app { border-radius: 20px; }
    .wa-bar { gap: 10px; padding: 8px 12px; }
    .wa-counter { padding: 4px 8px; font-size: 11px; }
    .wa-log { padding: 14px 4% 10px; }
    .wa-msg { max-width: 85%; }
    .wa-form { padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .wa-typing span { animation: none; opacity: .6; }
}
