/* Production runtime overrides for the v2 account UI. */
.legal-checks {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.legal-checks label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.legal-checks input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
  accent-color: var(--brand);
}

.legal-checks a {
  color: var(--brand-dark);
}

.home-trial {
  margin: 14px 0;
}

.toast.error {
  border-color: #f7c8c4;
  color: var(--danger);
  background: var(--danger-soft);
}

.manual {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.manual summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 750;
}

/* Connection wizard polish. Keep the API flow unchanged; only refine layout. */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.modal-backdrop {
  align-items: center;
  padding: clamp(10px, 2.5vw, 24px);
  background: rgba(24, 34, 54, .68);
  backdrop-filter: blur(9px);
}

.modal {
  display: flex;
  width: min(100%, 620px);
  max-height: min(760px, calc(100dvh - 20px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, .92);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, .34);
}

.modal-head {
  position: static;
  flex: 0 0 auto;
  padding: 20px 24px 17px;
  border-bottom: 1px solid #e8edf4;
  background: rgba(255, 255, 255, .98);
  backdrop-filter: none;
}

.modal-head .eyebrow {
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .075em;
}

.modal-head h2 {
  color: #172033;
  font-size: clamp(21px, 4vw, 26px);
  font-weight: 820;
  line-height: 1.15;
  letter-spacing: -.025em;
}

.modal-close {
  width: 44px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #64748b;
  background: #f3f6fa;
  font-size: 24px;
  line-height: 1;
  transition: border-color .16s, background .16s, color .16s, transform .16s;
}

.modal-close:hover {
  border-color: #dbe3ee;
  color: #334155;
  background: #eef2f7;
}

.modal-close:active {
  transform: scale(.97);
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 24px 22px;
  scrollbar-color: #c9d1dc transparent;
  scrollbar-width: thin;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c9d1dc;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #aeb8c6;
}

.stepper {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 22px;
  padding: 0 4px;
}

.stepper::before {
  position: absolute;
  z-index: 0;
  top: 11px;
  right: 16.666%;
  left: 16.666%;
  height: 2px;
  border-radius: 999px;
  background: #e2e8f0;
  content: "";
}

.stepper span {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 7px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 680;
  line-height: 1.2;
  text-align: center;
}

.stepper span::before {
  display: block;
  width: 22px;
  height: 22px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px #fff;
  content: "";
}

.stepper span.active {
  color: var(--brand);
  font-weight: 820;
}

.stepper span.active::before {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: inset 0 0 0 5px #fff, 0 0 0 4px #fff, 0 0 0 6px rgba(40, 88, 232, .12);
}

.modal-body > .form-field {
  gap: 10px;
  margin-bottom: 22px;
}

.modal-body > .form-field > .field-label {
  color: #475569;
  font-size: 12px;
  font-weight: 820;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.modal-body > .form-field .option-grid {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
}

.modal-body > .option-grid {
  gap: 10px;
}

.modal-body > .option-grid:has([data-platform]) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.modal-body > .option-grid:has([data-client]) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option-card {
  position: relative;
  display: flex;
  min-height: 136px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 13px;
  border: 1px solid #dfe6ef;
  border-radius: 18px;
  color: #172033;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .02);
  font-synthesis: none;
  transition: border-color .16s, background .16s, box-shadow .16s, transform .16s;
}

.modal-body > .form-field .option-card {
  min-height: 118px;
  padding-block: 14px;
}

.option-card:hover {
  border-color: #b9c9ed;
  background: #fbfcff;
  box-shadow: 0 8px 22px rgba(33, 52, 91, .07);
  transform: translateY(-1px);
}

.option-card.selected {
  border-color: #6f91f3;
  background: #f8faff;
  box-shadow: 0 0 0 3px rgba(40, 88, 232, .10), 0 8px 22px rgba(33, 52, 91, .06);
}

.option-card.selected::after {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  content: "✓";
  font-size: 11px;
  font-weight: 900;
}

.option-card .option-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 11px;
  border-radius: 15px;
  background: #edf2ff;
  font-size: 22px;
  font-weight: 850;
}

.modal-body > .form-field .option-card .option-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 9px;
  border-radius: 13px;
  font-size: 18px;
}

.option-card strong {
  max-width: 100%;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.012em;
  overflow-wrap: anywhere;
}

.option-card span:not(.option-icon) {
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  flex: 0 0 auto;
  margin: 0;
  padding: 14px 24px calc(14px + var(--safe-bottom));
  border-top: 1px solid #e8edf4;
  background: rgba(255, 255, 255, .98);
}

.modal-actions > :only-child {
  grid-column: 1 / -1;
}

.modal-actions .button {
  min-height: 48px;
  border-radius: 14px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 780;
}

.modal-actions .button.ghost {
  border: 1px solid #e2e8f0;
  color: #475569;
  background: #f6f8fb;
}

.modal-actions .button.ghost:hover {
  border-color: #d5dde8;
  background: #eef2f7;
  filter: none;
}

@media (max-width: 560px) {
  .modal-backdrop {
    padding: 8px;
  }

  .modal {
    max-height: calc(100dvh - 16px);
    border-radius: 23px;
  }

  .modal-head {
    padding: 18px 17px 15px;
  }

  .modal-close {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .modal-body {
    padding: 16px 17px 18px;
  }

  .modal-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px 17px calc(12px + var(--safe-bottom));
  }

  .modal-body > .option-grid:has([data-platform]),
  .modal-body > .option-grid:has([data-client]) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-body > .form-field .option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .option-card,
  .modal-body > .form-field .option-card {
    min-height: 122px;
    padding: 14px 10px;
  }

  .option-card .option-icon,
  .modal-body > .form-field .option-card .option-icon {
    width: 46px;
    height: 46px;
    margin-bottom: 9px;
    border-radius: 14px;
    font-size: 20px;
  }
}

@media (max-width: 350px) {
  .modal-head h2 {
    font-size: 20px;
  }

  .stepper span {
    font-size: 10px;
  }

  .option-card strong {
    font-size: 14px;
  }

  .option-card span:not(.option-icon) {
    font-size: 11px;
  }
}
