/* ClinicalWriterAI — thème « Chaleur humaine » (crème + sauge + corail) */
:root {
  --sage: #7A9B76;
  --sage-dark: #5C7A58;
  --sage-deep: #3E4A3D;
  --coral: #E2795B;
  --coral-dark: #B85A3F;
  --ink: #403F38;
  --muted: #8C8677;
  --bg: #FBF7F0;
  --card: #FFFDF9;
  --line: #E8DFD0;
  --success-bg: #EFF5EC; --success-line: #CFE0CB; --success-ink: #47603F;
  --info-bg: #FAF3E4; --info-line: #EBD9B4;
  --error-bg: #F9ECE7; --error-line: #EFC7B8; --error-ink: #A6472C;
  --tip-bg: #F7F3E8; --tip-line: #E9DFC8;
  --radius: 18px;
  --shadow: 0 6px 22px rgba(94, 82, 60, 0.09);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Nunito Sans', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(circle at 12% 18%, rgba(122,155,118,0.08), transparent 42%), radial-gradient(circle at 88% 8%, rgba(226,121,91,0.07), transparent 40%);
  line-height: 1.6;
}
h1, h2, h3, .brand span { font-family: 'Fraunces', Georgia, serif; color: var(--sage-deep); }
h2 { font-size: 1.12rem; margin: 0 0 .6rem; font-weight: 600; }
a { color: var(--sage-dark); }

.topbar { background: rgba(255,253,249,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: .7rem 1.2rem; }
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; font-weight: 600; }
.brand span { font-size: 1.05rem; }
.nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem; }
.nav a.active, .nav a:hover { color: var(--sage-dark); }
.nav-user { color: var(--coral-dark); font-weight: 700; font-size: .9rem; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 1.4rem 1.2rem 3rem; }

.hero { text-align: center; padding: 1.8rem 0 .9rem; }
.hero-icon svg { width: 56px; height: 56px; filter: drop-shadow(0 6px 14px rgba(122,155,118,.35)); }
.hero h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); margin: .4rem 0 .3rem; color: var(--sage-deep); font-weight: 600; letter-spacing: -.01em; }
.hero-sub { color: var(--muted); max-width: 640px; margin: 0 auto .9rem; font-size: 1.02rem; }
.pill { display: inline-block; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .5rem 1.15rem; font-size: .9rem; color: var(--coral-dark); box-shadow: var(--shadow); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.15rem 1.3rem; margin: 1rem 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: .5rem; }
.card-head h1, .card-head h2 { margin: 0; }
.subhead { margin: 1rem 0 .5rem; font-size: .98rem; }

.alert { border-radius: var(--radius); padding: .85rem 1.15rem; margin: 1rem 0; border: 1px solid; font-size: .95rem; }
.alert-success { background: var(--success-bg); border-color: var(--success-line); color: var(--success-ink); }
.alert-info { background: var(--info-bg); border-color: var(--info-line); }
.alert-error { background: var(--error-bg); border-color: var(--error-line); color: var(--error-ink); }
.alert-tip { background: var(--tip-bg); border-color: var(--tip-line); font-size: .88rem; }
.banner-flex { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: none; border-radius: 999px; padding: .62rem 1.35rem; font: 700 .92rem 'Nunito Sans', sans-serif; cursor: pointer; text-decoration: none; transition: transform .12s ease, box-shadow .12s ease, background .12s, opacity .12s; }
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid rgba(122,155,118,.45); outline-offset: 2px; }
.btn-primary { background: var(--sage); color: #FFFDF9; box-shadow: 0 4px 14px rgba(122,155,118,.35); }
.btn-primary:hover { background: var(--sage-dark); }
.btn-teal { background: var(--card); color: var(--sage-dark); border: 1.5px solid var(--sage); }
.btn-teal:hover { background: #F2F6EF; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn-ghost:hover { background: #F7F2E8; }
.btn-voice { background: var(--coral); color: #FFFDF9; box-shadow: 0 4px 14px rgba(226,121,91,.35); }
.btn-voice:hover { background: var(--coral-dark); }
.btn-voice.recording { background: #C94F42; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(201,79,66,.16); } }
.btn-rewrite { background: var(--sage); color: #FFFDF9; font-size: 1.05rem; padding: .9rem 1.3rem; box-shadow: 0 6px 18px rgba(122,155,118,.4); }
.btn-rewrite:hover { background: var(--sage-dark); }
.btn-sm { padding: .42rem .95rem; font-size: .85rem; }
.btn-block { width: 100%; margin-top: .8rem; }
.btn[disabled] { opacity: .55; cursor: wait; transform: none; }

label { display: block; font-weight: 700; font-size: .88rem; margin: .7rem 0; color: var(--ink); }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; margin-top: .3rem; padding: .68rem .85rem; border: 1px solid var(--line); border-radius: 12px;
  font: 400 .96rem 'Nunito Sans', sans-serif; color: var(--ink); background: #FFFEFB;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px rgba(122,155,118,.18); }
textarea { resize: vertical; }
#inputText { min-height: 240px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.workspace { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }

.format-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
.format-option { display: flex; gap: .6rem; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 14px; padding: .85rem; margin: 0; cursor: pointer; background: #FFFEFB; transition: border-color .12s, background .12s; }
.format-option:has(input:checked) { border-color: var(--sage); background: #F2F6EF; }
.format-option input { margin-top: .25rem; accent-color: var(--sage-dark); }
.format-option span { display: block; font-weight: 400; }
.format-option strong { display: block; font-size: .93rem; color: var(--sage-deep); }
.format-option small { color: var(--muted); font-size: .8rem; line-height: 1.4; display: block; }
.format-option em { color: var(--coral-dark); font-size: .78rem; font-style: normal; font-weight: 700; }
.format-custom { border-style: dashed; }

.output-box { min-height: 300px; border: 1px solid var(--line); border-radius: 14px; padding: .95rem 1.05rem; background: linear-gradient(165deg, #FFFEFB, #FBF6EC); white-space: pre-wrap; font-size: .96rem; }

.count { display: inline-block; background: #F6E9DF; color: var(--coral-dark); border-radius: 999px; padding: .05rem .6rem; font-size: .8rem; vertical-align: middle; }
.tag { display: inline-block; background: #EFF5EC; color: var(--sage-dark); border: 1px solid #D5E3D1; border-radius: 999px; padding: .12rem .62rem; font-size: .78rem; font-weight: 700; }

.history-item { border-top: 1px solid var(--line); padding: .4rem 0; }
.history-item summary { display: flex; gap: .7rem; align-items: center; cursor: pointer; padding: .35rem 0; list-style: none; }
.history-item summary::-webkit-details-marker { display: none; }
.history-snippet { flex: 1; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-date { font-size: .78rem; white-space: nowrap; }
.history-body h4, .history-card h4 { margin: .8rem 0 .2rem; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-family: 'Nunito Sans', sans-serif; }
pre { white-space: pre-wrap; word-wrap: break-word; background: #FAF6EC; border: 1px solid var(--line); border-radius: 12px; padding: .75rem .95rem; font: .89rem/1.55 'Nunito Sans', sans-serif; margin: 0; }
.tpl-instructions { font-size: .85rem; }

.auth-card { max-width: 440px; margin: 3rem auto; }
.auth-head { text-align: center; margin-bottom: .6rem; }
.auth-head svg { width: 44px; height: 44px; }
.auth-head h1 { font-size: 1.5rem; margin: .3rem 0 .2rem; }
.auth-alt { text-align: center; font-size: .9rem; color: var(--muted); }
.muted { color: var(--muted); }
.page-title { font-size: 1.65rem; margin: .6rem 0; }

.pagination { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1rem 0; }
.pagination a { padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); text-decoration: none; font-size: .88rem; color: var(--ink); }
.pagination a.active { background: var(--sage); color: #FFFDF9; border-color: var(--sage); }

.footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 1.5rem 1rem 2.5rem; }
.footer-links { margin-bottom: .5rem; font-size: .9rem; }
.footer-links a { color: var(--sage-dark); text-decoration: none; margin: 0 .3rem; font-weight: 600; }
.footer-links a:hover { text-decoration: underline; }

.static-page { max-width: 820px; margin: 0 auto; }
.static-page .card h2 { color: var(--sage-deep); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:last-of-type { border-bottom: none; }
.faq-item summary { cursor: pointer; font-weight: 700; padding: .85rem .2rem; list-style: none; position: relative; padding-right: 2rem; color: var(--sage-deep); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; position: absolute; right: .4rem; top: .7rem; font-size: 1.2rem; color: var(--coral); font-weight: 700; }
.faq-item[open] summary::after { content: '\2013'; }
.faq-item p { margin: 0 .2rem 1rem; color: var(--ink); }

@media (max-width: 840px) {
  .workspace, .grid-2 { grid-template-columns: 1fr; }
  .topbar-inner { flex-direction: column; gap: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .btn-voice.recording { transition: none; animation: none; }
}

/* ---- Mouvement : entrée de page, révélation au défilement, résultat ---- */
@keyframes floatDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes softGrow { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }

.hero-icon { animation: floatDown .7s cubic-bezier(.22,1,.36,1) both; }
.hero h1 { animation: riseIn .7s cubic-bezier(.22,1,.36,1) .12s both; }
.hero-sub { animation: riseIn .7s cubic-bezier(.22,1,.36,1) .22s both; }
.hero .pill { animation: riseIn .7s cubic-bezier(.22,1,.36,1) .32s both; }

.js-reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s cubic-bezier(.22,1,.36,1), transform .6s cubic-bezier(.22,1,.36,1); }
.js-reveal.is-visible { opacity: 1; transform: translateY(0); }

.output-box.reveal { animation: softGrow .5s cubic-bezier(.22,1,.36,1) both; }

.faq-item summary::after { transition: transform .25s ease, color .25s ease; }
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-item p { animation: riseIn .35s ease both; }

.format-option { transition: border-color .15s, background .15s, transform .15s; }
.format-option:hover { transform: translateY(-2px); }
.brand svg { transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
.brand:hover svg { transform: rotate(-8deg) scale(1.08); }

@media (prefers-reduced-motion: reduce) {
  .hero-icon, .hero h1, .hero-sub, .hero .pill, .output-box.reveal, .faq-item p { animation: none; }
  .js-reveal { opacity: 1; transform: none; transition: none; }
  .format-option, .brand svg { transition: none; }
}

/* ---- Page d'accueil vitrine ---- */
.landing-hero { padding: 2.6rem 0 1.4rem; }
.landing-hero h1 { line-height: 1.12; }
.hero-cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin: 1.1rem 0; }
.landing-section { padding: 1.6rem 0 .4rem; }
.landing-title { font-size: clamp(1.4rem, 3vw, 1.9rem); text-align: center; margin: 0 0 1.1rem; }
.landing-lead { text-align: center; color: var(--muted); max-width: 620px; margin: -0.4rem auto 1.2rem; }
.landing-note { text-align: center; font-size: .88rem; margin-top: .8rem; }
.landing-final { text-align: center; padding-bottom: 2rem; }

.demo-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: stretch; }
.demo-card { margin: 0; }
.demo-label { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .5rem; }
.demo-text { margin: 0; font-size: .95rem; line-height: 1.65; }
.demo-result { border: 1.5px solid var(--sage); background: #FDFEFB; }
.demo-result .demo-label { color: var(--sage-dark); }
.demo-arrow { align-self: center; font-size: 2rem; color: var(--coral); font-weight: 700; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.feature { margin: 0; text-align: left; }
.feature-icon { font-size: 1.7rem; display: block; margin-bottom: .3rem; }
.feature h3 { font-size: 1.02rem; margin: 0 0 .3rem; }
.feature p { margin: 0; font-size: .92rem; color: var(--muted); }

.quotes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.quote { margin: 0; display: flex; flex-direction: column; }
.quote-text { font-family: 'Fraunces', Georgia, serif; font-size: 1.02rem; color: var(--sage-deep); margin: 0 0 .8rem; flex: 1; line-height: 1.55; }
.quote-who { margin: 0; font-size: .88rem; font-weight: 700; border-top: 1px solid var(--line); padding-top: .7rem; }

.trust-card { background: #F5F1E6; }
.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; }
.trust-grid strong { display: block; margin-bottom: .3rem; color: var(--sage-deep); }
.trust-grid p { margin: 0; font-size: .92rem; color: var(--ink); }

@media (max-width: 840px) {
  .demo-grid { grid-template-columns: 1fr; }
  .demo-arrow { transform: rotate(90deg); justify-self: center; }
}

/* ---- Sélecteur de langue de la vitrine ---- */
.lang-toggle { text-align: right; padding-top: .6rem; font-size: .9rem; }
.lang-toggle a { text-decoration: none; color: var(--muted); font-weight: 700; padding: .2rem .45rem; border-radius: 8px; }
.lang-toggle a.active { color: #FFFDF9; background: var(--sage); }
.lang-toggle span { color: var(--line); }
