/* ==========================================================================
   wizard.css — Collaboration wizard overlay
   ========================================================================== */

.wizard {
  position: fixed; inset: 0; z-index: var(--z-wizard);
  background: rgba(28, 27, 25, 0.4);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: var(--space-4);
  opacity: 0; visibility: hidden; transition: opacity var(--speed) var(--ease), visibility var(--speed) var(--ease);
}
.wizard.is-open { opacity: 1; visibility: visible; }

.wizard__dialog {
  width: 100%; max-width: 620px; max-height: 92vh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; transform: translateY(16px) scale(0.98);
  transition: transform var(--speed) var(--ease-out);
}
.wizard.is-open .wizard__dialog { transform: none; }

.wizard__top { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); }
.wizard__progress { flex: 1; height: 6px; background: var(--line); border-radius: var(--radius-pill); overflow: hidden; }
.wizard__progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-dark)); border-radius: var(--radius-pill); transition: width var(--speed) var(--ease); }
html[dir="rtl"] .wizard__progress-fill { background: linear-gradient(270deg, var(--accent), var(--accent-dark)); }
.wizard__step-count { font-size: var(--fs-caption); color: var(--text-subtle); font-weight: var(--fw-semibold); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wizard__close { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--text-muted); }
.wizard__close:hover { background: var(--bg-soft); color: var(--text); }

.wizard__body { padding: var(--space-7) var(--space-6); overflow-y: auto; }
.wizard__body h2 { font-size: var(--fs-h3); margin-bottom: var(--space-2); }
.wizard__body .step-help { font-size: var(--fs-small); color: var(--text-muted); margin-bottom: var(--space-5); }
.wizard__body .step-hint {
  margin-top: var(--space-4); padding: var(--space-3) var(--space-4);
  background: var(--color-accent-soft); border-radius: var(--radius-sm);
  font-size: var(--fs-caption); color: var(--accent-dark);
}

/* Step transition */
.wizard-step { animation: stepIn var(--speed) var(--ease); }

/* Option cards / choices */
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
.choice {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4); border: 1.5px solid var(--line); border-radius: var(--radius-md);
  font-weight: var(--fw-medium); font-size: var(--fs-small); text-align: start; cursor: pointer;
  transition: border-color var(--speed) var(--ease), background-color var(--speed) var(--ease), transform var(--speed-fast) var(--ease);
}
.choice:hover { border-color: var(--accent); transform: translateY(-2px); }
.choice.is-selected { border-color: var(--accent); background: var(--color-accent-soft); }
.choice .choice-emoji { font-size: 1.25rem; }
.choice .choice-ico { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--tint-pink); color: var(--ig-magenta); flex: none; }
.choice .choice-ico svg { width: 20px; height: 20px; }
.choice.is-selected .choice-ico { background: #fff; }
.choice .choice-logo { width: 34px; height: 34px; border-radius: 9px; object-fit: contain; flex: none; }
.choice--all { grid-column: 1 / -1; justify-content: center; background: var(--tint-purple); border-color: var(--ig-purple); }

/* Format picker with quantity steppers */
.fmt-group { margin-bottom: var(--space-4); }
.fmt-head { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-small); color: var(--text-muted); margin-bottom: var(--space-2); }
.fmt-head img { border-radius: 6px; object-fit: contain; }
.fmt-row {
  display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 4px 8px 4px 4px;
  transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.fmt-row.is-selected { border-color: var(--ig-pink); background: var(--tint-pink); }
.fmt-pick { flex: 1; display: flex; align-items: center; gap: var(--space-3); padding: 8px; font-family: inherit; font-size: var(--fs-small); font-weight: var(--fw-medium); text-align: start; color: var(--text); }
.fmt-pick .choice-check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; color: #fff; flex: none; font-size: 12px; }
.fmt-row.is-selected .fmt-pick .choice-check { background: var(--ig-pink); border-color: var(--ig-pink); }
.qty { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.qty-btn { width: 30px; height: 30px; border-radius: 8px; background: #fff; border: 1.5px solid var(--line); font-size: 1.1rem; font-weight: 700; color: var(--ig-magenta); display: grid; place-items: center; }
.qty-btn:hover { border-color: var(--ig-pink); }
.qty-val { min-width: 26px; text-align: center; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.choice .choice-check { margin-inline-start: auto; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; color: #fff; flex: none; }
.choice.is-selected .choice-check { background: var(--accent); border-color: var(--accent); }

/* Flag grid (country picker) */
.flag-grid { display:grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); }
.flag-choice {
  display:flex; flex-direction:column; align-items:center; gap: 4px;
  padding: var(--space-3) var(--space-2); border:1.5px solid var(--line); border-radius: var(--radius-sm);
  cursor:pointer; font-family:inherit; font-size: var(--fs-caption); font-weight: var(--fw-medium); color: var(--text);
  transition: border-color var(--speed) var(--ease), transform var(--speed-fast) var(--ease), background var(--speed) var(--ease);
}
.flag-choice:hover { border-color: var(--ig-pink); transform: translateY(-2px); }
.flag-choice.is-selected { border-color: var(--ig-pink); background: var(--tint-pink); }
.flag-choice .fl { font-size: 1.9rem; line-height:1; }
.flag-choice--india { grid-column: 1 / -1; flex-direction:row; justify-content:center; gap: var(--space-3); padding: var(--space-4); background: var(--tint-orange); border-color: var(--ig-amber); }
.flag-choice--india .fl { font-size: 2.2rem; }
.flag-choice--india .in-label { font-size: var(--fs-body); font-weight: var(--fw-bold); }
.flag-choice--india .in-sub { font-size: var(--fs-caption); color: var(--text-subtle); font-weight: var(--fw-regular); }

/* Form fields */
.field { margin-bottom: var(--space-4); }
.field label { display: block; font-size: var(--fs-small); font-weight: var(--fw-medium); margin-bottom: var(--space-2); }
.field label .opt { color: var(--text-subtle); font-weight: var(--fw-regular); }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.75rem 1rem; min-height: 48px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--bg);
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.field textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.field.has-error input, .field.has-error select { border-color: #C0553E; }
.field .error-msg { color: #C0553E; font-size: var(--fs-caption); margin-top: 4px; }
.field .char-count { text-align: end; font-size: var(--fs-caption); color: var(--text-subtle); margin-top: 4px; }

.radio-list { display: grid; gap: var(--space-2); }
.radio-list label { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-size: var(--fs-small); transition: border-color var(--speed) var(--ease); }
.radio-list label:has(input:checked) { border-color: var(--accent); background: var(--color-accent-soft); }
.radio-list input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Review summary */
.review-list { display: grid; gap: var(--space-2); }
.review-row { display: grid; grid-template-columns: 140px 1fr; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-small); }
.review-row dt { color: var(--text-subtle); }
.review-row dd { font-weight: var(--fw-medium); }

/* Success */
.wizard-success { text-align: center; padding: var(--space-6) 0; }
.success-check { width: 84px; height: 84px; margin: 0 auto var(--space-5); }
.success-check circle { stroke: var(--success); stroke-width: 4; fill: none; stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 0.6s var(--ease-out) forwards; }
.success-check path { stroke: var(--success); stroke-width: 5; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw 0.4s 0.5s var(--ease-out) forwards; }

/* Footer nav of the wizard */
.wizard__nav { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-6) var(--space-6); border-top: 1px solid var(--line); }
.wizard__nav .btn--ghost .arrow { display: inline-block; }
html[dir="rtl"] .wizard__nav .arrow { transform: scaleX(-1); }
