/* ════════════════════════════════════════════════════════
   CONTENT STUDIO — LAMBORGHINI DESIGN SYSTEM
   ════════════════════════════════════════════════════════ */

:root {
  /* Core Lamborghini palette */
  --black:        #000000;
  --dark-iron:    #181818;
  --charcoal:     #202020;
  --shadow:       #313131;
  --iron:         #555555;
  --slate:        #666666;
  --ash:          #7D7D7D;
  --steel:        #969696;
  --smoke:        #F5F5F5;
  --white:        #FFFFFF;
  --near-white:   #F8F8F8;

  /* Accent */
  --gold:         #FFC000;
  --dark-gold:    #917300;
  --gold-text:    #FFCE3E;
  --cyan:         #29ABE2;
  --teal-action:  #1EAEDB;
  --link-blue:    #3860BE;

  /* Type */
  --font-sans:    'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, textarea, button, select { font-family: inherit; font-size: 16px; }
a { color: var(--white); }
a:hover { color: var(--link-blue); }

/* ═══════════════════════ HEADER ═══════════════════════ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px 40px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header__menu {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding: 8px 0;
}

.header__bars {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}
.header__bars span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--white);
}

.header__title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--white);
  text-align: center;
}

.header__steps {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.step-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ash);
  transition: color 0.2s;
}
.step-pill__num {
  color: var(--steel);
}
.step-pill.is-done {
  color: var(--white);
}
.step-pill.is-done .step-pill__num {
  color: var(--white);
}
.step-pill.is-active {
  color: var(--gold);
}
.step-pill.is-active .step-pill__num {
  color: var(--gold);
}
.step-pill__line {
  display: inline-block;
  width: 12px;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 2px;
}
.step-pill__line.is-done {
  background: var(--gold);
}

/* ═══════════════════════ MAIN LAYOUT ═══════════════════════ */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 40px 96px;
  min-height: calc(100vh - 81px);
}

.step { display: none; }
.step.step--active {
  display: block;
  animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ═══════════════════════ TYPOGRAPHY ═══════════════════════ */
.step__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.225em;
  color: var(--ash);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.step__title {
  font-size: 80px;
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin-bottom: 24px;
  color: var(--white);
}

.step__subtitle {
  font-size: 18px;
  font-weight: 400;
  color: var(--ash);
  line-height: 1.5;
  max-width: 640px;
  margin-bottom: 56px;
}

.step__section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.225em;
  color: var(--ash);
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* Compact nav header (top of inner steps) */
.step__nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  gap: 20px;
}

.step__nav .step__title {
  font-size: 54px;
  margin-bottom: 8px;
}

.step__nav .step__subtitle {
  font-size: 15px;
  margin-bottom: 0;
}

.step__actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* ═══════════════════════ BUTTONS ═══════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 16px 28px;
  background: transparent;
  color: var(--white);
  border-radius: 0;
  transition: background 0.2s, color 0.2s, border-color 0.2s, opacity 0.2s;
}

.btn--gold {
  background: var(--gold);
  color: var(--black);
  font-weight: 600;
}
.btn--gold:hover:not(:disabled) {
  background: var(--dark-gold);
  color: var(--black);
}
.btn--gold:disabled {
  background: var(--charcoal);
  color: var(--ash);
  cursor: not-allowed;
}

.btn--ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 15px 27px;
}
.btn--ghost:hover:not(:disabled) {
  background: var(--teal-action);
  border-color: var(--teal-action);
}

.btn--lg {
  padding: 22px 40px;
  font-size: 15px;
}

.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  align-items: center;
}

/* ═══════════════════════ FORMAT CARDS (step 1) ═══════════════════════ */
.formats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--charcoal);
  margin-bottom: 48px;
}
.format-card {
  background: var(--black);
  padding: 36px;
  cursor: pointer;
  text-align: left;
  border: none;
  color: var(--white);
  transition: background 0.2s;
  position: relative;
}
.format-card:hover { background: var(--dark-iron); }
.format-card.is-active {
  background: var(--charcoal);
  outline: 1px solid var(--gold);
  outline-offset: -1px;
}
.format-card__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.225em;
  color: var(--ash);
  text-transform: uppercase;
  margin-bottom: 16px;
  font-weight: 500;
}
.format-card.is-active .format-card__meta { color: var(--gold); }
.format-card__name {
  font-size: 36px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 12px;
}
.format-card__desc {
  font-size: 14px;
  color: var(--ash);
  line-height: 1.5;
}

/* ═══════════════════════ INPUTS ═══════════════════════ */
.textarea, .input {
  width: 100%;
  background: var(--dark-iron);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--white);
  padding: 20px;
  font-size: 15px;
  line-height: 1.6;
  outline: none;
  border-radius: 0;
  font-family: var(--font-sans);
  transition: border-color 0.15s, background 0.15s;
}
.textarea { min-height: 280px; resize: vertical; }
.textarea:focus, .input:focus {
  border-color: var(--gold);
  background: var(--black);
}
.textarea::placeholder, .input::placeholder { color: var(--iron); }

.input--small {
  padding: 12px 14px;
  font-size: 14px;
}

.char-count {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ash);
  text-transform: uppercase;
  margin: 12px 0 32px;
}

/* ═══════════════════════ SLIDE CARDS (step 2) ═══════════════════════ */
.slide-card {
  background: var(--charcoal);
  padding: 28px 32px;
  margin-bottom: 1px;
}

.slide-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.slide-card__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--black);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--white);
}
.slide-card__num--cover {
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
}

.slide-card__type {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.225em;
  color: var(--ash);
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 500;
}
.slide-card__type--cover {
  border-color: var(--gold);
  color: var(--gold);
}

.slide-card__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.slide-card__field--full { grid-column: 1 / -1; }

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.225em;
  color: var(--ash);
  margin-bottom: 8px;
  font-weight: 500;
}

/* ═══════════════════════ STYLE CARDS (step 3) ═══════════════════════ */
.styles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--charcoal);
  margin-bottom: 40px;
}
.style-card {
  background: var(--black);
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  color: var(--white);
  font-family: inherit;
  position: relative;
  transition: background 0.2s;
}
.style-card:hover { background: var(--dark-iron); }
.style-card.is-active {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
  z-index: 1;
}

.style-card__preview {
  aspect-ratio: 4 / 3;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
}

.style-card__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.225em;
  padding: 5px 10px;
}

.style-card__check {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: var(--gold);
  color: var(--black);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}
.style-card.is-active .style-card__check { display: flex; }

.style-card__preview-text {
  font-size: 26px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin-bottom: 18px;
}

.style-card__swatches { display: flex; gap: 4px; }
.style-card__swatch {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.style-card__info {
  padding: 22px 24px;
  background: var(--charcoal);
}
.style-card.is-active .style-card__info {
  background: var(--dark-iron);
}

.style-card__tagline {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.225em;
  color: var(--gold);
  margin-bottom: 10px;
  font-weight: 500;
}

.style-card__name {
  font-size: 22px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.05;
}

.style-card__desc {
  font-size: 13px;
  color: var(--ash);
  line-height: 1.55;
  margin-bottom: 16px;
}

.style-card__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.style-card__tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 4px 8px;
  background: var(--black);
  color: var(--ash);
}

/* ═══════════════════════ DROPZONE (step 4) ═══════════════════════ */
.dropzone {
  border: 1.5px dashed rgba(255, 255, 255, 0.18);
  padding: 72px 40px;
  text-align: center;
  cursor: pointer;
  background: var(--dark-iron);
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 28px;
}
.dropzone:hover {
  border-color: var(--gold);
  background: var(--charcoal);
}

.dropzone__icon {
  font-size: 56px;
  color: var(--ash);
  margin-bottom: 16px;
  font-weight: 200;
  line-height: 1;
}

.dropzone__title {
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 10px;
  color: var(--white);
}

.dropzone__hint {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.225em;
  color: var(--ash);
}

.uploads {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.uploads:empty { display: none; }

.upload-thumb { position: relative; width: 92px; height: 92px; }
.upload-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.upload-thumb__remove {
  position: absolute;
  top: -10px; right: -10px;
  width: 24px; height: 24px;
  background: var(--black);
  color: var(--white);
  border: 1px solid var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  font-weight: 400;
}
.upload-thumb__remove:hover {
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
}

/* ═══════════════════════ GENERATING (step 5) ═══════════════════════ */
.generating {
  text-align: center;
  padding: 64px 0 32px;
}

.hex {
  display: inline-block;
  width: 96px;
  height: 96px;
  margin-bottom: 32px;
}
.hex-icon { width: 100%; height: 100%; animation: hex-spin 6s linear infinite; }
@keyframes hex-spin {
  to { transform: rotate(360deg); }
}

.progress {
  width: 100%;
  max-width: 520px;
  margin: 32px auto 16px;
  height: 2px;
  background: var(--charcoal);
  position: relative;
}
.progress__bar {
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width 0.6s ease;
}

.progress__num {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--ash);
  text-transform: uppercase;
}

.gen-thumbs {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 48px;
}
.gen-thumbs img {
  width: 72px; height: 72px;
  object-fit: cover;
  outline: 1px solid var(--gold);
  outline-offset: -1px;
}

/* ═══════════════════════ PREVIEW (step 6) ═══════════════════════ */
.preview {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  align-items: start;
}

.preview__main {
  background: var(--dark-iron);
  margin-bottom: 14px;
  position: relative;
}
.preview__main img { width: 100%; display: block; }

.preview__main-empty {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ash);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.225em;
  text-transform: uppercase;
}

.thumbs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.thumb {
  width: 60px; height: 60px;
  background: var(--charcoal);
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
  outline: none;
}
.thumb.is-active { border-color: var(--gold); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb__num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ash);
}

.preview__meta {
  padding: 18px 22px;
  background: var(--charcoal);
  margin-top: 14px;
}
.preview__meta-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.225em;
  color: var(--ash);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.preview__meta-headline {
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 4px;
}
.preview__meta-sub {
  font-size: 13px;
  color: var(--ash);
  line-height: 1.5;
}

/* ═══════════════════════ CHAT ═══════════════════════ */
.chat {
  background: var(--charcoal);
  display: flex;
  flex-direction: column;
  height: 640px;
  position: sticky;
  top: 100px;
}

.chat__head {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.chat__head-dot {
  width: 8px;
  height: 8px;
  background: var(--gold);
  display: inline-block;
}

.chat__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-width: 90%;
}
.msg--user {
  background: var(--black);
  color: var(--gold);
  align-self: flex-end;
  border-left: 2px solid var(--gold);
}
.msg--bot {
  background: var(--dark-iron);
  color: var(--white);
  align-self: flex-start;
  border-left: 2px solid rgba(255, 255, 255, 0.25);
}
.msg--typing {
  font-family: var(--font-mono);
  letter-spacing: 0.3em;
  color: var(--ash);
}

.chat__input {
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.chat__input input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--white);
  padding: 16px 20px;
  font-size: 14px;
  outline: none;
}
.chat__input input::placeholder { color: var(--iron); }
.chat__input button {
  background: var(--gold);
  color: var(--black);
  border: none;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
}
.chat__input button:hover:not(:disabled) { background: var(--dark-gold); }
.chat__input button:disabled {
  background: var(--shadow);
  color: var(--ash);
  cursor: not-allowed;
}

/* ═══════════════════════ EXPORT (step 7) ═══════════════════════ */
.export {
  text-align: center;
  padding: 56px 0 32px;
}

.export__hex {
  width: 88px;
  height: 88px;
  margin: 0 auto 36px;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  font-size: 40px;
  font-weight: 700;
}

.export__title {
  font-size: 88px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  line-height: 0.92;
  margin-bottom: 20px;
  color: var(--white);
}

.export__meta {
  color: var(--ash);
  font-size: 17px;
  margin-bottom: 48px;
}
.export__meta strong {
  color: var(--gold);
  font-weight: 500;
}

.export__grid {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 56px;
}
.export__grid img {
  width: 100px; height: 100px;
  object-fit: cover;
}

.export__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ═══════════════════════ UTILITIES ═══════════════════════ */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--shadow); }
::-webkit-scrollbar-thumb:hover { background: var(--iron); }

/* ═══════════════════════ RESPONSIVE ═══════════════════════ */
@media (max-width: 1024px) {
  .preview { grid-template-columns: 1fr; }
  .chat { position: static; height: 480px; }
}

@media (max-width: 900px) {
  .header { grid-template-columns: 1fr 1fr; }
  .header__center, .header__steps { display: none; }
  .styles { grid-template-columns: 1fr; }
  .formats { grid-template-columns: 1fr; }
  .step__title { font-size: 56px; }
  .export__title { font-size: 60px; }
  .step__nav .step__title { font-size: 36px; }
  .main { padding: 40px 24px 80px; }
}

@media (max-width: 600px) {
  .header { padding: 16px 24px; }
  .main { padding: 32px 20px 64px; }
  .step__title { font-size: 40px; }
  .export__title { font-size: 44px; }
  .step__nav { flex-direction: column; align-items: flex-start; }
  .slide-card__fields { grid-template-columns: 1fr; }
  .step__nav .step__title { font-size: 32px; }
  .format-card__name { font-size: 28px; }
}
