/* Jetons Ursa (voir ursa-website-astro/src/styles/globals.css). Le widget vit dans
   l'iframe de ursa.marketing/geo, sur fond nuit : formulaire = carte blanche (texte mauve),
   vue en direct = contenu blanc + jaune sur le nuit du parent. */
@font-face { font-family: 'Manrope'; src: url('/fonts/Manrope-latin.woff2') format('woff2'); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; src: url('/fonts/Manrope-latin-ext.woff2') format('woff2'); font-weight: 200 800; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Funnel Display'; src: url('/fonts/FunnelDisplay-Light.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Funnel Display'; src: url('/fonts/FunnelDisplay-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Funnel Display'; src: url('/fonts/FunnelDisplay-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --nuit: #281432;
  --jaune: #f5ffc8;
  --blanc: #ffffff;
  --mauve: #4f3356;
  --lilas: #9473f2;
  --vert: #6fcf97;
  --jaune-signal: #f2c94c;
  --rouge: #eb5757;
  --erreur: #b91c1c;
  --gris: #9e9e9e;
  --font-display: 'Funnel Display', system-ui, sans-serif;
  --font-sans: 'Manrope', system-ui, sans-serif;
  --blanc-80: rgba(255, 255, 255, 0.8);
  --blanc-60: rgba(255, 255, 255, 0.6);
  --blanc-15: rgba(255, 255, 255, 0.15);
  --mauve-70: rgba(79, 51, 86, 0.7);
  --mauve-60: rgba(79, 51, 86, 0.6);
  --mauve-20: rgba(79, 51, 86, 0.2);
  --nuit-carte: #35223e; /* nuit + 6 % blanc, opaque : le décor du site parent ne traverse pas */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--nuit);
  color: var(--blanc);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
}
/* Dans l'iframe : le parent fournit le fond nuit. */
body.embedded { background: transparent; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 300; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
a { color: var(--jaune); }

.wrap { max-width: 640px; margin: 0 auto; padding: 32px 16px; }
body.embedded .wrap { max-width: none; padding: 0; }

.label {
  display: inline-block;
  padding: 4px 10px;
  background: var(--jaune);
  color: var(--nuit);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.muted { color: var(--blanc-60); }
.small { font-size: 13px; line-height: 1.5; }
.center { text-align: center; }

/* Formulaire : carte blanche */
.card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 36px;
  background: var(--blanc);
  color: var(--mauve);
}
.card[hidden] { display: none; }
.card a { color: var(--lilas); text-decoration: underline; text-underline-offset: 3px; }
.field { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.card label, .card legend {
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mauve-70);
  padding: 0;
}
.card legend { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; margin-bottom: 8px; }
.card legend .hint { text-transform: none; letter-spacing: 0; font-family: var(--font-sans); }
.hint { font-size: 12px; line-height: 1.5; color: var(--mauve-60); }
.hint:empty { display: none; }
.questions { display: flex; flex-direction: column; gap: 8px; }
.card label.check {
  flex-direction: row;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.5;
  color: var(--mauve-70);
}

input[type="text"], input[type="url"], input[type="email"] {
  width: 100%;
  padding: 12px 16px;
  font: inherit;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--mauve);
  background: var(--blanc);
  border: 1px solid var(--mauve-20);
  border-radius: 0;
  outline: none;
  transition: border-color 0.2s;
}
input::placeholder { color: rgba(40, 20, 50, 0.55); }
input:focus { border-color: var(--lilas); }
input[type="checkbox"] { width: 18px; height: 18px; flex: none; margin: 3px 0 0; accent-color: var(--lilas); }

button[type="submit"] {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.02em;
  padding: 14px 20px;
  background: var(--lilas);
  color: var(--blanc);
  border: 0;
  cursor: pointer;
  transition: background 0.2s;
}
button[type="submit"]:hover { background: #8360e6; }
button[type="submit"]:disabled { opacity: 0.5; cursor: default; }

.legal { font-size: 12px; line-height: 1.5; color: var(--mauve-60); }

#form-error button {
  font: inherit;
  font-family: var(--font-display);
  background: transparent;
  color: var(--mauve);
  border: 1px solid var(--mauve);
  padding: 8px 12px;
  cursor: pointer;
}
#form-error button:hover { background: var(--mauve); color: var(--blanc); }
.error { color: var(--rouge); font-size: 14px; }
.card .error { color: var(--erreur); }
.error:empty { display: none; }

/* En direct : sur le nuit du parent */
#live { display: flex; flex-direction: column; gap: 20px; }
#live[hidden] { display: none; }
#live .label { align-self: flex-start; }
.live-title { font-size: clamp(30px, 4vw, 44px); line-height: 1.05; }
.live-title span { color: var(--jaune); }

.gauge { padding: 20px 24px; background: var(--nuit-carte); border: 1px solid var(--blanc-15); }
.gauge-caption { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blanc-60); }
.gauge-value { font-family: var(--font-display); font-size: 48px; line-height: 1.1; margin: 4px 0 12px; }
.gauge-value strong { font-weight: 300; color: var(--jaune); }
.gauge-max { font-size: 22px; color: var(--blanc-60); }
.gauge-bar { height: 8px; background: var(--blanc-15); }
#gauge-fill { height: 8px; width: 0; background: var(--jaune); transition: width 0.6s; }
#gauge-label { margin-top: 10px; }

#cards { display: flex; flex-direction: column; gap: 10px; }
.card-tool { padding: 18px 20px; background: var(--nuit-carte); border: 1px solid var(--blanc-15); }
.card-tool .label { background: transparent; color: var(--lilas); padding: 0; margin-bottom: 6px; }
.card-tool h3 { font-size: 20px; line-height: 1.2; }
.card-tool h3 .muted { display: block; font-size: 15px; margin-top: 2px; }
.card-tool .verdict { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 0; }
.card-tool .light { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--gris); flex: none; margin-top: 5px; }
.card-tool[data-verdict="vert"] .light { background: var(--vert); }
.card-tool[data-verdict="jaune"] .light { background: var(--jaune-signal); }
.card-tool[data-verdict="rouge"] .light { background: var(--rouge); }
.card-tool .headline { font-weight: 600; }

.journal { list-style: none; margin: 10px 0 0; padding: 0; }
.journal li { font-size: 14px; margin: 4px 0; color: var(--blanc-80); animation: fade 0.3s; }
.journal em { color: var(--jaune); font-style: normal; font-weight: 600; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.fade-out { opacity: 0; transition: opacity 0.8s; }
