/* ==========================================================================
   AN CREATIVE — Reusable Components
   ========================================================================== */

/* --- Stepper --- */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5) var(--space-8);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  gap: 0;
}

.stepper__step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  transition: opacity var(--transition-default);
  opacity: 0.5;
}

.stepper__step.active { opacity: 1; }
.stepper__step.completed { opacity: 0.85; }
.stepper__step.completed .stepper__circle { background: var(--color-success); border-color: var(--color-success); }

.stepper__circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--color-linen-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-smoke-grey);
  background: var(--color-surface);
  transition: all var(--transition-default);
  flex-shrink: 0;
}

.stepper__step.active .stepper__circle {
  background: var(--color-amber-gold);
  border-color: var(--color-amber-gold);
  color: white;
  box-shadow: 0 2px 8px rgba(200, 150, 62, 0.3);
}

.stepper__label {
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
}

.stepper__line {
  width: 60px;
  height: 2px;
  background: var(--color-linen-cream);
  margin: 0 var(--space-2);
  flex-shrink: 0;
  transition: background var(--transition-default);
}

.stepper__line.completed { background: var(--color-success); }

/* --- Card --- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-default);
}

.card:hover { box-shadow: var(--shadow-md); }
.card--flat { box-shadow: none; }
.card--flat:hover { box-shadow: none; }

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.card__title {
  font-family: var(--font-headline);
  font-size: var(--text-lg);
  font-weight: 600;
}

/* --- Button --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

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

.btn--primary {
  background: var(--color-amber-gold);
  color: white;
  border-color: var(--color-amber-gold);
}
.btn--primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.btn--secondary {
  background: transparent;
  color: var(--color-tram-brown);
  border-color: var(--color-linen-cream);
}
.btn--secondary:hover:not(:disabled) {
  background: var(--color-linen-cream);
}

.btn--ghost {
  background: transparent;
  color: var(--color-smoke-grey);
  border-color: transparent;
}
.btn--ghost:hover:not(:disabled) {
  background: var(--color-linen-cream);
  color: var(--color-tram-brown);
}

.btn--success {
  background: var(--color-success);
  color: white;
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

.btn--icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.4;
}

.badge--warm { background: rgba(200, 150, 62, 0.15); color: var(--color-amber-gold); }
.badge--luxury { background: rgba(44, 44, 44, 0.1); color: var(--color-charcoal); }
.badge--moss { background: rgba(74, 93, 58, 0.12); color: var(--color-forest-moss); }
.badge--clay { background: rgba(184, 146, 106, 0.2); color: var(--color-soft-clay); }
.badge--track-a { background: rgba(74, 93, 58, 0.12); color: var(--color-forest-moss); }
.badge--track-b { background: rgba(200, 150, 62, 0.15); color: var(--color-amber-gold); }

/* --- Form --- */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-tram-brown);
  margin-bottom: var(--space-2);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-linen-cream);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-amber-gold);
  box-shadow: 0 0 0 3px rgba(200, 150, 62, 0.12);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: var(--leading-relaxed);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238A8A8A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-smoke-grey);
  margin-top: var(--space-1);
}

/* --- Concept Card --- */
.concept-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  cursor: pointer;
  transition: all var(--transition-default);
  position: relative;
}

.concept-card:hover {
  border-color: var(--color-soft-clay);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.concept-card.selected {
  border-color: var(--color-amber-gold);
  box-shadow: 0 0 0 3px rgba(200, 150, 62, 0.15);
}

.concept-card__id {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-smoke-grey);
  margin-bottom: var(--space-2);
}

.concept-card__name {
  font-family: var(--font-headline);
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.concept-card__desc {
  font-size: var(--text-sm);
  color: var(--color-smoke-grey);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-3);
}

.concept-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* --- Image Gallery --- */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.gallery__item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-default);
  aspect-ratio: 1;
  background: var(--color-linen-cream);
}

.gallery__item:hover {
  border-color: var(--color-soft-clay);
  box-shadow: var(--shadow-lg);
}

.gallery__item.selected {
  border-color: var(--color-amber-gold);
  box-shadow: 0 0 0 3px rgba(200, 150, 62, 0.2);
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(44, 44, 44, 0.6), transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-default);
  display: flex;
  align-items: flex-end;
  padding: var(--space-4);
}

.gallery__item:hover .gallery__item__overlay { opacity: 1; }

/* --- Modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(44, 44, 44, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-default);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px);
  transition: transform var(--transition-default);
}

.modal-backdrop.open .modal {
  transform: translateY(0);
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toast {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  background: var(--color-charcoal);
  color: white;
  font-size: var(--text-sm);
  box-shadow: var(--shadow-lg);
  animation: slideInRight var(--transition-default) ease forwards;
}

.toast--success { background: var(--color-success); }
.toast--error { background: var(--color-danger); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* --- Loading --- */
.loading-smoke {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-12);
}

.loading-smoke__wisps {
  position: relative;
  width: 60px;
  height: 80px;
}

.loading-smoke__wisp {
  position: absolute;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to top, var(--color-amber-gold), transparent);
  border-radius: var(--radius-full);
  animation: smokeRise 2s ease-in-out infinite;
}

.loading-smoke__wisp:nth-child(1) { left: 20px; height: 40px; animation-delay: 0s; }
.loading-smoke__wisp:nth-child(2) { left: 30px; height: 55px; animation-delay: 0.4s; }
.loading-smoke__wisp:nth-child(3) { left: 40px; height: 35px; animation-delay: 0.8s; }

@keyframes smokeRise {
  0% { opacity: 0; transform: translateY(0) scaleY(0.5); }
  30% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-30px) scaleY(1.2) translateX(5px); }
}

.loading-smoke__text {
  font-size: var(--text-sm);
  color: var(--color-smoke-grey);
  font-style: italic;
}

/* --- Checklist --- */
.checklist {
  list-style: none;
}

.checklist__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
}

.checklist__item:last-child { border-bottom: none; }

.checklist__check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-linen-cream);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  margin-top: 1px;
}

.checklist__check.checked {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
}

/* --- Section Panel --- */
.panel {
  display: none;
  animation: fadeIn var(--transition-default) ease;
}

.panel.active { display: block; }

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

.panel__header {
  margin-bottom: var(--space-8);
}

.panel__title {
  font-family: var(--font-headline);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-2);
}

.panel__subtitle {
  font-size: var(--text-base);
  color: var(--color-smoke-grey);
}

/* --- Actions Bar --- */
.actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-8);
  margin-top: var(--space-8);
  border-top: 1px solid var(--color-border);
}

/* --- Grid Layouts --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stepper__label { display: none; }
  .stepper__line { width: 30px; }
}

/* --- Tag Pill --- */
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
}

.tag-pill:hover { background: var(--color-linen-cream); }
.tag-pill.active {
  background: var(--color-tram-brown);
  color: var(--color-warm-ivory);
  border-color: var(--color-tram-brown);
}

/* --- Divider --- */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-6) 0;
}

/* --- Preview Frame --- */
.preview-frame {
  background: var(--color-linen-cream);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  position: relative;
  overflow: hidden;
}

.preview-frame img {
  max-width: 100%;
  max-height: 500px;
  border-radius: var(--radius-md);
}
