/*
 * Onboarding wizard overlay.
 * Ported from specs/v2-profile-prototype-APR-23.html (v7), translated to tokens
 * from tokens.css. Shown/hidden via .open class on .wizard-overlay.
 */

.wizard-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(26, 24, 21, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.wizard-overlay.open { display: flex; }

.wizard {
  background: var(--ugf-bg-primary);
  border-radius: 14px;
  width: 100%;
  max-width: 540px;
  padding: 2rem 2rem 1.5rem;
  box-shadow: 0 20px 60px rgba(26, 24, 21, 0.25);
}

.wizard-header { margin-bottom: 1.25rem; }
.wizard-header h2 {
  margin: 0 0 0.375rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ugf-ink);
}
.wizard-header p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ugf-text-secondary);
}

.wizard-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 1.25rem;
}
.wizard-dot {
  flex: 1;
  height: 3px;
  background: var(--ugf-border);
  border-radius: 999px;
}
.wizard-dot.active { background: var(--ugf-accent); }

.wizard-step { display: none; }
.wizard-step.active { display: block; }

.wizard-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ugf-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.wizard-question {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.875rem;
  line-height: 1.4;
  color: var(--ugf-ink);
}
.wizard-hint {
  font-size: 0.8125rem;
  color: var(--ugf-text-secondary);
  margin-bottom: 0.875rem;
}

.wizard-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.wizard-opt {
  padding: 0.75rem 1rem;
  background: var(--ugf-surface);
  border: 1px solid var(--ugf-border);
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
  text-align: left;
  color: var(--ugf-ink);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
}
.wizard-opt:hover {
  border-color: var(--ugf-accent);
  background: var(--ugf-accent-tint);
}
.wizard-opt.selected {
  background: var(--ugf-accent-tint);
  border-color: var(--ugf-accent);
  color: var(--ugf-accent);
  font-weight: 500;
}
.wizard-opt.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.wizard-opt-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--ugf-border);
  flex-shrink: 0;
}
.wizard-opt.selected .wizard-opt-check {
  border-color: var(--ugf-accent);
  background: var(--ugf-accent);
}
.wizard-opt.selected .wizard-opt-check::after {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  margin: 3px;
}

.wizard-field-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.625rem;
  margin-bottom: 0.875rem;
}
.wizard-input {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--ugf-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9375rem;
  background: var(--ugf-surface);
  color: var(--ugf-ink);
  width: 100%;
}
.wizard-sublabel {
  display: block;
  font-size: 0.75rem;
  color: var(--ugf-text-secondary);
  margin-bottom: 0.3rem;
  font-weight: 500;
}
.wizard-visa-sub {
  margin-top: 0.625rem;
  display: none;
}
.wizard-visa-sub.open { display: block; }

.wizard-smallprint {
  margin: 0.875rem 0 0;
  padding-left: 1rem;
  font-size: 0.75rem;
  color: var(--ugf-text-muted);
  font-style: italic;
  line-height: 1.45;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.875rem;
  border-top: 1px solid var(--ugf-border);
  margin-top: 1rem;
}

/* Local copies of the prototype's btn-primary / btn-ghost.
   Keep scoped to .wizard so other tickets can pick their own button system. */
.wizard .btn-primary {
  padding: 0.625rem 1.25rem;
  background: var(--ugf-accent);
  color: var(--ugf-bg-primary);
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}
.wizard .btn-primary:hover { background: var(--ugf-accent-ink); }
.wizard .btn-ghost {
  padding: 0.625rem 1rem;
  background: transparent;
  border: none;
  color: var(--ugf-text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

/* ---------- Step 1: upload / paste (T12) ---------- */

.wizard-dropzone {
  position: relative;
  border: 2px dashed var(--ugf-border);
  border-radius: 10px;
  background: var(--ugf-surface);
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 80ms ease, background-color 80ms ease;
  margin-bottom: 0.625rem;
}
.wizard-dropzone:hover,
.wizard-dropzone:focus-visible {
  border-color: var(--ugf-accent);
  background: var(--ugf-accent-tint);
  outline: none;
}
.wizard-dropzone.dragover {
  border-color: var(--ugf-accent);
  background: var(--ugf-accent-tint);
}
.wizard-dropzone.has-file {
  border-style: solid;
  border-color: var(--ugf-accent);
  background: var(--ugf-accent-tint);
}
.wizard-dropzone-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 0.375rem;
  color: var(--ugf-text-secondary);
}
.wizard-dropzone.has-file .wizard-dropzone-icon { color: var(--ugf-accent); }
.wizard-dropzone-primary {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ugf-ink);
  margin-bottom: 0.125rem;
  word-break: break-all;
}
.wizard-dropzone-browse {
  color: var(--ugf-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.wizard-dropzone-secondary {
  font-size: 0.75rem;
  color: var(--ugf-text-secondary);
}
.wizard-file-input {
  /* Hidden but still focusable via label click. */
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.wizard-paste-toggle {
  background: transparent;
  border: none;
  color: var(--ugf-accent);
  font-family: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 0.25rem 0;
  margin-bottom: 0.25rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.wizard-paste-toggle:hover { color: var(--ugf-accent-ink); }

.wizard-paste {
  display: none;
  margin-bottom: 0.5rem;
}
.wizard-paste.open { display: block; }
.wizard-textarea {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
  line-height: 1.45;
}

.wizard-upload-status {
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--ugf-text-secondary);
  background: var(--ugf-surface);
  border-radius: 8px;
  border: 1px solid var(--ugf-border);
}

.wizard-upload-error {
  margin: 0.5rem 0;
  padding: 0.625rem 0.75rem;
  font-size: 0.8125rem;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
}
.wizard-upload-error-text { display: block; margin-bottom: 0.375rem; }
.wizard-upload-error-actions {
  display: flex;
  gap: 0.5rem;
}
.wizard-upload-error-actions .btn-ghost {
  padding: 0.25rem 0.5rem;
  color: #991b1b;
  font-weight: 500;
}

@media (max-width: 640px) {
  .wizard { padding: 1.25rem 1rem; }
  .wizard-field-row { grid-template-columns: 1fr; }
  .wizard-dropzone { padding: 1rem 0.75rem; }
}
