/*
 * Dataque brand base for the onboarding pages (client wizard + admin section).
 * Tokens follow the Dataque site and docs/onboarding/dataque: Switzer,
 * black on white/#f5f5f5, greys #545454 / #828282, one green accent.
 * Everything is prefixed `dq-` so it can live inside admin.html next to Tailwind.
 */

@font-face {
  font-family: 'Switzer';
  src: url('/onboarding/assets/Switzer-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Switzer';
  src: url('/onboarding/assets/Switzer-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

.dq {
  --dq-ink: #000000;
  --dq-text: #000000;
  --dq-graphite: #545454;
  --dq-muted: #828282;
  --dq-faint: #b8b8b8;
  --dq-line: #e2e2e2;
  --dq-line-soft: #eeeeee;
  --dq-page: #f5f5f5;
  --dq-surface: #ffffff;
  --dq-green: #12b33f;
  --dq-green-ink: #0b7a2a;
  --dq-green-wash: #e9f7ed;
  --dq-amber: #a15c00;
  --dq-amber-wash: #fff4e0;
  --dq-red: #c0392b;
  --dq-red-wash: #fdeceb;
  --dq-radius-sm: 8px;
  --dq-radius: 12px;
  --dq-radius-lg: 18px;
  --dq-font: 'Switzer', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  font-family: var(--dq-font);
  font-weight: 500;
  color: var(--dq-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
  line-height: 1.5;
}
.dq *,
.dq *::before,
.dq *::after {
  box-sizing: border-box;
}

/* Type */
.dq-h1 {
  font-size: clamp(30px, 4.2vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 500;
  margin: 0;
}
.dq-h2 {
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 500;
  margin: 0;
}
.dq-h3 {
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin: 0;
}
.dq-lede {
  font-size: 17px;
  line-height: 1.5;
  color: var(--dq-graphite);
  margin: 0;
  max-width: 38em;
}
.dq-small {
  font-size: 13px;
  line-height: 1.45;
  color: var(--dq-muted);
}
.dq-muted {
  color: var(--dq-muted);
}
.dq-rule {
  width: 36px;
  height: 3px;
  border: 0;
  margin: 0;
  background: var(--dq-green);
}

/* Buttons */
.dq-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--dq-ink);
  background: var(--dq-ink);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.dq-btn:hover {
  background: #262626;
  border-color: #262626;
}
.dq-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.dq-btn--ghost {
  background: transparent;
  color: var(--dq-ink);
  border-color: var(--dq-line);
}
.dq-btn--ghost:hover {
  background: var(--dq-page);
  border-color: var(--dq-faint);
}
.dq-btn--quiet {
  background: transparent;
  color: var(--dq-ink);
  border-color: transparent;
  padding: 0 12px;
}
.dq-btn--quiet:hover {
  background: var(--dq-page);
  border-color: transparent;
}
.dq-btn--danger {
  background: var(--dq-red);
  border-color: var(--dq-red);
}
.dq-btn--danger:hover {
  background: #a33024;
  border-color: #a33024;
}
.dq-btn--sm {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
}
.dq-link {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--dq-ink);
  text-decoration: underline;
  text-decoration-color: var(--dq-faint);
  text-underline-offset: 3px;
  cursor: pointer;
}
.dq-link:hover {
  text-decoration-color: var(--dq-ink);
}

/* Focus */
.dq :focus-visible {
  outline: 2px solid var(--dq-ink);
  outline-offset: 2px;
}

/* Inputs */
.dq-input,
.dq-select,
.dq-textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--dq-line);
  border-radius: var(--dq-radius-sm);
  background: var(--dq-surface);
  color: var(--dq-ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dq-textarea {
  min-height: 104px;
  resize: vertical;
}
.dq-input::placeholder,
.dq-textarea::placeholder {
  color: var(--dq-faint);
}
.dq-input:hover,
.dq-select:hover,
.dq-textarea:hover {
  border-color: var(--dq-faint);
}
.dq-input:focus,
.dq-select:focus,
.dq-textarea:focus {
  outline: none;
  border-color: var(--dq-ink);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}
.dq-input:disabled,
.dq-textarea:disabled,
.dq-select:disabled {
  background: var(--dq-page);
  color: var(--dq-graphite);
}
.dq-select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%23545454' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.dq-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px;
}

/* Choice rows (radio / checkbox) */
.dq-choices {
  display: grid;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0;
}
.dq-choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--dq-line);
  border-radius: var(--dq-radius-sm);
  background: var(--dq-surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.dq-choice:hover {
  border-color: var(--dq-faint);
}
.dq-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.dq-choice__mark {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 1.5px solid var(--dq-faint);
  background: #fff;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}
.dq-choice__mark--radio {
  border-radius: 50%;
}
.dq-choice__mark--check {
  border-radius: 5px;
}
.dq-choice.is-on {
  border-color: var(--dq-ink);
  background: #fafafa;
}
.dq-choice.is-on .dq-choice__mark {
  border-color: var(--dq-ink);
  background: var(--dq-ink);
}
.dq-choice.is-on .dq-choice__mark--radio::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}
.dq-choice.is-on .dq-choice__mark--check::after {
  content: '';
  width: 9px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translateY(-1px) rotate(-45deg);
}
.dq-choice:has(input:focus-visible) {
  outline: 2px solid var(--dq-ink);
  outline-offset: 2px;
}
.dq-choice.is-disabled {
  cursor: default;
  opacity: 0.7;
}

/* Segmented control */
.dq-seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: var(--dq-page);
  border: 1px solid var(--dq-line-soft);
}
.dq-seg button {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--dq-graphite);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.dq-seg button[aria-pressed='true'] {
  background: #fff;
  color: var(--dq-ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Pills / status */
.dq-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--dq-page);
  color: var(--dq-graphite);
  white-space: nowrap;
}
.dq-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}
.dq-pill--plain::before {
  display: none;
}
.dq-pill--green {
  background: var(--dq-green-wash);
  color: var(--dq-green-ink);
}
.dq-pill--amber {
  background: var(--dq-amber-wash);
  color: var(--dq-amber);
}
.dq-pill--red {
  background: var(--dq-red-wash);
  color: var(--dq-red);
}
.dq-pill--ink {
  background: var(--dq-ink);
  color: #fff;
}

/* Progress bar */
.dq-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--dq-line-soft);
  overflow: hidden;
}
.dq-bar > span {
  display: block;
  height: 100%;
  background: var(--dq-ink);
  border-radius: inherit;
  transition: width 0.4s ease;
}
.dq-bar.is-done > span {
  background: var(--dq-green);
}

/* Spinner */
.dq-spin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: dq-spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes dq-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Toast */
.dq-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 80;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--dq-ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}
.dq-toast.is-error {
  background: var(--dq-red);
}

/* Modal */
.dq-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.42);
  display: grid;
  place-items: center;
  padding: 16px;
}
.dq-modal {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: var(--dq-radius-lg);
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}
.dq-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.dq-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .dq *,
  .dq *::before,
  .dq *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
