:root {
  --bg: #0f0b16;
  --bg-card: #1a1424;
  --border: rgba(255, 255, 255, 0.12);
  --text: #f3efe8;
  --muted: rgba(243, 239, 232, 0.65);
  --gold: #e8b64d;
  --gold-soft: rgba(232, 182, 77, 0.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: var(--gold); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  position: relative;
  z-index: 5;
}
.topbar .brand {
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 18px;
}
.topbar .legal-dropdown summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  list-style: none;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  user-select: none;
}
.topbar .legal-dropdown summary::-webkit-details-marker { display: none; }
.topbar .legal-dropdown[open] summary { border-color: var(--gold); color: var(--text); }
.topbar .legal-dropdown-menu {
  position: absolute;
  right: 24px;
  margin-top: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  min-width: 160px;
}
.topbar .legal-dropdown-menu a {
  padding: 6px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
}
.topbar .legal-dropdown-menu a:hover { background: rgba(255, 255, 255, 0.06); }

.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 20px 84px;
  text-align: center;
  background: linear-gradient(rgba(10, 8, 16, 0.55), rgba(10, 8, 16, 0.88)),
    url("assets/hero-bg.jpg") center / cover no-repeat;
}
.hero-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(closest-side, var(--gold-soft), transparent 70%);
  pointer-events: none;
}
.hero h1 {
  position: relative;
  margin: 0 0 18px;
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}
.hero-sub {
  position: relative;
  max-width: 520px;
  margin: 0 auto 32px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 17px;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 20px 100px;
}

.styles-section { margin: 48px 0 40px; text-align: center; }
.styles-section h2 { font-size: 20px; margin-bottom: 20px; }

.style-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.style-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.style-card .glyph { font-size: 30px; }
.style-card:hover { border-color: rgba(232, 182, 77, 0.5); }
.style-card.selected {
  border-color: var(--gold);
  background: var(--gold-soft);
  box-shadow: 0 0 0 1px var(--gold);
}

.card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 22px 24px;
  margin: 20px 0;
  background: var(--bg-card);
}
.card h2 { font-size: 17px; margin: 0 0 16px; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px dashed rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 32px 16px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--gold);
  background: var(--gold-soft);
}
.dropzone-hint { font-size: 12px; color: var(--muted); }
.dropzone.has-file { border-style: solid; border-color: var(--gold); }
#dropzone-thumb {
  max-width: 100%;
  max-height: 120px;
  border-radius: 8px;
  object-fit: cover;
}

.processing-row {
  display: flex;
  gap: 16px;
  align-items: center;
}
.processing-thumb {
  width: 84px;
  height: 84px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex: 0 0 auto;
}
.processing-info { flex: 1 1 auto; }
.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f0c877, #d99a2b);
  animation: progress-slide 1.6s ease-in-out infinite;
}
@keyframes progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
.muted { color: var(--muted); }
.muted.small { font-size: 12px; margin-top: 14px; }

.selected-style-line {
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 4px;
}
.selected-style-line strong { color: var(--gold); }

.consent-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 16px 0;
  font-size: 13px;
  color: var(--muted);
}
.consent-row input { margin-top: 3px; flex: 0 0 auto; }
.consent-row a { color: var(--gold); }

.btn {
  display: inline-block;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 15px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  box-sizing: border-box;
  text-decoration: none;
}
.btn-cta {
  background: linear-gradient(135deg, #f0c877, #d99a2b);
  color: #241a06;
}
.btn-cta:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.35);
  cursor: not-allowed;
}
.hero .btn-cta { max-width: 280px; margin: 0 auto; display: block; }

.btn-secondary {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  margin-top: 14px;
}
.btn-secondary:disabled {
  color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.15);
  cursor: not-allowed;
}

.identity-slider { margin-top: 22px; }
.identity-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.identity-slider input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
}

.status-msg { font-size: 13px; margin-top: 10px; min-height: 1.2em; color: var(--muted); }
.status-msg.error { color: #ff8a80; }

.preview-frame {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 4px 0 18px;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}
.preview-frame img { width: 100%; height: 100%; object-fit: cover; }

.page-footer {
  text-align: center;
  padding: 30px 20px 50px;
  display: flex;
  gap: 18px;
  justify-content: center;
  font-size: 13px;
}
.page-footer a { color: var(--muted); text-decoration: none; }
.page-footer a:hover { color: var(--gold); }

@media (max-width: 480px) {
  .style-grid { grid-template-columns: repeat(2, 1fr); }
}
