/* Classical Imagined — Product Builder Styles
   Design tokens: Georgia serif, #6B5A42 brown, #F5EFE6 cream
   Mobile-first, warm storybook aesthetic */

:root {
  --ci-brown: #6B5A42;
  --ci-brown-light: #8B7A62;
  --ci-cream: #F5EFE6;
  --ci-cream-dark: #EDE5D8;
  --ci-white: #FDFBF8;
  --ci-text: #3D3225;
  --ci-text-light: #7A6E5F;
  --ci-border: #D4C9BA;
  --ci-success: #5A7A52;
  --ci-font-serif: Georgia, 'Times New Roman', serif;
  --ci-radius: 12px;
  --ci-radius-sm: 8px;
  --ci-transition: 0.35s ease;
}

/* ── Reset & Base ── */
.ci-builder * {
  box-sizing: border-box;
}

.ci-builder {
  font-family: var(--ci-font-serif);
  color: var(--ci-text);
  background: var(--ci-cream);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.ci-builder img,
.ci-builder video {
  max-width: 100%;
  display: block;
}

/* ── Progress Indicator ── */
.ci-progress {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 32px;
  padding: 20px 0 8px;
  position: sticky;
  top: 0;
  background: var(--ci-cream);
  z-index: 10;
}

.ci-progress__dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  -webkit-appearance: none;
}

.ci-progress__dot::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ci-border);
  border: 2px solid var(--ci-border);
  transition: background var(--ci-transition), border-color var(--ci-transition), transform var(--ci-transition);
}

.ci-progress__label {
  font-size: 0.7rem;
  color: var(--ci-text-light, #8a7e72);
  letter-spacing: 0.02em;
  transition: color var(--ci-transition);
}

.ci-progress__dot--active::before {
  background: var(--ci-brown);
  border-color: var(--ci-brown);
  transform: scale(1.2);
}

.ci-progress__dot--active .ci-progress__label {
  color: var(--ci-brown);
  font-weight: 600;
}

.ci-progress__dot--completed::before {
  background: var(--ci-brown);
  border-color: var(--ci-brown);
}

/* ── Step Container ── */
.ci-step {
  display: none;
  padding: 0 16px 40px;
  max-width: 640px;
  margin: 0 auto;
  animation: ci-fadeIn 0.35s ease;
}

.ci-step--active {
  display: block;
}

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

/* ── Landing / Hero ── */
.ci-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 16px 40px;
  max-width: 640px;
  margin: 0 auto;
}

.ci-hero__media {
  width: 100%;
  max-width: 480px;
  border-radius: var(--ci-radius);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 8px 30px rgba(107, 90, 66, 0.12);
}

.ci-hero__media video,
.ci-hero__media img {
  width: 100%;
  height: auto;
  display: block;
}

.ci-hero__headline {
  font-size: 28px;
  line-height: 1.25;
  font-weight: normal;
  color: var(--ci-brown);
  margin: 0 0 12px;
  font-style: italic;
}

.ci-hero__sub {
  font-size: 16px;
  color: var(--ci-text-light);
  margin: 0 0 28px;
  line-height: 1.5;
}

.ci-hero__demo-caption {
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ci-text-light);
  margin: -8px 0 20px;
  opacity: 0.85;
}

/* ── CTA Buttons ── */
.ci-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 36px;
  font-family: var(--ci-font-serif);
  font-size: 17px;
  font-weight: normal;
  color: var(--ci-white);
  background: var(--ci-brown);
  border: none;
  border-radius: var(--ci-radius);
  cursor: pointer;
  transition: background var(--ci-transition), transform 0.15s ease;
  text-decoration: none;
  width: 100%;
  max-width: 400px;
}

.ci-btn:hover {
  background: var(--ci-brown-light);
}

.ci-btn:active {
  transform: scale(0.98);
}

.ci-btn--disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ── How It Works Strip ── */
.ci-how-it-works {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 32px 16px;
  max-width: 640px;
  margin: 0 auto;
}

.ci-how-it-works__item {
  text-align: center;
  flex: 1;
  max-width: 160px;
}

.ci-how-it-works__number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ci-brown);
  color: var(--ci-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  margin: 0 auto 10px;
}

.ci-how-it-works__label {
  font-size: 14px;
  color: var(--ci-text-light);
  line-height: 1.4;
}

/* ── Bottom Reassurance ── */
.ci-reassurance-line {
  text-align: center;
  font-size: 14px;
  color: var(--ci-text-light);
  padding: 24px 16px 40px;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ── Step Headlines ── */
.ci-step__headline {
  font-size: 24px;
  font-weight: normal;
  font-style: italic;
  color: var(--ci-brown);
  text-align: center;
  margin: 0 0 24px;
  line-height: 1.3;
}

/* ── Character Grid (Step 1) ── */
.ci-characters {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

@media (min-width: 600px) {
  .ci-characters {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}

.ci-character-card {
  display: flex;
  flex-direction: column;
  background: var(--ci-white);
  border: 2px solid var(--ci-border);
  border-radius: var(--ci-radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--ci-transition), box-shadow var(--ci-transition), transform 0.15s ease;
  padding: 0;
  -webkit-appearance: none;
  text-align: left;
  width: 100%;
}

.ci-character-card:hover {
  border-color: var(--ci-brown-light);
  box-shadow: 0 4px 16px rgba(107, 90, 66, 0.1);
}

.ci-character-card:active {
  transform: scale(0.97);
}

.ci-character-card--selected {
  border-color: var(--ci-brown);
  box-shadow: 0 4px 20px rgba(107, 90, 66, 0.18);
  background: var(--ci-cream);
}

.ci-character-card__media {
  width: 100%;
  height: 160px;
  overflow: hidden;
}

.ci-character-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ci-character-card__info {
  padding: 10px 12px 14px;
}

.ci-character-card__name {
  font-size: 15px;
  font-weight: bold;
  color: var(--ci-brown);
  margin: 0 0 4px;
}

.ci-character-card__desc {
  font-size: 13px;
  color: var(--ci-text-light);
  line-height: 1.4;
  margin: 0;
}

.ci-step__reassurance {
  text-align: center;
  font-size: 14px;
  color: var(--ci-text-light);
  margin: 16px 0 24px;
  line-height: 1.5;
  font-style: italic;
}

.ci-step__actions {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.ci-step__actions--pair {
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.ci-btn--back {
  background: transparent;
  color: var(--ci-brown-light);
  border: 1px solid var(--ci-border);
  font-size: 15px;
  min-height: 44px;
  padding: 10px 28px;
}

.ci-btn--back:hover {
  background: var(--ci-cream-dark);
  color: var(--ci-brown);
}

/* Inline validation errors */
.ci-field__error {
  text-align: center;
  font-size: 14px;
  color: #b44;
  margin: 0 0 8px;
  line-height: 1.4;
}

.ci-field__input--error {
  border-color: #b44;
}

/* ── Character Summary Strip (Step 2) ── */
.ci-character-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--ci-white);
  border: 1px solid var(--ci-border);
  border-radius: var(--ci-radius-sm);
  margin-bottom: 20px;
}

.ci-character-strip__thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.ci-character-strip__name {
  font-size: 15px;
  color: var(--ci-brown);
  font-weight: bold;
  flex: 1;
  min-width: 0;
}

.ci-character-strip__change {
  font-size: 13px;
  color: var(--ci-brown-light);
  text-decoration: underline;
  flex-shrink: 0;
}

.ci-character-strip__change:hover {
  color: var(--ci-brown);
}

/* ── Personalise (Step 2) ── */
.ci-field {
  margin-bottom: 24px;
}

.ci-field__label {
  display: block;
  font-size: 15px;
  color: var(--ci-brown);
  margin-bottom: 8px;
  font-weight: bold;
}

.ci-field__input {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--ci-font-serif);
  font-size: 18px;
  color: var(--ci-text);
  background: var(--ci-white);
  border: 2px solid var(--ci-border);
  border-radius: var(--ci-radius-sm);
  outline: none;
  transition: border-color var(--ci-transition);
}

.ci-field__input:focus {
  border-color: var(--ci-brown);
}

.ci-field__input::placeholder {
  color: var(--ci-border);
}

.ci-field__hint {
  font-size: 13px;
  color: var(--ci-text-light);
  margin-top: 6px;
  line-height: 1.4;
}

.ci-field__counter {
  font-size: 13px;
  color: var(--ci-text-light);
  text-align: right;
  margin-top: 4px;
}

/* Character Scene GIF (Step 2) */
.ci-character-scene {
  border-radius: var(--ci-radius);
  overflow: hidden;
  margin: 16px 0 8px;
  text-align: center;
}

/* Example Image (Step 3) */
.ci-example-image {
  display: flex;
  justify-content: center;
  margin: 0 0 8px;
}

.ci-example-image__img {
  max-height: 320px;
  width: auto;
  border-radius: var(--ci-radius);
  box-shadow: 0 4px 20px rgba(107, 90, 66, 0.12);
}

/* Name Reveal GIF (legacy — kept for reference) */
.ci-name-reveal {
  border-radius: var(--ci-radius);
  overflow: hidden;
  margin: 16px 0 8px;
  text-align: center;
}

.ci-name-reveal__gif {
  width: 100%;
  max-width: 480px;
  height: auto;
  border-radius: var(--ci-radius);
  margin: 0 auto;
  display: block;
  box-shadow: 0 4px 20px rgba(107, 90, 66, 0.12);
}

.ci-name-reveal__media {
  width: 100%;
  max-width: 480px;
  height: auto;
  border-radius: var(--ci-radius);
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(107, 90, 66, 0.12);
}

.ci-name-reveal__placeholder {
  background: var(--ci-white);
  border-radius: var(--ci-radius);
  padding: 40px 16px;
  font-size: 14px;
  color: var(--ci-text-light);
  font-style: italic;
  box-shadow: 0 2px 12px rgba(107, 90, 66, 0.08);
}

/* Suggestion Pills */
.ci-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ci-pills::-webkit-scrollbar {
  display: none;
}

.ci-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  font-family: var(--ci-font-serif);
  font-size: 13px;
  color: var(--ci-brown);
  background: var(--ci-white);
  border: 1px solid var(--ci-border);
  border-radius: 20px;
  cursor: pointer;
  transition: background var(--ci-transition), border-color var(--ci-transition);
  white-space: nowrap;
  min-height: 48px;
  display: flex;
  align-items: center;
}

.ci-pill:hover {
  background: var(--ci-cream-dark);
  border-color: var(--ci-brown-light);
}

/* ── Review & Buy (Step 3) ── */
.ci-example-screenshot {
  width: 100%;
  border-radius: var(--ci-radius);
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: 0 4px 20px rgba(107, 90, 66, 0.12);
}

.ci-example-screenshot img {
  width: 100%;
  height: auto;
  display: block;
}

.ci-example-screenshot__placeholder {
  background: var(--ci-white);
  padding: 48px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--ci-text-light);
  font-style: italic;
}

.ci-youtube-link {
  text-align: center;
  font-size: 14px;
  margin: 8px 0 24px;
  line-height: 1.5;
}

.ci-youtube-link a {
  color: var(--ci-brown);
  text-decoration: underline;
  transition: color var(--ci-transition);
}

.ci-youtube-link a:hover {
  color: var(--ci-brown-light);
}

/* Order Summary Card */
.ci-summary {
  background: var(--ci-white);
  border-radius: var(--ci-radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(107, 90, 66, 0.08);
  position: relative;
}

.ci-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  font-size: 15px;
}

.ci-summary__row + .ci-summary__row {
  border-top: 1px solid var(--ci-cream-dark);
}

.ci-summary__label {
  color: var(--ci-text-light);
  flex-shrink: 0;
  margin-right: 12px;
}

.ci-summary__value {
  text-align: right;
  color: var(--ci-text);
  font-weight: bold;
}

.ci-summary__value--light {
  font-weight: normal;
  color: var(--ci-text-light);
  font-style: italic;
}

.ci-summary__price {
  font-size: 22px;
  color: var(--ci-brown);
  text-align: center;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid var(--ci-cream-dark);
}

.ci-summary__price--discounted {
  color: var(--ci-success);
}

.ci-summary__original-price {
  text-align: center;
  font-size: 14px;
  color: var(--ci-text-light);
  text-decoration: line-through;
  margin-top: 2px;
}

.ci-summary__delivery {
  text-align: center;
  font-size: 13px;
  color: var(--ci-text-light);
  margin-top: 4px;
}

/* Promo code field */
.ci-promo {
  margin: 16px 0;
}

.ci-promo__label {
  display: block;
  font-size: 14px;
  color: var(--ci-text-light);
  margin-bottom: 6px;
  font-family: var(--ci-font-serif);
}

.ci-promo__row {
  display: flex;
  gap: 8px;
}

.ci-promo__input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--ci-border);
  border-radius: var(--ci-radius-sm);
  font-size: 15px;
  font-family: var(--ci-font-serif);
  background: var(--ci-white);
  color: var(--ci-text);
}
.ci-promo__input:focus {
  outline: none;
  border-color: var(--ci-brown);
}

.ci-promo__apply {
  padding: 10px 18px;
  border: 1px solid var(--ci-brown);
  border-radius: var(--ci-radius-sm);
  background: var(--ci-white);
  color: var(--ci-brown);
  font-size: 14px;
  font-family: var(--ci-font-serif);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--ci-transition), color var(--ci-transition);
}
.ci-promo__apply:hover {
  background: var(--ci-brown);
  color: var(--ci-white);
}
.ci-promo__apply:disabled {
  opacity: 0.5;
  cursor: default;
}

.ci-promo__status {
  font-size: 13px;
  margin-top: 6px;
  min-height: 1.2em;
}
.ci-promo__status--valid {
  color: var(--ci-success);
}
.ci-promo__status--invalid {
  color: #b44;
}

.ci-summary__edit {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 13px;
  color: var(--ci-brown);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--ci-font-serif);
}

/* Preview Note */
.ci-preview-note {
  text-align: center;
  font-size: 13px;
  color: var(--ci-text-light);
  font-style: italic;
  margin: 8px 0 4px;
  line-height: 1.5;
}

/* Preview Link */
.ci-preview-link {
  text-align: center;
  font-size: 14px;
  margin: 8px 0 16px;
}

.ci-preview-link a {
  color: var(--ci-gold);
  text-decoration: underline;
  font-style: italic;
}

.ci-preview-link a:hover {
  color: var(--ci-text);
}

/* Reassurance Block */
.ci-reassurance-block {
  margin-bottom: 24px;
}

.ci-reassurance-block__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  color: var(--ci-text);
  line-height: 1.4;
}

.ci-reassurance-block__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: var(--ci-success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.ci-reassurance-block__icon::after {
  content: '';
  display: block;
  width: 6px;
  height: 10px;
  border: solid var(--ci-white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

/* Digital download confirmation checkbox */
.ci-confirm-digital {
  margin: 20px 0 8px;
  padding: 16px 20px;
  background: #fef9ec;
  border: 1px solid #e8d9b8;
  border-radius: 10px;
}

.ci-confirm-digital__label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ci-text, #2d2d2d);
}

.ci-confirm-digital__input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--ci-primary, #2E4A48);
  cursor: pointer;
}

.ci-confirm-digital__text {
  flex: 1;
}

/* Character thumbnail in summary */
.ci-summary__character {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ci-summary__thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
}

/* ── Responsive ── */
@media (min-width: 768px) {
  .ci-hero__headline {
    font-size: 36px;
  }

  .ci-hero__sub {
    font-size: 18px;
  }

  .ci-step__headline {
    font-size: 28px;
  }

  .ci-btn {
    width: auto;
    min-width: 280px;
  }
}
