:root {
  --bg: #071326;
  --white: #0d1b31;
  --text: #eaf3ff;
  --muted: #9bb2d0;
  --blue: #4eb4ff;
  --blue-dark: #8fcfff;
  --blue-soft: rgba(78, 180, 255, 0.14);
  --border: rgba(132, 196, 255, 0.24);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --card: rgba(13, 27, 49, 0.88);
  --checker: rgba(78,180,255,0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(78, 180, 255, 0.22), transparent 34rem),
    linear-gradient(135deg, #071326 0%, #0c1d36 48%, #0b2d55 100%);
  min-height: 100vh;
  transition: background 0.25s ease, color 0.25s ease;
}

.app {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
}

.hero {
  border: 1px solid var(--border);
  border-radius: 34px;
  padding: 0px 40px 20px;
  background:
    linear-gradient(135deg, rgba(13,27,49,0.96), rgba(10,39,72,0.9)),
    linear-gradient(90deg, rgba(78,180,255,0.18), transparent);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  text-align: center;
}


.hero::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -70px;
  top: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(29, 99, 255, 0.24), transparent 68%);
}

.hero__logo-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.hero__logo {
  width: min(460px, 86vw);
  height: auto;
  filter: drop-shadow(0 18px 28px rgba(29, 99, 255, 0.18));
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue-dark);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4.6vw, 4.5rem);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.lead {
  margin: 5px auto 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
  max-width: 760px;
}

.workspace {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 24px;
  margin-top: 24px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 26px;
  backdrop-filter: blur(18px);
}

h2 {
  margin: 0 0 16px;
  font-size: 1.05rem;
}

.dropzone {
  min-height: 180px;
  border: 2px dashed rgba(29, 99, 255, 0.34);
  background: linear-gradient(145deg, var(--white), var(--blue-soft));
  border-radius: 24px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  margin-bottom: 26px;
}

.dropzone:hover,
.dropzone.is-dragging {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: 0 18px 40px rgba(29, 99, 255, 0.16);
}

.dropzone input { display: none; }

.dropzone__icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1d63ff, #4eb4ff);
  color: white;
  font-size: 2rem;
  margin-bottom: 12px;
}

.dropzone small,
.preview-box small,
.note { color: var(--muted); }

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field label { font-weight: 700; }

select,
input[type="range"] { width: 100%; }

select {
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 14px;
  background: var(--white);
  color: var(--text);
  font-weight: 700;
}

.range-field {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.range-field input { grid-column: 1 / -1; }

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
}

.two-buttons {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 15px 18px;
  background: linear-gradient(135deg, var(--blue), #49b3ff);
  color: white;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(29, 99, 255, 0.28);
}

.btn-secondary {
  background: linear-gradient(135deg, rgba(29,99,255,0.12), rgba(78,180,255,0.16));
  color: var(--blue-dark);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.note {
  margin: 14px 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.preview-card { min-height: 520px; }

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.preview-box {
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background:
    linear-gradient(45deg, var(--checker) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker) 75%),
    var(--white);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 22px;
}

.preview-box span { font-weight: 800; }

canvas {
  max-width: 100%;
  image-rendering: pixelated;
}

#sourceCanvas,
#faviconCanvas {
  border-radius: 18px;
  background: rgba(255,255,255,0.55);
  box-shadow: inset 0 0 0 1px rgba(29, 99, 255, 0.12);
}

#faviconCanvas { cursor: grab; }
#faviconCanvas.is-dragging { cursor: grabbing; }

/* Prévisualisations réelles : cartes compactes, stables et réalistes. */
.real-previews {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.browser-tab,
.mobile-preview {
  min-height: 108px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(13, 27, 49, 0.94), rgba(22, 52, 86, 0.9));
  box-shadow: inset 0 -1px 0 rgba(78, 180, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1;
  text-align: left;
  overflow: hidden;
}

.browser-tab {
  border-radius: 18px;
}

.mobile-preview {
  border-radius: 18px;
}

.browser-tab span,
.mobile-preview span {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.real-previews canvas {
  flex: 0 0 auto;
  background: transparent;
  image-rendering: auto;
}

.browser-tab canvas {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

.android-preview canvas {
  width: 48px;
  height: 48px;
  border-radius: 11px;
}

.ios-preview canvas {
  width: 60px;
  height: 60px;
  border-radius: 14px;
}

.seo-box {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(135deg, var(--white), var(--blue-soft));
  padding: 18px;
}

.seo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.seo-header h2 { margin: 0; }
.seo-header .btn { width: auto; padding: 10px 14px; }

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.55;
}

.status {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f5faff, #eaf4ff);
  color: var(--muted);
  font-weight: 700;
}

.status { background: rgba(78,180,255,0.12); }

@media (max-width: 980px) {
  .workspace,
  .preview-grid,
  .real-previews { grid-template-columns: 1fr; }
  .hero { padding: 32px; }
}
