/* ============================================================
   灯巡 Design Tokens — LP Master Dashboard
   ============================================================ */

:root {
  /* ---- Core Palette ---- */
  --himeguri-warm-white:  #FAF7F2;
  --himeguri-night-ink:   #1C1C2E;
  --himeguri-lantern-gold:#F5C842;
  --himeguri-en-pink:     #F2A7B0;
  --himeguri-sumi:        #1A1A1A;
  --himeguri-fume:        #4A4A4A;

  /* ---- Extended Palette ---- */
  --himeguri-gold-hover:  #E0B430;
  --himeguri-gold-muted:  #FBE99A;
  --himeguri-ink-light:   #2E2E46;
  --himeguri-ink-border:  #3A3A5A;
  --himeguri-warm-border: #E8E2D8;
  --himeguri-warm-card:   #FFFDF9;
  --himeguri-pink-muted:  #FDEAEC;
  --himeguri-success:     #6BCB77;
  --himeguri-error:       #E07070;

  /* ---- Typography ---- */
  --font-serif:  'Noto Serif JP', 'Times New Roman', serif;
  --font-sans:   'Noto Sans JP', 'Helvetica Neue', sans-serif;

  /* ---- Spacing Scale ---- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ---- Border Radius ---- */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  /* ---- Shadow ---- */
  --shadow-sm:  0 1px 4px rgba(28, 28, 46, 0.08);
  --shadow-md:  0 4px 12px rgba(28, 28, 46, 0.12);
  --shadow-lg:  0 8px 24px rgba(28, 28, 46, 0.16);
  --shadow-gold: 0 2px 12px rgba(245, 200, 66, 0.30);

  /* ---- Transition ---- */
  --transition-fast:   120ms ease;
  --transition-normal: 220ms ease;
}

/* ============================================================
   Base Reset & Typography
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--himeguri-warm-white);
  color: var(--himeguri-sumi);
  line-height: 1.7;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.4;
  font-weight: 700;
}

/* ============================================================
   Component Tokens — Buttons
   ============================================================ */

.btn-primary {
  background-color: var(--himeguri-lantern-gold);
  color: var(--himeguri-sumi);
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.btn-primary:hover {
  background-color: var(--himeguri-gold-hover);
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn-primary:focus-visible {
  outline: 3px solid var(--himeguri-lantern-gold);
  outline-offset: 2px;
}

.btn-secondary {
  background-color: transparent;
  color: var(--himeguri-fume);
  border: 1.5px solid var(--himeguri-warm-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.btn-secondary:hover {
  border-color: var(--himeguri-lantern-gold);
  color: var(--himeguri-sumi);
}

.btn-secondary:focus-visible {
  outline: 3px solid var(--himeguri-lantern-gold);
  outline-offset: 2px;
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--himeguri-fume);
  cursor: pointer;
  font-size: 0.85rem;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.btn-ghost:hover {
  background-color: var(--himeguri-warm-border);
  color: var(--himeguri-sumi);
}

/* ============================================================
   Component Tokens — Cards
   ============================================================ */

.card {
  background-color: var(--himeguri-warm-card);
  border: 1px solid var(--himeguri-warm-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-dark {
  background-color: var(--himeguri-ink-light);
  border: 1px solid var(--himeguri-ink-border);
  color: var(--himeguri-warm-white);
}

/* ============================================================
   Component Tokens — Navigation (Tab Bar)
   ============================================================ */

.tab-nav {
  background-color: var(--himeguri-night-ink);
  border-bottom: 2px solid var(--himeguri-ink-border);
}

.tab-btn {
  background: transparent;
  border: none;
  color: rgba(250, 247, 242, 0.55);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: rgba(250, 247, 242, 0.85);
}

.tab-btn.active {
  color: var(--himeguri-lantern-gold);
  border-bottom-color: var(--himeguri-lantern-gold);
  font-weight: 700;
}

.tab-btn:focus-visible {
  outline: 2px solid var(--himeguri-lantern-gold);
  outline-offset: -2px;
}

/* ============================================================
   Component Tokens — Forms
   ============================================================ */

.form-input,
.form-textarea {
  width: 100%;
  background-color: var(--himeguri-warm-card);
  border: 1.5px solid var(--himeguri-warm-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--himeguri-sumi);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--himeguri-lantern-gold);
  box-shadow: 0 0 0 3px rgba(245, 200, 66, 0.18);
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--himeguri-fume);
  margin-bottom: var(--space-2);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* ============================================================
   Utility — Lantern Gold Accent
   ============================================================ */

.accent-gold {
  color: var(--himeguri-lantern-gold);
}

.bg-night {
  background-color: var(--himeguri-night-ink);
  color: var(--himeguri-warm-white);
}

.bg-warm {
  background-color: var(--himeguri-warm-white);
  color: var(--himeguri-sumi);
}

/* ============================================================
   Copy Button Flash State
   ============================================================ */

.btn-copy-success {
  background-color: var(--himeguri-success) !important;
  color: white !important;
}

/* ============================================================
   Progress Bar (Wizard)
   ============================================================ */

.progress-bar-track {
  background-color: var(--himeguri-warm-border);
  border-radius: var(--radius-full);
  height: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  background-color: var(--himeguri-lantern-gold);
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 300ms ease;
}

/* ============================================================
   LP Preview Sections (Tab C)
   ============================================================ */

.lp-section-dark {
  background-color: var(--himeguri-night-ink);
  color: var(--himeguri-warm-white);
  padding: var(--space-16) var(--space-8);
}

.lp-section-warm {
  background-color: var(--himeguri-warm-white);
  color: var(--himeguri-sumi);
  padding: var(--space-16) var(--space-8);
}

.lp-section-pink {
  background-color: var(--himeguri-pink-muted);
  color: var(--himeguri-sumi);
  padding: var(--space-16) var(--space-8);
}

/* ============================================================
   Scrollbar Styling
   ============================================================ */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--himeguri-warm-border);
}

::-webkit-scrollbar-thumb {
  background: var(--himeguri-fume);
  border-radius: var(--radius-full);
}

/* ============================================================
   Step Indicator (Tab 1 — オーダーフォーム)
   ============================================================ */

.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-8);
  overflow-x: auto;
  scrollbar-width: none;
}
.step-indicator::-webkit-scrollbar { display: none; }

.step-indicator-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--himeguri-warm-border);
  color: var(--himeguri-fume);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.step-label {
  font-size: .72rem;
  color: var(--himeguri-fume);
  white-space: nowrap;
  font-weight: 500;
}

.step-indicator-item.active .step-dot {
  background: var(--himeguri-lantern-gold);
  color: var(--himeguri-sumi);
}

.step-indicator-item.active .step-label {
  color: var(--himeguri-sumi);
  font-weight: 700;
}

.step-indicator-item.done .step-dot {
  background: var(--himeguri-success);
  color: white;
}

.step-connector {
  height: 2px;
  width: 28px;
  background: var(--himeguri-warm-border);
  flex-shrink: 0;
  margin-bottom: 20px;
}

/* ============================================================
   Form Layout Additions
   ============================================================ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.form-row {
  flex-direction: row;
  gap: var(--space-4);
}

.step-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--himeguri-warm-border);
}

.req {
  color: var(--himeguri-error);
  font-weight: 700;
}

.opt {
  font-size: .75rem;
  font-weight: 400;
  color: var(--himeguri-fume);
  margin-left: 4px;
}

.char-hint {
  font-size: .72rem;
  font-weight: 400;
  color: var(--himeguri-fume);
  margin-left: 4px;
}

.char-count {
  font-size: .72rem;
  color: var(--himeguri-fume);
  text-align: right;
}

/* ============================================================
   Radio Group
   ============================================================ */

.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.radio-group-row {
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.radio-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--himeguri-warm-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: .875rem;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.radio-label input[type="radio"] {
  accent-color: var(--himeguri-lantern-gold);
  width: 16px;
  height: 16px;
}

.radio-label:hover,
.radio-label.selected {
  border-color: var(--himeguri-lantern-gold);
  background: rgba(245, 200, 66, 0.06);
}

/* ============================================================
   Color Picker Row
   ============================================================ */

.color-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.color-input {
  width: 44px;
  height: 38px;
  padding: 2px;
  border: 1.5px solid var(--himeguri-warm-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: transparent;
  flex-shrink: 0;
}

/* ============================================================
   Live Preview Panel (Tab 1 右パネル)
   ============================================================ */

.preview-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--himeguri-warm-border);
  font-family: var(--font-sans);
  font-size: .8rem;
}

.preview-hero {
  background: var(--preview-ink, #1C1C2E);
  color: #FAF7F2;
  padding: 20px;
}

.preview-sec-label {
  font-size: .62rem;
  letter-spacing: 1.5px;
  opacity: .5;
  margin-bottom: 8px;
}

.preview-h1 {
  font-family: var(--font-serif);
  font-size: .95rem;
  line-height: 1.5;
  margin-bottom: 8px;
  font-weight: 700;
}

.preview-sub {
  font-size: .75rem;
  opacity: .8;
  line-height: 1.6;
  margin-bottom: 12px;
}

.preview-cta-btn {
  display: inline-block;
  background: var(--preview-primary, #F5C842);
  color: #1A1A1A;
  font-weight: 700;
  font-size: .75rem;
  padding: 7px 16px;
  border-radius: 6px;
}

.preview-block {
  padding: 14px 20px;
  border-top: 1px solid var(--himeguri-warm-border);
  background: var(--himeguri-warm-white);
}

.preview-mini-h {
  font-weight: 700;
  font-size: .78rem;
  margin-bottom: 6px;
  color: var(--himeguri-sumi);
}

.preview-pain-item {
  font-size: .74rem;
  color: var(--himeguri-error);
  padding: 3px 0;
}

.preview-future-item {
  font-size: .74rem;
  color: var(--himeguri-success);
  padding: 3px 0;
}

.preview-cta-section {
  background: var(--himeguri-gold-muted);
}

.preview-poem {
  font-family: var(--font-serif);
  font-size: .72rem;
  opacity: .7;
  margin-bottom: 8px;
}

.preview-price {
  font-size: .7rem;
  opacity: .55;
  margin-top: 6px;
}

.preview-empty {
  font-size: .74rem;
  color: var(--himeguri-fume);
  opacity: .6;
}

.preview-empty-full {
  padding: 32px 20px;
  text-align: center;
  font-size: .8rem;
  color: var(--himeguri-fume);
}

/* ============================================================
   Draft notice flash
   ============================================================ */

.draft-notice {
  font-size: .8rem;
  color: var(--himeguri-success);
  font-weight: 600;
  padding: 6px 12px;
  background: rgba(107, 203, 119, 0.12);
  border-radius: var(--radius-sm);
  border: 1px solid var(--himeguri-success);
}

/* ============================================================
   Error notice (step form)
   ============================================================ */

.step-error {
  color: var(--himeguri-error);
  font-size: .875rem;
  padding: 10px 14px;
  background: #fdeaea;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}

/* ============================================================
   LP iframe preview (Tab 2)
   ============================================================ */

.lp-iframe {
  width: 100%;
  height: calc(100vh - 200px);
  min-height: 500px;
  border: none;
  border-radius: var(--radius-lg);
  background: white;
}

/* ============================================================
   判断分岐ウィザード (Tab 0)
   ============================================================ */

/* 3カラムレイアウト */
.wizard-layout {
  display: grid;
  grid-template-columns: 200px 1fr 280px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .wizard-layout {
    grid-template-columns: 1fr;
  }
  .wizard-sidebar,
  .wizard-summary-col {
    display: none;
  }
}

/* 左サイドバー — ラウンドナビ */
.wizard-sidebar {
  position: sticky;
  top: 24px;
}

.wizard-round-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wizard-round-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--himeguri-warm-border);
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: .82rem;
  color: var(--himeguri-fume);
  text-align: left;
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.wizard-round-btn:hover {
  border-color: var(--himeguri-lantern-gold);
  color: var(--himeguri-sumi);
}

.wizard-round-btn.active {
  border-color: var(--himeguri-lantern-gold);
  background: rgba(245, 200, 66, 0.08);
  color: var(--himeguri-sumi);
  font-weight: 700;
}

.wizard-round-btn.done {
  border-color: var(--himeguri-success);
  background: rgba(107, 203, 119, 0.07);
  color: var(--himeguri-sumi);
}

.wizard-round-dot {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--himeguri-warm-border);
  color: var(--himeguri-fume);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .68rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.wizard-round-btn.active .wizard-round-dot {
  background: var(--himeguri-lantern-gold);
  color: var(--himeguri-sumi);
}

.wizard-round-btn.done .wizard-round-dot {
  background: var(--himeguri-success);
  color: white;
}

/* 進捗バー（サイドバー下） */
.wizard-progress-wrap {
  margin-top: 20px;
  padding: var(--space-4);
  background: var(--himeguri-warm-card);
  border: 1px solid var(--himeguri-warm-border);
  border-radius: var(--radius-md);
}

.wizard-progress-label {
  font-size: .72rem;
  color: var(--himeguri-fume);
  margin-bottom: var(--space-2);
  display: flex;
  justify-content: space-between;
}

/* 中央 — 質問エリア */
.wizard-round-section {
  scroll-margin-top: 120px;
}

.wizard-round-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--himeguri-warm-border);
}

.wizard-round-badge {
  background: var(--himeguri-night-ink);
  color: var(--himeguri-lantern-gold);
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 1px;
}

.wizard-round-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
}

/* 質問カード */
.wizard-question-card {
  background: var(--himeguri-warm-card);
  border: 1.5px solid var(--himeguri-warm-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  transition: border-color var(--transition-normal);
}

.wizard-question-card.answered {
  border-color: rgba(107, 203, 119, 0.4);
}

.wizard-question-num {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--himeguri-fume);
  margin-bottom: 6px;
}

.wizard-question-text {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--himeguri-sumi);
}

/* ウィザードのラジオオプション */
.wizard-option-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--himeguri-warm-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: .875rem;
  line-height: 1.5;
  margin-bottom: 6px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  background: white;
}

.wizard-option-label:last-child {
  margin-bottom: 0;
}

.wizard-option-label:hover {
  border-color: var(--himeguri-lantern-gold);
  background: rgba(245, 200, 66, 0.05);
}

.wizard-option-label.selected {
  border-color: var(--himeguri-lantern-gold);
  background: rgba(245, 200, 66, 0.08);
}

.wizard-option-label input[type="radio"] {
  accent-color: var(--himeguri-lantern-gold);
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
}

/* 推奨バッジ */
.wizard-recommended-badge {
  display: inline-block;
  background: rgba(245, 200, 66, 0.2);
  color: #7a6000;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-left: 6px;
  white-space: nowrap;
  vertical-align: middle;
  flex-shrink: 0;
}

/* カスタムHEX入力 */
.wizard-hex-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  margin-left: 26px;
}

.wizard-hex-input {
  width: 120px;
  padding: 5px 10px;
  border: 1.5px solid var(--himeguri-warm-border);
  border-radius: var(--radius-md);
  font-size: .85rem;
  font-family: var(--font-sans);
  color: var(--himeguri-sumi);
  background: white;
  outline: none;
  transition: border-color var(--transition-fast);
}

.wizard-hex-input:focus {
  border-color: var(--himeguri-lantern-gold);
}

.wizard-hex-swatch {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--himeguri-warm-border);
  flex-shrink: 0;
}

/* 右カラム — 回答サマリー */
.wizard-summary-col {
  position: sticky;
  top: 24px;
}

.wizard-summary-card {
  background: var(--himeguri-warm-card);
  border: 1px solid var(--himeguri-warm-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
}

.wizard-summary-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--himeguri-fume);
  margin-bottom: 12px;
}

.wizard-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid var(--himeguri-warm-border);
  font-size: .78rem;
}

.wizard-summary-item:last-child {
  border-bottom: none;
}

.wizard-summary-qid {
  font-weight: 700;
  color: var(--himeguri-fume);
  flex-shrink: 0;
}

.wizard-summary-val {
  color: var(--himeguri-sumi);
  text-align: right;
  line-height: 1.4;
}

.wizard-summary-val.empty {
  color: var(--himeguri-warm-border);
}

/* サマリーアクションボタン */
.wizard-summary-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

/* 「Tab 2 に反映」ボタン */
.wizard-apply-btn {
  width: 100%;
  justify-content: center;
  opacity: 0.45;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.wizard-apply-btn.ready {
  opacity: 1;
  pointer-events: auto;
}

/* ラウンド区切り */
.wizard-round-divider {
  height: 32px;
}
