
:root {
  --bg: #050505;
  --panel: rgba(18, 18, 18, 0.94);
  --line: rgba(255,255,255,0.08);
  --text: #f5f5f5;
  --muted: #9fa3ab;
  --success: #50d38a;
  --warning: #f2b94b;
  --danger: #ff6e6e;
  --info: #89a8ff;
  --shadow: 0 18px 70px rgba(0,0,0,.45);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.bg-pattern {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,0.045), transparent 20%),
    radial-gradient(circle at 82% 26%, rgba(80,211,138,0.04), transparent 18%),
    radial-gradient(circle at 50% 82%, rgba(255,255,255,0.025), transparent 22%),
    linear-gradient(135deg, rgba(255,255,255,0.025), transparent 55%);
  pointer-events: none;
}
.page {
  width: 100%;
  height: 100svh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(8px, 2vw, 24px);
  overflow: hidden;
}
.card {
  width: min(920px, 100%);
  max-height: calc(100svh - 16px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: clamp(18px, 3vw, 28px);
  padding: clamp(14px, 2.4vw, 28px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(8px, 1.2vh, 12px);
  flex: 0 0 auto;
}
.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: clamp(10px, 1.6vw, 12px);
  white-space: nowrap;
}
.push-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.08);
  color: #f5f5f5;
  cursor: pointer;
  font-size: clamp(11px, 1.8vw, 13px);
  white-space: nowrap;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 18px);
  margin: 0 0 clamp(6px,1.2vh,10px);
  flex: 0 0 auto;
}
.brand-icon {
  width: clamp(38px, 7vw, 62px);
  height: clamp(38px, 7vw, 62px);
  border-radius: 18px;
  flex: 0 0 auto;
}
h1 {
  margin: 0;
  font-weight: 300;
  font-size: clamp(28px, 6vw, 64px);
  line-height: .98;
}
.intro {
  margin: 0 0 clamp(10px, 1.8vh, 22px);
  color: var(--muted);
  font-size: clamp(12px, 2.1vw, 15px);
  line-height: 1.42;
  flex: 0 0 auto;
}
.form { flex: 0 0 auto; }
.form label {
  display: block;
  margin-bottom: 7px;
  color: #d8dbe1;
  font-size: clamp(12px, 2vw, 14px);
}
.row {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
}
select, .row button {
  min-height: clamp(42px, 6.2vh, 54px);
  border-radius: 16px;
  border: 1px solid var(--line);
  outline: none;
}
select {
  background: #0d0d0d;
  color: var(--text);
  padding: 0 16px;
  font-size: clamp(14px, 2.5vw, 16px);
}
.row button {
  position: relative;
  overflow: hidden;
  background: #efefef;
  color: #0f0f0f;
  cursor: pointer;
  font-size: clamp(14px, 2.5vw, 16px);
  font-weight: 650;
  transition: transform .15s ease, opacity .15s ease, background .2s ease, color .2s ease;
}
.row button:hover, .push-btn:hover { transform: translateY(-1px); }
.row button.is-analyzing {
  background: #000;
  color: #fff;
  border-color: rgba(255,255,255,0.25);
}
.row button.is-analyzing::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,.1) 42%, rgba(255,255,255,.26) 50%, rgba(255,255,255,.1) 58%, transparent 100%);
  transform: translateX(-100%);
  animation: sweep 1.05s linear infinite;
}
@keyframes sweep { to { transform: translateX(100%); } }
button:disabled { opacity: .92; cursor: wait; }
.loader, .push-status {
  margin-top: clamp(8px, 1.2vh, 14px);
  color: var(--muted);
  font-size: clamp(11px, 1.9vw, 13px);
  flex: 0 0 auto;
}
.push-status {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
}
.hidden { display: none; }
.result {
  margin-top: clamp(10px, 1.8vh, 18px);
  padding: clamp(12px, 1.8vw, 20px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.02);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.result-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: clamp(10px, 1.6vh, 16px);
  flex: 0 0 auto;
}
.result-label {
  color: var(--muted);
  font-size: clamp(10px, 1.7vw, 12px);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 6px;
}
.decision {
  font-size: clamp(22px, 4.5vw, 36px);
  font-weight: 500;
  line-height: 1.05;
}
.badge {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: clamp(11px, 1.9vw, 13px);
  color: #dfe3ea;
  white-space: nowrap;
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: clamp(7px, 1.2vw, 12px);
  margin-bottom: clamp(9px, 1.6vh, 16px);
  flex: 0 0 auto;
}
.meta-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(9px, 1.6vw, 14px);
  background: rgba(255,255,255,.015);
  min-width: 0;
}
.meta-title {
  display: block;
  color: var(--muted);
  font-size: clamp(9px, 1.6vw, 11px);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta-box strong {
  font-size: clamp(14px, 2.4vw, 18px);
  font-weight: 600;
  white-space: nowrap;
}
.result-body {
  min-height: 0;
  overflow: hidden;
  flex: 1 1 auto;
}
.summary {
  margin: 0 0 clamp(8px, 1.3vh, 12px);
  font-size: clamp(12px, 2vw, 14px);
  line-height: 1.42;
  color: #f3f4f6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.reasons {
  margin: 0 0 clamp(8px, 1.3vh, 12px) 16px;
  padding: 0;
  color: #d9dde3;
  line-height: 1.35;
  font-size: clamp(11px, 1.9vw, 13px);
}
.reasons li:nth-child(n+4) { display: none; }
.reasons li + li { margin-top: 5px; }
.small-note {
  color: var(--muted);
  font-size: clamp(10px, 1.6vw, 12px);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tone-success { color: var(--success); }
.tone-warning { color: var(--warning); }
.tone-danger { color: var(--danger); }
.tone-info { color: var(--info); }

@media (max-width: 760px) {
  .row { grid-template-columns: 1fr; gap: 10px; }
  .meta-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 520px) {
  .page { padding: 8px; }
  .card {
    max-height: calc(100svh - 16px);
    padding: 13px;
    border-radius: 20px;
  }
  .topline { gap: 8px; margin-bottom: 8px; }
  .push-btn { min-height: 30px; padding: 0 9px; }
  .brand-row { gap: 9px; }
  .intro { margin-bottom: 10px; }
  select, .row button { min-height: 42px; border-radius: 14px; }
  .result { margin-top: 10px; padding: 12px; border-radius: 18px; }
  .result-head { margin-bottom: 10px; }
  .meta-grid { gap: 7px; margin-bottom: 10px; }
  .meta-box { padding: 9px; border-radius: 13px; }
  .summary { -webkit-line-clamp: 2; }
  .reasons li:nth-child(n+3) { display: none; }
  .small-note { display: none; }
}
@media (max-height: 720px) {
  h1 { font-size: clamp(24px, 5vw, 44px); }
  .brand-icon { width: 38px; height: 38px; border-radius: 12px; }
  .intro { display: none; }
  .result { padding: 10px; }
  .summary { -webkit-line-clamp: 2; }
  .reasons li:nth-child(n+3) { display: none; }
  .small-note { display: none; }
}
@media (max-height: 610px) {
  .eyebrow { display: none; }
  .brand-row { margin-bottom: 5px; }
  .meta-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .summary { display: none; }
  .reasons li:nth-child(n+2) { display: none; }
}


/* V3 — état résultat prioritaire */
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.page {
  width: 100%;
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
}
.card {
  max-height: calc(100svh - 16px);
  overflow: hidden;
}
.card.result-mode .form,
.card.result-mode .intro {
  display: none;
}
.card.result-mode .result {
  margin-top: clamp(10px, 1.8vh, 18px);
}
.reset-btn {
  margin-top: clamp(10px, 1.6vh, 16px);
  align-self: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: #f5f5f5;
  font-size: clamp(12px, 2vw, 14px);
  cursor: pointer;
  flex: 0 0 auto;
}
.reset-btn:hover {
  background: rgba(255,255,255,0.10);
}
.row button.is-analyzing {
  background: #000 !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.25) !important;
}
.row button.is-analyzing::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,.1) 42%, rgba(255,255,255,.26) 50%, rgba(255,255,255,.1) 58%, transparent 100%);
  transform: translateX(-100%);
  animation: sweep 1.05s linear infinite;
}
@keyframes sweep { to { transform: translateX(100%); } }

@media (max-width: 520px), (max-height: 720px) {
  .card.result-mode .topline { margin-bottom: 6px; }
  .card.result-mode .brand-row { margin-bottom: 6px; }
  .card.result-mode .brand-icon { width: 34px; height: 34px; }
  .card.result-mode h1 { font-size: clamp(22px, 7vw, 34px); }
  .card.result-mode .result { padding: 10px; }
}
