/* Panneau ForgeGUI — reprend les tokens de la landing forgegui.com */

/* Polices de la landing, incluses dans l'extension (SIL OFL 1.1, voir media/fonts). */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/AtkinsonHyperlegibleNext-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  src: url("../fonts/AtkinsonHyperlegibleMono-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --fg-font: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;
  --fg-mono: "Atkinson Hyperlegible Mono", ui-monospace, Consolas, monospace;
  --fg-text: #ededed;
  --fg-muted: rgb(255 255 255 / 50%);
  --fg-canvas: #0c0c0c;
  --fg-rim: inset 0 -2px 1px rgb(255 255 255 / 25%), inset 0 2px 1px rgb(255 255 255 / 25%);
  --fg-btn-rim: inset 0 2px 1.5px rgb(255 255 255 / 25%), inset 0 -2px 1.5px rgb(255 255 255 / 25%);
  --fg-panel-shadow: var(--fg-rim), 0 4px 50px rgb(0 0 0 / 25%);
  --fg-composer: radial-gradient(ellipse at top, #1b1b1b, #101010);
  --fg-button: radial-gradient(ellipse 50.45% 100% at 49.55% 101.25%, #2a2a2a, #161414);
  --fg-button-hover: radial-gradient(ellipse 50.45% 100% at 49.55% 101.25%, #535353, #252525);
  --fg-blue: radial-gradient(ellipse 50.45% 100% at 49.55% 101.25%, #0077ff, #002b5d);
  --fg-blue-hover: radial-gradient(ellipse 50.45% 100% at 49.55% 101.25%, #007bff, #003f86);
  --fg-blue-glow: inset 0 0 27.8px rgb(0 119 255 / 50%);
  --fg-red: #ff5757;
  --fg-red-glow: inset 0 0 27.8px rgb(255 0 4 / 50%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--fg-canvas);
  color: var(--fg-text);
  font-family: var(--fg-font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* Le panneau occupe toute la hauteur : le bloc forfait se cale en bas,
   avec une lueur bleue discrète (comme le bouton Generate) pour habiller le fond. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    radial-gradient(140% 38% at 50% 100%, rgb(0 119 255 / 16%), rgb(0 119 255 / 4%) 55%, transparent 80%),
    var(--fg-canvas);
}
.wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.bottom {
  margin-top: auto;
  padding-top: 18px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 18px 16px 26px;
  overflow: hidden;
  isolation: isolate;
}
.hero__sky {
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  height: 340px;
  object-fit: cover;
  object-position: center 30%;
  z-index: -1;
  opacity: .9;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 35%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 35%, transparent 100%);
  animation: drift 40s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: scale(1.08) translateX(-2%); }
  to   { transform: scale(1.08) translateX(2%); }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 34px;
}
.wordmark { height: 18px; display: block; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 9999px;
  border: 1px solid #000;
  background: #101010;
  box-shadow: var(--fg-panel-shadow);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
  transition: color .3s;
}
.pill svg { width: 12px; height: 12px; }
.pill.is-ok { color: #e4f5ff; }

.hero h1 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -.01em;
  text-align: center;
  text-shadow: 0 2px 18px rgb(0 0 0 / 60%);
}
.hero p {
  margin: 0 auto;
  max-width: 260px;
  text-align: center;
  color: rgb(237 237 237 / 72%);
  line-height: 1.45;
  text-shadow: 0 1px 10px rgb(0 0 0 / 70%);
}
.hero strong { color: var(--fg-text); font-weight: 600; }

/* ---------- Composer (formulaire de clé) ---------- */
.wrap { padding: 0 12px 20px; }

.composer {
  position: relative;
  border-radius: 20px;
  border: 1px solid #000;
  background: var(--fg-composer);
  box-shadow: var(--fg-panel-shadow);
  padding: 14px 14px 12px;
  transition: box-shadow .35s ease;
}
.composer.is-loading { box-shadow: var(--fg-panel-shadow), var(--fg-blue-glow); }
.composer.is-error   { box-shadow: var(--fg-panel-shadow), var(--fg-red-glow); animation: shake .42s cubic-bezier(.36,.07,.19,.97); }
.composer.is-ok      { box-shadow: var(--fg-panel-shadow), var(--fg-blue-glow); }

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.composer label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 8px;
}
.composer label svg { width: 13px; height: 13px; }

.field {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  padding: 0 4px 0 12px;
  background: rgb(237 237 237 / 5%);
  border: 1px solid rgb(237 237 237 / 12%);
  transition: border-color .2s, background .2s;
}
.field:focus-within { border-color: rgb(0 119 255 / 70%); background: rgb(0 119 255 / 6%); }
.composer.is-error .field { border-color: rgb(255 87 87 / 60%); }

.field input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: 500 14px/1 var(--fg-mono);
  letter-spacing: .06em;
}
.field input::placeholder { color: rgb(255 255 255 / 28%); }

.eye {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
}
.eye:hover { background: rgb(255 255 255 / 6%); color: var(--fg-text); }
.eye svg { width: 16px; height: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid #000;
  color: #fff;
  font: 500 15px/1 var(--fg-font);
  cursor: pointer;
  box-shadow: var(--fg-btn-rim);
  transition: transform .08s ease, filter .2s;
}
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 -3px 1.5px rgb(0 0 0 / 35%), inset 0 3px 1.5px rgb(0 0 0 / 35%); }
.btn:disabled { cursor: default; filter: saturate(.6) brightness(.85); }
.btn svg { width: 16px; height: 16px; }

.btn--blue { background: var(--fg-blue); }
.btn--blue:hover:not(:disabled) { background: var(--fg-blue-hover); }
.btn--dark { background: var(--fg-button); color: var(--fg-text); margin-top: 0; }
.btn--dark:hover { background: var(--fg-button-hover); }

.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgb(255 255 255 / 30%);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
  display: none;
}
.is-loading .spinner { display: block; }
.is-loading .btn__icon { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.msg {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .25s ease;
}
.msg > div { overflow: hidden; min-height: 0; }
.msg.show { grid-template-rows: 1fr; }
.msg p {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 12px 2px 2px;
  font-size: 13px;
  line-height: 1.4;
}
.msg p svg { flex: none; width: 15px; height: 15px; margin-top: 1px; }
.msg.error p { color: var(--fg-red); }
.msg.ok p { color: #7cc0ff; }

/* ---------- Outils débloqués ---------- */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 4px 10px;
  font-size: 14px;
  font-weight: 600;
}
.section-title span { font-size: 12px; font-weight: 500; color: var(--fg-muted); }

.tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.tool {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgb(237 237 237 / 10%);
  background: rgb(237 237 237 / 4%);
  color: rgb(237 237 237 / 55%);
  font-size: 13px;
  font-weight: 500;
}
.tool > svg { width: 16px; height: 16px; flex: none; }
.tool > span:first-of-type { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool .lock { flex: none; width: 12px; height: 12px; opacity: .55; }
.tool .lock svg, .btn__icon svg, .eye span { display: block; }
.eye .eye-closed, .eye.is-visible .eye-open { display: none; }
.eye.is-visible .eye-closed { display: block; }
.tool .lock svg { width: 100%; height: 100%; }

/* ---------- Quick tools ---------- */
.link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg-text);
  font: 500 12px/1 var(--fg-font);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link:hover { color: #fff; }
.link svg { width: 12px; height: 12px; }

/* Une carte par ligne, en bannière : le titre est posé sur l'image. */
.quicks {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.quick {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.quick:focus-visible { outline: 2px solid #0077ff; outline-offset: 2px; }
.quick__img {
  position: relative;
  aspect-ratio: 16 / 7;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #000;
  box-shadow: var(--fg-rim);
  background: #161616;
}
.quick__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(.9) brightness(.85);
  transition: transform .4s ease, filter .3s ease;
}
.quick:hover .quick__img img,
.quick:focus-visible .quick__img img { transform: scale(1.05); filter: saturate(1) brightness(.95); }
/* Petite flèche "ouvrir" qui apparaît au survol. */
.quick__go {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: opacity .2s ease, transform .2s ease;
}
.quick:hover .quick__go,
.quick:focus-visible .quick__go { opacity: 1; transform: none; }
.quick__go svg {
  display: block;
  width: 24px;
  height: 24px;
  padding: 5px;
  border-radius: 9999px;
  background: rgb(12 12 12 / 70%);
  box-shadow: var(--fg-rim);
  color: #fff;
}
.quick__meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 26px 12px 9px;
  background: linear-gradient(to top, rgb(12 12 12 / 92%), rgb(12 12 12 / 55%) 55%, transparent);
  pointer-events: none;
}
.quick__name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 6px rgb(0 0 0 / 60%);
}
.quick__by { font-size: 11px; color: rgb(255 255 255 / 60%); }

/* ---------- Pied ---------- */
.plan {
  margin-top: 0;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #000;
  background: var(--fg-composer);
  box-shadow: var(--fg-rim);
}
.plan p { margin: 0 0 10px; color: var(--fg-muted); font-size: 13px; line-height: 1.4; }
.plan p strong { color: var(--fg-text); font-weight: 600; }

.foot {
  margin-top: 16px;
  text-align: center;
  font-size: 11px;
  color: rgb(255 255 255 / 30%);
}

@media (prefers-reduced-motion: reduce) {
  .hero__sky, .composer.is-error, .spinner { animation: none; }
}
