/* ============================================================
   Trip Planner Wizard — Aura.build Style
   ============================================================ */

/* --- Modal Shell --- */
.trip-wizard {
  position: fixed; inset: 0; z-index: 9999;
  display: none;
  transition: opacity .3s ease;
  opacity: 0;
}
.trip-wizard.is-open { display: flex; opacity: 1; align-items: center; justify-content: center; }

.trip-wizard__backdrop {
  position: absolute; inset: 0;
  background: rgba(26, 54, 93, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.trip-wizard__container {
  position: relative; z-index: 1;
  background: #fff;
  display: flex; flex-direction: column;
  width: 100%; height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
@media (min-width: 768px) {
  .trip-wizard__container {
    width: 95%; max-width: 900px;
    height: auto; max-height: 90vh;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
  }
}

/* --- Header --- */
.trip-wizard__header {
  flex: none; display: flex; justify-content: space-between; align-items: flex-start;
  padding: 16px; border-bottom: 1px solid #e5e7eb;
  background: #fff; z-index: 10;
}
@media (min-width: 640px) { .trip-wizard__header { padding: 16px 24px; } }
@media (min-width: 768px) { .trip-wizard__header { padding: 20px 32px; } }

.trip-wizard__header-left { display: flex; align-items: center; gap: 12px; }
.trip-wizard__header-emoji { font-size: 1.5rem; }
.trip-wizard__title { font-weight: 700; font-size: 1.1rem; color: #1a1a2e; margin: 0; }
@media (min-width: 640px) { .trip-wizard__title { font-size: 1.25rem; } }
.trip-wizard__subtitle { font-size: .8rem; color: #6b7280; margin: 2px 0 0; }
@media (max-width: 639px) { .trip-wizard__subtitle { display: none; } }

.trip-wizard__close {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #6b7280; border: none; background: transparent; cursor: pointer;
  transition: all .2s;
}
.trip-wizard__close:hover { color: #C41E3A; background: rgba(196,30,58,.05); }

/* --- Progress --- */
.trip-wizard__progress { flex: none; background: #fff; z-index: 10; border-bottom: 1px solid #e5e7eb; }

.trip-wizard__progress-mobile { padding: 12px 16px; }
@media (min-width: 640px) { .trip-wizard__progress-mobile { display: none; } }

.trip-wizard__progress-meta { display: flex; justify-content: space-between; font-size: .75rem; color: #6b7280; margin-bottom: 8px; }
.trip-wizard__progress-track { height: 8px; background: #f3f4f6; border-radius: 99px; overflow: hidden; }
.trip-wizard__progress-fill { height: 100%; background: #C41E3A; border-radius: 99px; transition: width .3s; }

.trip-wizard__stepper { display: none; }
@media (min-width: 640px) {
  .trip-wizard__stepper {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 32px;
  }
}
@media (min-width: 768px) { .trip-wizard__stepper { padding: 20px 48px; } }

.trip-wizard__step { display: flex; flex-direction: column; align-items: center; flex: none; }
.trip-wizard__step-circle {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700;
  background: #f3f4f6; color: #6b7280;
  transition: all .3s;
}
@media (min-width: 768px) { .trip-wizard__step-circle { width: 40px; height: 40px; } }

.trip-wizard__step.is-active .trip-wizard__step-circle {
  background: #C41E3A; color: #fff;
  box-shadow: 0 0 0 4px rgba(196,30,58,.2);
}
.trip-wizard__step.is-completed .trip-wizard__step-circle {
  background: #22c55e; color: #fff;
}
.trip-wizard__step.is-completed .trip-wizard__step-circle span { display: none; }
.trip-wizard__step.is-completed .trip-wizard__step-circle::after { content: '✓'; }

.trip-wizard__step-label {
  margin-top: 8px; font-size: .75rem; color: #6b7280;
}
@media (min-width: 768px) { .trip-wizard__step-label { font-size: .85rem; } }
.trip-wizard__step.is-active .trip-wizard__step-label,
.trip-wizard__step.is-completed .trip-wizard__step-label { color: #1a1a2e; font-weight: 500; }

.trip-wizard__step-line { flex: 1; height: 2px; background: #e5e7eb; margin: 0 8px; transition: background .3s; }
@media (min-width: 768px) { .trip-wizard__step-line { margin: 0 16px; } }
.trip-wizard__step-line.is-completed { background: #22c55e; }

/* --- Content --- */
.trip-wizard__content {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px;
  min-height: 300px; background: #fff;
}
@media (min-width: 640px) { .trip-wizard__content { padding: 24px; } }
@media (min-width: 768px) { .trip-wizard__content { padding: 40px; min-height: 400px; } }

/* --- Footer --- */
.trip-wizard__footer {
  flex: none; display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-top: 1px solid #e5e7eb;
  background: #fff; z-index: 10;
}
@media (min-width: 640px) { .trip-wizard__footer { padding: 16px 24px; } }

.tw-footer-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tw-footer-hint { font-size: .75rem; color: #6b7280; margin: 0; }

/* ============================================================
   Shared Components
   ============================================================ */

/* Badge */
.tw-badge {
  display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: #C41E3A;
  background: rgba(196,30,58,.1); padding: 4px 10px; border-radius: 4px;
}

/* Step header */
.tw-step-header { margin-bottom: 32px; }
.tw-step-title { font-family: 'Noto Serif JP', 'Playfair Display', Georgia, serif; font-size: 1.5rem; font-weight: 700; margin: 8px 0; color: #1a1a2e; }
@media (min-width: 768px) { .tw-step-title { font-size: 1.875rem; } }
.tw-step-desc { color: #6b7280; margin: 0; }

/* Field */
.tw-field { margin-bottom: 32px; }
.tw-label { display: block; font-size: 1rem; font-weight: 600; color: #111827; margin-bottom: 12px; }

/* Buttons */
.tw-btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 12px; border: none; cursor: pointer;
  background: #C41E3A; color: #fff; font-weight: 600; font-size: .9rem;
  box-shadow: 0 4px 12px rgba(196,30,58,.2); transition: all .2s;
}
.tw-btn-primary:hover { background: #a8182f; }
.tw-btn-primary--disabled { background: #f3f4f6; color: #6b7280; cursor: not-allowed; box-shadow: none; }
.tw-btn-primary--disabled:hover { background: #f3f4f6; }
.tw-btn-primary--large { padding: 16px 32px; font-size: 1rem; width: 100%; border-radius: 14px; }

.tw-btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 12px; border: 1px solid #e5e7eb; cursor: pointer;
  background: #fff; color: #374151; font-weight: 600; font-size: .85rem; transition: all .2s;
}
.tw-btn-outline:hover { background: #f9fafb; }
.tw-btn-outline--large { padding: 14px 28px; font-size: .95rem; width: 100%; }

.tw-btn-text {
  padding: 12px 24px; border: none; background: transparent; cursor: pointer;
  color: #6b7280; font-weight: 500; border-radius: 12px; transition: background .2s;
}
.tw-btn-text:hover { background: #f3f4f6; }

/* Counter */
.tw-counter { display: inline-block; padding: 6px 14px; border-radius: 99px; font-size: .75rem; font-weight: 700; border: 1px solid #e5e7eb; background: #f3f4f6; color: #6b7280; margin-bottom: 20px; }
.tw-counter--ok { color: #22c55e; }

/* ============================================================
   Step 1: Basics
   ============================================================ */

/* Date row */
.tw-date-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.tw-date-input {
  padding: 12px 16px; border: 1px solid #e5e7eb; border-radius: 12px;
  font-size: .9rem; font-family: inherit; background: #fff;
  transition: border-color .2s, box-shadow .2s; min-width: 180px;
}
.tw-date-input:focus { outline: none; border-color: #C41E3A; box-shadow: 0 0 0 2px rgba(196,30,58,.15); }

.tw-chip--flexible { cursor: pointer; position: relative; }
.tw-chip--flexible input { position: absolute; opacity: 0; pointer-events: none; }
.tw-chip--flexible span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 99px; border: 1px solid #e5e7eb;
  background: #fff; font-size: .85rem; font-weight: 500; transition: all .2s; cursor: pointer;
}
.tw-chip--flexible input:checked + span { background: #C41E3A; color: #fff; border-color: #C41E3A; }
.tw-chip--flexible:hover span { background: #f9fafb; }

/* Presets */
.tw-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tw-preset-btn {
  padding: 6px 14px; border-radius: 99px; border: 1px solid #e5e7eb;
  background: #fff; font-size: .85rem; font-weight: 500; cursor: pointer;
  transition: all .2s; display: inline-flex; align-items: center; gap: 6px;
}
.tw-preset-btn:hover { background: rgba(196,30,58,.05); border-color: rgba(196,30,58,.3); color: #C41E3A; }
.tw-preset-btn.active { border-color: #C41E3A; background: rgba(196,30,58,.05); color: #C41E3A; }
.tw-popular { font-size: .65rem; background: rgba(196,30,58,.1); color: #C41E3A; padding: 2px 8px; border-radius: 99px; }

/* Slider box */
.tw-slider-box { background: #f9fafb; border-radius: 16px; padding: 24px; border: 1px solid #e5e7eb; }
.tw-slider-display { text-align: center; margin-bottom: 16px; }
.tw-slider-val { font-size: 3rem; font-weight: 700; color: #C41E3A; font-family: 'Noto Serif JP', 'Playfair Display', serif; }
.tw-slider-unit { display: block; font-size: .8rem; font-weight: 500; color: #6b7280; text-transform: uppercase; letter-spacing: .1em; margin-top: 4px; }

.tw-range {
  width: 100%; height: 8px; border-radius: 4px; background: #e5e7eb;
  -webkit-appearance: none; appearance: none; cursor: pointer; outline: none; margin-bottom: 8px;
}
.tw-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 3px solid #C41E3A; box-shadow: 0 2px 6px rgba(0,0,0,.15);
  cursor: pointer; transition: transform .15s;
}
.tw-range::-webkit-slider-thumb:hover { transform: scale(1.1); }
.tw-range::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 3px solid #C41E3A; box-shadow: 0 2px 6px rgba(0,0,0,.15); cursor: pointer; }

.tw-range-labels { display: flex; justify-content: space-between; font-size: .75rem; color: #6b7280; }

/* ============================================================
   Step 2: Interests
   ============================================================ */
.tw-interest-chips { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.tw-interest-chip { cursor: pointer; position: relative; }
.tw-interest-chip input { position: absolute; opacity: 0; pointer-events: none; }
.tw-interest-chip__inner {
  display: inline-flex; align-items: center;
  padding: 10px 20px; border-radius: 99px; border: 1px solid #e5e7eb;
  background: #f9fafb; font-size: .85rem; font-weight: 500; transition: all .2s;
}
.tw-interest-chip input:checked + .tw-interest-chip__inner { background: #C41E3A; color: #fff; border-color: #C41E3A; }
.tw-interest-chip:hover .tw-interest-chip__inner { border-color: #C41E3A; background: rgba(196,30,58,.05); }
.tw-interest-chip__emoji { margin-right: 8px; font-size: 1.1rem; }

/* ============================================================
   Step 3: Cities
   ============================================================ */
.tw-city-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (min-width: 768px) { .tw-city-grid { grid-template-columns: repeat(3, 1fr); } }

.tw-city-card { cursor: pointer; position: relative; display: block; }
.tw-city-card input { position: absolute; opacity: 0; pointer-events: none; }
.tw-city-card__inner {
  border: 2px solid #e5e7eb; border-radius: 16px; overflow: hidden;
  background: #fff; transition: all .2s; height: 100%;
}
.tw-city-card input:checked + .tw-city-card__inner { border-color: #C41E3A; }
.tw-city-card:hover .tw-city-card__inner { border-color: #d1d5db; box-shadow: 0 4px 16px rgba(0,0,0,.08); }

.tw-city-card__image {
  position: relative; height: 120px;
  background-size: cover; background-position: center;
}
@media (min-width: 768px) { .tw-city-card__image { height: 140px; } }
.tw-city-card__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.4), transparent);
}
.tw-city-card__check {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border-radius: 50%;
  background: #C41E3A; color: #fff;
  display: none; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; z-index: 2;
}
.tw-city-card input:checked + .tw-city-card__inner .tw-city-card__check { display: flex; }

.tw-city-card__info { padding: 12px 14px; text-align: center; }
.tw-city-card__emoji { font-size: 1.25rem; display: block; margin-bottom: 4px; }
.tw-city-card__info strong { display: block; font-size: .95rem; color: #111827; }
.tw-city-card__info small { display: block; font-size: .75rem; color: #6b7280; margin-top: 2px; }

/* ============================================================
   Step 4: Style
   ============================================================ */
.tw-style-options { display: flex; flex-direction: column; gap: 16px; }

.tw-style-card { cursor: pointer; position: relative; display: block; }
.tw-style-card input { position: absolute; opacity: 0; pointer-events: none; }
.tw-style-card__inner {
  display: flex; align-items: center; gap: 20px;
  padding: 24px; border-radius: 16px; border: 2px solid #e5e7eb;
  background: #fff; transition: all .2s;
}
.tw-style-card input:checked + .tw-style-card__inner { border-color: #C41E3A; background: rgba(196,30,58,.03); }
.tw-style-card:hover .tw-style-card__inner { border-color: #d1d5db; box-shadow: 0 4px 16px rgba(0,0,0,.06); }

.tw-style-card__emoji { font-size: 2.5rem; flex: none; }
.tw-style-card__text { flex: 1; }
.tw-style-card__text strong { display: block; font-size: 1.1rem; color: #111827; margin-bottom: 4px; }
.tw-style-card__text p { font-size: .9rem; color: #6b7280; margin: 0; line-height: 1.5; }

.tw-style-card__radio {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid #d1d5db;
  flex: none; transition: all .2s; position: relative;
}
.tw-style-card input:checked + .tw-style-card__inner .tw-style-card__radio {
  border-color: #C41E3A; background: #C41E3A;
}
.tw-style-card input:checked + .tw-style-card__inner .tw-style-card__radio::after {
  content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 8px; height: 8px; border-radius: 50%; background: #fff;
}

/* ============================================================
   Step 5: Result
   ============================================================ */
.tw-result-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 0; text-align: center; }
.tw-result-loading__spinner {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(196,30,58,.1);
  border: 4px solid transparent; border-top-color: #C41E3A;
  animation: tw-spin 1s linear infinite;
  margin-bottom: 24px;
}
@keyframes tw-spin { to { transform: rotate(360deg); } }
.tw-result-loading h2 { font-family: 'Noto Serif JP', 'Playfair Display', serif; font-size: 1.5rem; margin: 0 0 8px; }
.tw-result-loading p { color: #6b7280; max-width: 400px; margin: 0; }
.tw-result-loading__emojis { display: flex; gap: 16px; margin-top: 32px; font-size: 1.5rem; }
.tw-result-loading__emojis span { animation: tw-bounce .6s ease infinite alternate; }
.tw-result-loading__emojis span:nth-child(2) { animation-delay: .1s; }
.tw-result-loading__emojis span:nth-child(3) { animation-delay: .2s; }
.tw-result-loading__emojis span:nth-child(4) { animation-delay: .3s; }
@keyframes tw-bounce { from { transform: translateY(0); } to { transform: translateY(-12px); } }

/* Result success */
.tw-result-success { text-align: center; margin-bottom: 32px; }
.tw-result-success__icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: #22c55e; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700;
  margin: 0 auto 16px;
}

/* Trip card */
.tw-trip-card {
  border-radius: 16px; overflow: hidden;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  margin-bottom: 24px;
}
.tw-trip-card__image {
  height: 180px;
  background-size: cover; background-position: center;
  position: relative;
}
@media (min-width: 768px) { .tw-trip-card__image { height: 220px; } }
.tw-trip-card__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.5), transparent);
}
.tw-trip-card__badge {
  position: absolute; top: 16px; left: 16px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(4px);
  padding: 6px 14px; border-radius: 99px;
  font-size: .75rem; font-weight: 700; color: #1a1a2e;
}
.tw-trip-card__body { padding: 20px; }
.tw-trip-card__body h3 { font-family: 'Noto Serif JP', 'Playfair Display', serif; font-size: 1.25rem; font-weight: 700; margin: 0 0 4px; color: #1a1a2e; }
.tw-trip-card__meta { font-size: .9rem; color: #6b7280; margin: 0 0 12px; }
.tw-trip-card__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tw-trip-card__tags span { padding: 4px 12px; background: #f3f4f6; border-radius: 99px; font-size: .75rem; color: #374151; font-weight: 500; }

/* Result CTA */
.tw-result-cta { display: flex; flex-direction: column; gap: 12px; }
