/* SupEasy Chat — design d'après l'identité supeasy.fr */
:root {
  --brand: #007bff;
  --brand-dark: #0a58ca;
  --navy: #003388;
  --accent: #ffb606;
  --bg: #f5f8fc;
  --card: #ffffff;
  --text: #1e2a3a;
  --muted: #64748b;
  --border: #dde5ef;
  --ok: #2ecc71;
  --err: #e74c3c;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(0, 51, 136, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  background: var(--card);
  border-bottom: 3px solid var(--brand);
  box-shadow: var(--shadow);
}
.header-inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand img { height: 46px; width: auto; }
.brand-title {
  font-family: "Comic Sans MS", "Segoe Print", cursive;
  font-size: 1.8rem; color: var(--brand); font-weight: 700; letter-spacing: 1px;
}
.brand-tagline { font-size: 0.68rem; color: #9aa7b8; text-transform: uppercase; letter-spacing: 2px; }
.main-nav { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.main-nav a {
  padding: 8px 14px; border-radius: 8px; color: var(--navy); font-weight: 600; font-size: 0.95rem;
}
.main-nav a:hover { background: #eaf2ff; text-decoration: none; }
.main-nav a.cta {
  background: var(--brand); color: #fff;
}
.main-nav a.cta:hover { background: var(--brand-dark); }
.main-nav a.premium-badge { background: var(--accent); color: #4a3200; }

/* ---------- Layout ---------- */
.page { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 24px 16px; }
.page-narrow { max-width: 460px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px;
}
h1 { color: var(--navy); }
.subtitle { color: var(--muted); margin-top: -8px; }

/* ---------- Hero / capacités ---------- */
.hero { text-align: center; padding: 28px 12px 8px; }
.hero h1 { font-size: 1.9rem; margin: 0 0 8px; }
.hero h1 .ia { color: var(--brand); }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto; }
.caps {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px; margin: 22px 0;
}
.cap {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; text-align: left; cursor: pointer; transition: box-shadow .15s, transform .15s;
  font: inherit;
}
.cap:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.cap .cap-emoji { font-size: 1.4rem; }
.cap .cap-title { font-weight: 700; color: var(--navy); margin: 6px 0 4px; font-size: 0.95rem; }
.cap .cap-desc { color: var(--muted); font-size: 0.85rem; line-height: 1.35; }

/* ---------- Chat ---------- */
.chat-wrap { display: flex; flex-direction: column; gap: 0; }
.chat-box {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
}
.chat-messages {
  padding: 20px; overflow-y: auto; max-height: 60vh; min-height: 120px;
  display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth;
}
.msg { max-width: 85%; padding: 12px 16px; border-radius: 16px; line-height: 1.5; font-size: 0.97rem; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: #eef4fb; border-bottom-left-radius: 4px; }
.msg.bot table { border-collapse: collapse; margin: 8px 0; font-size: 0.88rem; display: block; overflow-x: auto; max-width: 100%; }
.msg.bot th, .msg.bot td { border: 1px solid #c8d6e8; padding: 4px 8px; text-align: left; }
.msg.bot th { background: #dcE9f7; }
.msg.bot ul, .msg.bot ol { margin: 6px 0; padding-left: 22px; }
.msg.bot p { margin: 6px 0; }
.msg .tool-note { color: var(--muted); font-size: 0.8rem; font-style: italic; }

/* Étapes de recherche : discrètes, mais elles restent dans la conversation. */
.msg.step {
  align-self: flex-start; max-width: 92%; background: none; padding: 2px 0 2px 12px;
  border-left: 3px solid #d6e2f2; border-radius: 0; color: var(--muted); font-size: 0.87rem;
}
.msg.step .step-text p { margin: 2px 0; }
.msg.step .step-text { line-height: 1.45; }
.msg.step .step-tools { margin-top: 3px; font-size: 0.8rem; color: #8b9bb0; }
.msg.step .step-tools span { color: var(--brand); }
.typing { color: var(--muted); font-size: 0.85rem; padding: 0 20px 8px; display: none; }
.chat-input-row {
  display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--border); background: #fbfdff;
}
.chat-input-row textarea {
  flex: 1; resize: none; border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px;
  font: inherit; font-size: 0.97rem; min-height: 46px; max-height: 140px; outline: none;
}
.chat-input-row textarea:focus { border-color: var(--brand); }
.btn {
  background: var(--brand); color: #fff; border: none; border-radius: 10px; padding: 11px 22px;
  font-size: 1rem; font-weight: 600; cursor: pointer; transition: background .15s;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { background: #9dbfe8; cursor: not-allowed; }
.btn.secondary { background: #eef4fb; color: var(--navy); }
.btn.secondary:hover { background: #dcE9f7; }
.btn.accent { background: var(--accent); color: #4a3200; }
.btn.accent:hover { background: #e6a300; }
.btn.danger { background: var(--err); }
.btn.danger:hover { background: #c0392b; }
.quota-note { text-align: center; color: var(--muted); font-size: 0.83rem; padding: 8px; }
.quota-note a { font-weight: 600; }

/* ---------- Formulaires ---------- */
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--navy); font-size: 0.92rem; }
.form-field input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px;
  font: inherit; font-size: 0.97rem; outline: none;
}
.form-field input:focus { border-color: var(--brand); }
.form-actions { margin-top: 20px; }
.form-actions .btn { width: 100%; }
.form-links { margin-top: 16px; text-align: center; font-size: 0.9rem; color: var(--muted); }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 0.93rem; display: none; }
.alert.error { background: #fdeceb; color: #b03a2e; border: 1px solid #f5c6c2; display: block; }
.alert.success { background: #e8f8f0; color: #1e8449; border: 1px solid #bfe8d2; display: block; }

/* ---------- Abonnement ---------- */
.price-card { text-align: center; }
.price { font-size: 2.6rem; color: var(--navy); font-weight: 800; margin: 8px 0 0; }
.price small { font-size: 1rem; color: var(--muted); font-weight: 400; }
.features { list-style: none; padding: 0; margin: 20px auto; max-width: 420px; text-align: left; }
.features li { padding: 7px 0 7px 30px; position: relative; }
.features li::before { content: "✓"; position: absolute; left: 4px; color: var(--ok); font-weight: 800; }
.pay-buttons { display: flex; flex-direction: column; gap: 12px; max-width: 340px; margin: 18px auto 0; }

/* ---------- Compte ---------- */
.account-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.badge { display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: 0.83rem; font-weight: 700; }
.badge.premium { background: var(--accent); color: #4a3200; }
.badge.free { background: #e6edf5; color: var(--muted); }

/* ---------- Écran d'abonnement (paywall) ---------- */
.paywall-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 24, 66, 0.62); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 16px; overflow-y: auto;
  animation: pw-fade .22s ease-out;
}
.paywall-overlay[hidden] { display: none; }
@keyframes pw-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pw-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.paywall-card {
  background: var(--card); border-radius: 20px; max-width: 620px; width: 100%;
  margin: auto; padding: 0; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 24, 66, 0.32);
  animation: pw-rise .28s cubic-bezier(.2, .8, .3, 1) both;
}
.paywall-head {
  background: linear-gradient(135deg, var(--navy), var(--brand));
  color: #fff; padding: 26px 30px 22px; text-align: center;
}
.paywall-eyebrow {
  display: inline-block; background: rgba(255, 255, 255, .18); color: #fff;
  padding: 4px 14px; border-radius: 20px; font-size: .78rem; font-weight: 700;
  letter-spacing: .4px; text-transform: uppercase; margin-bottom: 12px;
}
.paywall-head h2 { margin: 0; font-size: 1.55rem; line-height: 1.25; color: #fff; }
.paywall-body { padding: 24px 30px 28px; }
.paywall-lead { margin: 0 0 14px; line-height: 1.6; color: var(--text); }
.paywall-quotes {
  margin: 0 0 18px; padding: 14px 16px; border-left: 3px solid var(--accent);
  background: #fffaf0; border-radius: 0 10px 10px 0;
  color: var(--muted); font-size: .93rem; line-height: 1.65; font-style: italic;
}
.paywall-body .features { margin: 0 0 20px; max-width: none; }
.paywall-body .features li { font-size: .95rem; line-height: 1.45; }
.paywall-price {
  text-align: center; background: #f2f7fd; border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin-bottom: 20px;
}
.paywall-price .price { margin: 0; font-size: 2.2rem; }
.paywall-price .price-sub { color: var(--muted); font-size: .88rem; margin: 4px 0 0; }
.paywall-actions { display: flex; flex-direction: column; gap: 10px; }
.paywall-actions .btn { width: 100%; text-align: center; text-decoration: none; display: block; }
.paywall-actions .btn:hover { text-decoration: none; }
.paywall-reassure {
  margin: 16px 0 0; text-align: center; color: var(--muted);
  font-size: .82rem; line-height: 1.5;
}
.paywall-dismiss {
  display: block; width: 100%; margin-top: 14px; background: none; border: none;
  color: var(--muted); font: inherit; font-size: .86rem; cursor: pointer;
  text-decoration: underline; padding: 4px;
}
.paywall-dismiss:hover { color: var(--navy); }

@media (max-width: 640px) {
  .paywall-head { padding: 22px 20px 18px; }
  .paywall-head h2 { font-size: 1.25rem; }
  .paywall-body { padding: 20px 20px 24px; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy); color: #cdd9ec; margin-top: 36px; padding: 22px 16px; font-size: 0.85rem;
}
.footer-inner { max-width: 1080px; margin: 0 auto; display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.site-footer a { color: #fff; }

@media (max-width: 640px) {
  .brand img { height: 38px; }
  .hero h1 { font-size: 1.4rem; }
  .msg { max-width: 95%; }
  .chat-messages { max-height: 55vh; }
}
