:root {
  --bg1: #120b14;
  --bg2: #24152a;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f9eef5;
  --muted: #d7c1ce;
  --accent1: #ff89b5;
  --accent2: #d16eff;
  --accent3: #ffc2d6;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 105, 180, 0.18), transparent 25%),
    radial-gradient(circle at bottom right, rgba(180, 90, 255, 0.16), transparent 25%),
    linear-gradient(135deg, var(--bg1), var(--bg2));
}

body {
  position: relative;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.22;
  pointer-events: none;
}

.bg-shape-1 {
  width: 260px;
  height: 260px;
  background: #ff7bac;
  top: 10px;
  left: -70px;
}

.bg-shape-2 {
  width: 280px;
  height: 280px;
  background: #b774ff;
  right: -80px;
  bottom: 0;
}

.app {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.hero {
  text-align: center;
  margin-bottom: 24px;
}

.hero-badge {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--accent3);
  font-size: 0.92rem;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.hero p {
  max-width: 700px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.6;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.form-panel {
  padding: 24px;
}

.result-panel {
  padding: 24px;
  min-height: 680px;
}

.panel-header h2 {
  margin: 0 0 8px;
}

.panel-header p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.5;
}

.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}

select,
input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  appearance: none;
}

select:focus,
input[type="text"]:focus {
  border-color: var(--accent1);
  box-shadow: 0 0 0 4px rgba(255, 137, 181, 0.18);
}

option {
  color: #111;
}

input[type="text"]::placeholder {
  color: rgba(247, 231, 241, 0.55);
}

.buttons {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.api-box {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.api-box p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.btn {
  border: none;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  flex: 1;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:disabled:hover {
  transform: none;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: white;
  box-shadow: 0 12px 28px rgba(209, 110, 255, 0.28);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--border);
}

.image-btn {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid var(--border);
}

.image-actions {
  margin-top: 16px;
}

.image-btn {
  width: 100%;
}

.empty-state {
  min-height: 240px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 20px;
  color: var(--muted);
  padding: 20px;
}

.summary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 18px;
  line-height: 1.6;
  animation: fadeInUp 0.5s ease;
}

.result-grid {
  display: grid;
  gap: 16px;
}

.proposal {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
  animation: fadeInUp 0.45s ease both;
}

.proposal:nth-child(2) { animation-delay: 0.05s; }
.proposal:nth-child(3) { animation-delay: 0.1s; }
.proposal:nth-child(4) { animation-delay: 0.15s; }
.proposal:nth-child(5) { animation-delay: 0.2s; }
.proposal:nth-child(6) { animation-delay: 0.25s; }

.top-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.tag {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: bold;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.mode-jour {
  background: rgba(255, 214, 153, 0.16);
  color: #ffdca8;
}

.mode-bureau {
  background: rgba(173, 216, 255, 0.16);
  color: #cbe5ff;
}

.mode-soiree {
  background: rgba(255, 150, 216, 0.16);
  color: #ffc8e8;
}

.mode-romantique {
  background: rgba(255, 181, 213, 0.16);
  color: #ffd2e7;
}

.mode-lumineux {
  background: rgba(255, 236, 179, 0.16);
  color: #ffeeb5;
}

.mode-intense {
  background: rgba(211, 161, 255, 0.16);
  color: #e5c9ff;
}

.score {
  font-size: 0.84rem;
  color: var(--muted);
}

.proposal h3 {
  margin: 0 0 12px;
}

.proposal p {
  margin: 7px 0;
  line-height: 1.55;
  color: #f1e6ed;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 12px;
}

.swatch {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.15), 0 8px 16px rgba(0,0,0,0.18);
}

.swatch-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.mini-tag {
  font-size: 0.78rem;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent3);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.swatch-error {
  color: #ffd2d2;
  font-size: 0.82rem;
  line-height: 1.4;
  margin-bottom: 8px;
}

.icon-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.icon {
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.generated-image-slot {
  margin-top: 14px;
}

.image-state {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  line-height: 1.5;
}

.loading-state {
  color: var(--accent3);
  background: rgba(255, 255, 255, 0.08);
}

.error-state {
  color: #ffd2d2;
  background: rgba(255, 80, 110, 0.12);
  border-color: rgba(255, 120, 140, 0.3);
}

.generated-image-frame {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
}

.generated-image-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 720px;
  object-fit: cover;
}

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

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .result-panel {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .app {
    width: min(100% - 16px, 1000px);
  }

  .form-panel,
  .result-panel {
    padding: 18px;
  }

  .buttons {
    flex-direction: column;
  }

  .api-box {
    align-items: stretch;
    flex-direction: column;
  }

  select,
  input[type="text"],
  .btn {
    font-size: 16px;
  }
}
