/* ===================================================================
   TikScript — style.css
   Dark elegant theme · blue/violet · responsive · fluid animations
   =================================================================== */

:root {
  /* Palette */
  --bg: #0a0a16;
  --bg-2: #0f1024;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text: #eef0fb;
  --muted: #a3a7c4;
  --faint: #6f7396;

  --blue: #4f7cff;
  --indigo: #6c5ce7;
  --violet: #9b5cff;
  --pink: #d472ff;

  --grad: linear-gradient(135deg, #4f7cff 0%, #7b5cff 45%, #b45cff 100%);
  --grad-soft: linear-gradient(135deg, rgba(79,124,255,0.16), rgba(180,92,255,0.16));

  --ok: #34d399;
  --err: #ff6b81;

  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 0 1px rgba(123, 92, 255, 0.25), 0 18px 50px -12px rgba(90, 60, 220, 0.5);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(1200px 700px at 50% -10%, #1a1740 0%, var(--bg-2) 40%, var(--bg) 100%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.container { width: min(1120px, 92vw); margin-inline: auto; }

h1, h2, h3, h4, .brand__name { font-family: 'Sora', 'Inter', sans-serif; letter-spacing: -0.02em; }

a { color: inherit; text-decoration: none; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ===== Background orbs ===== */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; animation: float 18s ease-in-out infinite; }
.orb--1 { width: 460px; height: 460px; background: #4f7cff; top: -120px; left: -100px; }
.orb--2 { width: 420px; height: 420px; background: #b45cff; top: 10%; right: -140px; animation-delay: -6s; }
.orb--3 { width: 380px; height: 380px; background: #6c5ce7; bottom: -160px; left: 30%; animation-delay: -12s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -30px) scale(1.08); }
}

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10, 10, 22, 0.6);
  border-bottom: 1px solid var(--border);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.brand__logo {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: var(--grad); color: #fff; box-shadow: 0 8px 20px -6px rgba(123,92,255,0.7);
}
.brand__name { font-size: 1.22rem; }
.brand__name span { color: var(--violet); }
.header__nav { display: flex; align-items: center; gap: 26px; }
.header__nav a { color: var(--muted); font-weight: 500; font-size: 0.95rem; transition: color 0.2s; }
.header__nav a:hover { color: var(--text); }

/* ===== Buttons ===== */
.btn {
  --btn-bg: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: inherit; font-weight: 600; font-size: 0.98rem;
  padding: 12px 20px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--btn-bg); color: var(--text); cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.25s, background 0.25s, border-color 0.25s, opacity 0.2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn__icon { transition: transform 0.25s var(--ease); }
.btn--primary {
  background: var(--grad); border-color: transparent; color: #fff;
  box-shadow: 0 12px 30px -10px rgba(110, 80, 255, 0.7);
}
.btn--primary:hover { box-shadow: 0 16px 40px -10px rgba(110, 80, 255, 0.85); }
.btn--primary:hover .btn__icon { transform: translateX(3px); }
.btn--soft { background: var(--grad-soft); border-color: var(--border-strong); }
.btn--soft:hover { border-color: var(--violet); }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--surface); }
.btn--lg { padding: 16px 26px; font-size: 1.02rem; border-radius: 14px; }
.btn--sm { padding: 8px 15px; font-size: 0.88rem; }

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

/* ===== Hero ===== */
.hero { padding: clamp(46px, 8vw, 96px) 0 40px; text-align: center; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 15px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  color: var(--muted); background: var(--surface); border: 1px solid var(--border);
  margin-bottom: 22px; animation: rise 0.6s var(--ease) both;
}
.hero__badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(52,211,153,0.2); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.hero__title { font-size: clamp(2rem, 5.2vw, 3.5rem); line-height: 1.08; font-weight: 800; animation: rise 0.6s var(--ease) 0.05s both; }
.hero__subtitle { max-width: 620px; margin: 20px auto 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.15rem); animation: rise 0.6s var(--ease) 0.12s both; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Extractor ===== */
.extractor { max-width: 760px; margin: 40px auto 0; padding: 22px; animation: rise 0.6s var(--ease) 0.2s both; }
.extractor__form { display: flex; gap: 12px; }
.input-wrap {
  position: relative; flex: 1; display: flex; align-items: center;
  background: rgba(0,0,0,0.28); border: 1.5px solid var(--border); border-radius: 14px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.input-wrap:focus-within { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(155,92,255,0.16); }
.input-wrap.is-valid { border-color: var(--ok); }
.input-wrap.is-invalid { border-color: var(--err); box-shadow: 0 0 0 4px rgba(255,107,129,0.14); }
.input-icon { display: grid; place-items: center; padding-left: 15px; color: var(--faint); }
.input-wrap input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-family: inherit; font-size: 1rem; padding: 15px 12px;
}
.input-wrap input::placeholder { color: var(--faint); }
.input-clear { display: grid; place-items: center; background: none; border: none; color: var(--faint); cursor: pointer; padding: 0 12px; transition: color 0.2s; }
.input-clear:hover { color: var(--text); }

.input-error { display: flex; align-items: center; gap: 8px; color: var(--err); font-size: 0.9rem; font-weight: 500; margin-top: 12px; animation: shake 0.4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-5px)} 40%,80%{transform:translateX(5px)} }

.extractor__hint { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; font-family: inherit; font-size: 0.85rem; font-weight: 500;
  color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 13px; cursor: pointer; transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.extractor__note { color: var(--faint); font-size: 0.83rem; }

/* ===== Progress panel ===== */
.progress-panel { max-width: 760px; margin: 22px auto 0; padding: 24px; animation: rise 0.45s var(--ease) both; }
.progress-panel__head { display: flex; align-items: center; gap: 12px; font-weight: 600; margin-bottom: 16px; }
.progress-panel__pct { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--violet); font-weight: 700; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,0.14); border-top-color: var(--violet); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.progress-bar { height: 10px; border-radius: 999px; background: rgba(0,0,0,0.35); overflow: hidden; }
.progress-bar__fill { height: 100%; width: 0%; border-radius: 999px; background: var(--grad); background-size: 200% 100%; transition: width 0.4s var(--ease); animation: shimmer 2s linear infinite; }
@keyframes shimmer { to { background-position: 200% 0; } }

.steps { list-style: none; display: grid; gap: 11px; margin-top: 20px; }
.steps li { display: flex; align-items: center; gap: 11px; color: var(--faint); font-size: 0.94rem; transition: color 0.3s; }
.steps li i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); flex-shrink: 0; position: relative; transition: all 0.3s; }
.steps li.active { color: var(--text); }
.steps li.active i { border-color: var(--violet); }
.steps li.done { color: var(--muted); }
.steps li.done i { background: var(--ok); border-color: var(--ok); }
.steps li.done i::after { content: ''; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid #0a0a16; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* ===== Result ===== */
.result { max-width: 820px; margin: 22px auto 0; padding: 26px; animation: rise 0.5s var(--ease) both; }
.result__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.result__meta { display: flex; align-items: center; gap: 14px; }
.thumb {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--grad-soft); border: 1px solid var(--border-strong); color: var(--violet);
}
.result__title { font-size: 1.2rem; font-weight: 700; line-height: 1.3; }
.result__author { color: var(--muted); font-size: 0.92rem; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
}
.badge--ok { color: var(--ok); background: rgba(52,211,153,0.12); border: 1px solid rgba(52,211,153,0.3); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0; }
.stat { background: rgba(0,0,0,0.25); border: 1px solid var(--border); border-radius: 14px; padding: 14px; text-align: center; }
.stat__label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); margin-bottom: 6px; }
.stat__value { font-family: 'Sora', sans-serif; font-size: 1.3rem; font-weight: 700; }

.result__editor { margin-top: 6px; }
.editor__toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.editor__label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.95rem; color: var(--muted); }
.editor__live { font-size: 0.82rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.editor__area {
  width: 100%; min-height: 230px; resize: vertical;
  background: rgba(0,0,0,0.3); border: 1.5px solid var(--border); border-radius: 14px;
  color: var(--text); font-family: 'Inter', sans-serif; font-size: 1rem; line-height: 1.75; padding: 18px;
  outline: none; transition: border-color 0.25s, box-shadow 0.25s;
}
.editor__area:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(155,92,255,0.14); }

.result__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.result__new { margin-left: auto; }

/* ===== Features ===== */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; width: min(1120px, 92vw); margin: 30px auto 0; padding: 20px 0; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: transform 0.3s var(--ease), border-color 0.3s; }
.feature:hover { transform: translateY(-5px); border-color: var(--border-strong); }
.feature__ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--grad-soft); color: var(--violet); margin-bottom: 14px; }
.feature h3 { font-size: 1.05rem; margin-bottom: 7px; }
.feature p { color: var(--muted); font-size: 0.92rem; }

/* ===== FAQ ===== */
.faq { padding: clamp(60px, 9vw, 100px) 0; }
.section-title { text-align: center; font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; }
.section-sub { text-align: center; color: var(--muted); margin: 12px auto 0; max-width: 520px; }
.accordion { max-width: 780px; margin: 40px auto 0; display: grid; gap: 12px; }
.acc-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: border-color 0.25s; }
.acc-item[open] { border-color: var(--border-strong); }
.acc-item summary {
  list-style: none; cursor: pointer; padding: 18px 22px; font-weight: 600; font-size: 1.02rem;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; transition: color 0.2s;
}
.acc-item summary::-webkit-details-marker { display: none; }
.acc-item summary::after {
  content: ''; width: 11px; height: 11px; flex-shrink: 0;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform 0.3s var(--ease); margin-top: -4px;
}
.acc-item[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.acc-item summary:hover { color: var(--violet); }
.acc-body { padding: 0 22px 20px; color: var(--muted); animation: rise 0.35s var(--ease); }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border); background: rgba(8,8,18,0.6); margin-top: 40px; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding: 56px 0 34px; }
.footer__brand p { color: var(--muted); font-size: 0.92rem; margin-top: 14px; max-width: 300px; }
.footer__col h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin-bottom: 15px; }
.footer__col a { display: block; color: var(--muted); font-size: 0.94rem; margin-bottom: 10px; transition: color 0.2s; }
.footer__col a:hover { color: var(--text); }
.footer__bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 22px 0; border-top: 1px solid var(--border); color: var(--faint); font-size: 0.86rem; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 24px);
  background: #16182e; border: 1px solid var(--border-strong); color: var(--text);
  padding: 13px 20px; border-radius: 12px; font-weight: 600; font-size: 0.94rem;
  display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: all 0.35s var(--ease); z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.toast.toast--err::before { background: var(--err); }

/* ===== Language switcher ===== */
.lang-switch { position: relative; }
.lang-switch__btn {
  display: inline-flex; align-items: center; gap: 7px; font-family: inherit; font-weight: 600; font-size: 0.9rem;
  color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 13px; cursor: pointer; transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.lang-switch__btn:hover { color: var(--text); border-color: var(--border-strong); }
.lang-switch__chev { transition: transform 0.25s var(--ease); }
.lang-switch.open .lang-switch__chev { transform: rotate(180deg); }
.lang-switch__menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; list-style: none;
  min-width: 168px; background: #14152b; border: 1px solid var(--border-strong); border-radius: 14px;
  padding: 6px; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-8px); transition: all 0.2s var(--ease);
}
.lang-switch.open .lang-switch__menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-switch__menu button {
  width: 100%; text-align: left; font-family: inherit; font-size: 0.94rem; font-weight: 500; color: var(--muted);
  background: none; border: none; border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.lang-switch__menu button:hover { background: var(--surface-2); color: var(--text); }

/* ===== Demo mode note ===== */
.demo-note {
  display: flex; align-items: center; gap: 10px; margin: 18px 0 4px;
  padding: 12px 15px; border-radius: 12px; font-size: 0.9rem; font-weight: 500;
  color: #ffd9a3; background: rgba(245, 180, 69, 0.1); border: 1px solid rgba(245, 180, 69, 0.32);
}
.demo-note svg { flex-shrink: 0; color: #f5b445; }

/* ===== Confidence meter ===== */
.confidence { margin: 4px 0 22px; }
.confidence__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.confidence__label { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.confidence__val { font-family: 'Sora', sans-serif; font-weight: 700; font-variant-numeric: tabular-nums; }
.confidence__bar { height: 8px; border-radius: 999px; background: rgba(0,0,0,0.35); overflow: hidden; }
.confidence__fill { height: 100%; width: 0%; border-radius: 999px; transition: width 0.7s var(--ease); background: var(--grad); }
.confidence__fill.is-high { background: linear-gradient(90deg, #34d399, #4f7cff); }
.confidence__fill.is-mid { background: linear-gradient(90deg, #f5b445, #9b5cff); }
.confidence__fill.is-low { background: linear-gradient(90deg, #ff6b81, #d472ff); }

/* ===== AI enrichment grid ===== */
.ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.ai-block { background: rgba(0,0,0,0.22); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.ai-block--wide { grid-column: 1 / -1; }
.ai-block__title { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); margin-bottom: 11px; font-family: 'Inter', sans-serif; font-weight: 700; }
.ai-block__title svg { color: var(--violet); }
.ai-block__text { color: var(--muted); font-size: 0.96rem; line-height: 1.65; }
.ai-block__viral { font-family: 'Sora', sans-serif; font-size: 1.05rem; font-weight: 700; line-height: 1.4; cursor: pointer; transition: color 0.2s; }
.ai-block__viral:hover { color: var(--violet); }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: inherit; font-size: 0.86rem; font-weight: 500; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 12px; cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.tag:hover { border-color: var(--violet); transform: translateY(-1px); }
.tag--hash { color: var(--blue); }

/* ===== Ad slots (non-intrusifs, lazy) ===== */
.ad-slot {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 92px; margin: 20px auto; padding: 10px;
  background: rgba(255,255,255,0.015); border: 1px dashed var(--border); border-radius: 14px;
  opacity: 0; transform: translateY(8px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.ad-slot.ad-visible { opacity: 1; transform: translateY(0); }
.ad-slot__label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--faint); opacity: 0.6; }
.ad-slot--header { margin-top: 14px; margin-bottom: 6px; }
.ad-slot--content { max-width: 820px; }
.ad-slot--faq { max-width: 780px; margin: 6px auto; }
.ad-slot--footer { min-height: 100px; margin-bottom: 26px; }
/* réserve la hauteur (évite le layout shift / bon CLS) */
.ad-slot ins { display: block; width: 100%; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 640px) {
  .header__nav a:not(.btn) { display: none; }
  .extractor__form { flex-direction: column; }
  .btn--lg { width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .ai-grid { grid-template-columns: 1fr; }
  .d-none-mobile { display: none; }
  .result__new { margin-left: 0; width: 100%; }
  .footer__grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .features { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .orb { animation: none; }
}
