/* On a phone the column is the page and pads itself, so the page adds nothing: padding here
   on top of the column's full viewport height is a page that scrolls by exactly that padding. */
.onboarding-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  background: var(--color-bg);

  @media (min-width: 640px) {
    padding: 1rem;
  }
}

.onboarding {
  --field-gap: 1rem;

  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 400px;
  min-height: 100dvh;
  padding: 1rem 1rem calc(1rem + var(--safe-bottom));

  @media (min-width: 640px) {
    min-height: auto;
    padding: 2rem;
  }

  /* Desktop: a column centred on the page, no shell of its own; the one card on the
     way in is the plan itself (plan_card.css). Single pane — a booking-style aside
     needs copy that doesn't exist yet. */
  @media (min-width: 1024px) {
    max-width: 480px;
    padding: 2rem 2.5rem;
  }
}

/* The plan step is the landing's card with its title centred above it, the way a pricing
   page draws it; where the card goes two columns (plan_card.css) the column widens with it. */
.onboarding_plan {
  .onboarding_title {
    text-align: center;
  }

  @media (min-width: 48rem) {
    max-width: 50rem;
  }
}

.onboarding--animate-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
.onboarding_header {
  /* The progress bar rides the middle of the tap row, so 23px of the gap down to
     the title already sits inside the header; this tops it up to ~39px. */
  margin-bottom: var(--wizard-header-gap);
}

.onboarding_brand_row {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.onboarding_brand {
  display: flex;
  justify-content: center;
}

/* The help sits off to the side so the logo stays centered; the pseudo-element tops its tap
   target up to 48px. */
.onboarding_help {
  position: absolute;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px 0 10px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-secondary);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  white-space: nowrap;

  &::before {
    content: "";
    position: absolute;
    inset: -6px -2px;
  }

  .onboarding_help_icon {
    width: 18px;
    height: 18px;
    color: var(--color-success-text);
  }

  &.available {
    background: var(--color-success-wash);
    box-shadow: inset 0 0 0 1.5px var(--color-success-border);
  }
}

.onboarding_help_presence {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--color-bg);
  border-radius: 50%;
  background: var(--color-success);
  animation: onboarding-help-glow 2s ease-in-out infinite;

  @media (prefers-reduced-motion: reduce) {
    animation: none;
  }
}

@keyframes onboarding-help-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--color-success-rgb), 0.55); }
  50% { box-shadow: 0 0 0 5px rgba(var(--color-success-rgb), 0); }
}

/* The plan step is the front door: the logo goes back to the landing, so the chevron to the
   same place is noise, and with the rail gone too the whole controls row goes. */
.onboarding_plan .onboarding_header_controls {
  display: none;
}

.onboarding_header_controls {
  display: flex;
  align-items: center;
  gap: var(--back-ink-inset);
  height: var(--back-tap-size);
}

.onboarding_progress {
  flex: 1;
  height: 2px;
  background: var(--color-bg-secondary);
  border-radius: 1px;
  overflow: hidden;

  /* The rail's answer to "how much is left" matters on a phone, where the flow is one
     long thumb; on desktop each step is its own short page. */
  @media (min-width: 1024px) {
    display: none;
  }
}

.onboarding_progress_bar {
  height: 100%;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

/* Content */
.onboarding_content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Step */
.onboarding_step {
  display: flex;
  flex-direction: column;
}

.onboarding_title {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 var(--wizard-body-gap);
  color: var(--color-text);

  /* A subtitle belongs to the title, so it sits close; the body gap then moves
     down to the subtitle and the distance to the field stays the same. */
  &:has(+ .onboarding_subtitle) {
    margin-bottom: var(--wizard-title-gap);
  }
}

.onboarding_subtitle {
  font-size: var(--text-base);
  color: var(--color-text-light);
  margin: 0 0 var(--wizard-body-gap);

  /* A second paragraph continues the first, so the body gap waits for the last one. */
  &:has(+ .onboarding_subtitle) {
    margin-bottom: var(--wizard-hint-gap);
  }

  strong {
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
  }
}

/* Feedback */
.onboarding_feedback {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: var(--text-sm);
  background: var(--color-bg-light);
  border-radius: 4px;
  text-align: center;

  &.error {
    background: var(--color-danger-light);
    color: var(--color-danger-text);
  }

  &.success {
    background: var(--color-success-wash);
    color: var(--color-success-text);
  }
}

/* Form */
.onboarding_form {
  display: flex;
  flex-direction: column;
  gap: var(--field-gap);
  width: 100%;

  /* Inside a form the flex gap already supplies part of the CTA separation, and all of the hint's. */
  > .onboarding_actions {
    margin-top: calc(var(--cta-gap) - var(--field-gap));
  }

  > .onboarding_note {
    margin-top: 0;
  }
}

.onboarding_form_row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.onboarding_form_field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Options (cards) */
.onboarding_options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.onboarding_option_form {
  width: 100%;
}

.onboarding_option_card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1.5rem;
  background: var(--color-bg-white);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;

  &:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-light);
  }

  svg {
    width: 32px;
    height: 32px;
    color: var(--color-primary);
  }
}

.onboarding_option_title {
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.onboarding_option_description {
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

/* Contact step: the owner's number as one tap, another number below it */
.onboarding_contact_other {
  margin-top: var(--wizard-body-gap);
}

.onboarding_contact_other_label {
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

/* The number shown back large, so a typo stands out before it goes on the link */
.onboarding_contact_number {
  margin-top: var(--wizard-body-gap);
  font-size: var(--text-3xl);
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}

/* The way out of a code that doesn't arrive. Its space is held from the start so nothing moves
   when it appears: after a wait on its own, or at once when the code is stuck. */
.onboarding_code_help {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--wizard-hint-gap);
  margin-top: var(--wizard-body-gap);
  visibility: hidden;
  animation: onboarding_code_help_reveal 0s 30s forwards;

  .onboarding_link {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
  }

  &.stuck {
    visibility: visible;
    animation: none;

    .onboarding_code_help_title {
      color: var(--color-warning-text);
    }
  }
}

@keyframes onboarding_code_help_reveal {
  to {
    visibility: visible;
  }
}

.onboarding_code_help_title {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.onboarding_code_help_text {
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

/* Category grid */
.onboarding_category_grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  width: 100%;
  margin-bottom: 1rem;

  @media (min-width: 400px) {
    grid-template-columns: repeat(3, 1fr);
  }
}

.onboarding_category_form {
  width: 100%;
}

.onboarding_category_card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s;

  &:hover {
    border-color: var(--color-primary);
  }

  svg {
    width: 24px;
    height: 24px;
    color: var(--color-text-light);
  }

  span {
    font-size: var(--text-xs);
    color: var(--color-text);
  }
}

/* Services list — the gate's rows, after the booking link's (booking_service_row) */
.onboarding_services_list {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 4px; /* the wizard buttons' radius */
  background: var(--color-bg-card);

  [data-theme="dark"] & {
    background: var(--color-bg-secondary);
  }
}

.onboarding_service_row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 1rem;

  &:not(:first-child) {
    border-top: 1px solid var(--color-border-light);
  }
}

.onboarding_service_name {
  font-size: var(--text-base);
  font-weight: var(--font-weight-light);
  line-height: var(--line-height-md);
  color: var(--color-text);
}

.onboarding_service_meta {
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

.onboarding_service_price {
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

/* Business hours — the same .work-hours-list rows the settings page uses. The
   onboarding column already carries the horizontal padding, so the rows drop
   theirs and run edge to edge inside it, as they do full-bleed in settings.
   Seven rows plus the CTA have to fit a phone, so the rows sit tighter than in settings. */
.onboarding_hours .work-hours-list .list-row {
  padding: 10px 0;
}

/* Education steps */
.onboarding_education {
  .onboarding_illustration {
    margin-bottom: 1.5rem;
    text-align: center;

    svg {
      width: 100%;
      max-width: 200px;
      height: auto;
    }
  }
}

.onboarding_link {
  font-size: var(--text-sm);
  color: var(--color-link);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;

  &:hover:not(:disabled) {
    color: var(--color-primary-hover);
  }

  &:disabled {
    color: var(--color-muted);
    cursor: not-allowed;
    opacity: 0.6;
  }
}

/* A step's quiet action has its own form, so it can't join the CTA's stack; it sits the stack's
   gap below it instead. */
.onboarding_skip_section {
  margin-top: 0.75rem;
  text-align: center;
}

/* The booking link explained by showing the exchange it replaces: the message the provider
   already gets, and the link they answer with. Follows the WhatsApp thread the admin area
   already draws — green outbound bubble, light inbound, flat ground. Flat, deliberately:
   the doodle wallpaper is Meta's artwork and we do not reproduce it. */
.booking_conversation {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.5rem;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-whatsapp-chat);
}

/* Avatar beside bubble, and the pair sits on the side the message came from. The exchange
   also plays out once on arrival, in the order it happens. Beats, not decoration: the pause
   between them is what makes it read as a conversation rather than a diagram. */
.booking_conversation_row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  max-width: 90%;
  animation: booking-conversation-beat 320ms ease-out both;

  &.incoming {
    align-self: flex-start;
    animation-delay: 120ms;
  }

  &.outgoing {
    align-self: flex-end;
    flex-direction: row-reverse;
    animation-delay: 640ms;
  }

  &:last-child {
    margin-bottom: 0;
  }
}

@keyframes booking-conversation-beat {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* A staggered fade is the whole animation, so removing it leaves the finished conversation
   rather than a half-drawn one. */
@media (prefers-reduced-motion: reduce) {
  .booking_conversation_row {
    animation: none;
  }
}

.booking_conversation_avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-gray-300);
  color: var(--color-gray-600);

  /* The provider's own side, so they can find themselves in the picture at a glance. */
  &.you {
    background: var(--color-primary-light);
    color: var(--color-primary);
  }

  svg {
    width: 16px;
    height: 16px;
  }
}

/* The tail: one corner unrounded on the side the message came from. */
.booking_conversation_bubble {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  line-height: var(--line-height-lg);
  color: var(--color-on-whatsapp-bubble);

  .incoming & {
    border-bottom-left-radius: 2px;
    background: var(--color-whatsapp-bubble-in);
  }

  .outgoing & {
    border-bottom-right-radius: 2px;
    background: var(--color-whatsapp-bubble);
  }
}

/* A sample code, not the user's — the real one is minted at the end of onboarding.
   Underlined because that is the only thing marking it as a link on the green. */
.booking_conversation_link {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  text-decoration: underline;
  word-break: break-all;
}

.booking_conversation_reply {
  display: block;
}

/* The "never heard of a booking link" escape hatch. It sits under the CTA because the
   people who need it are the minority; the ones who don't should meet the button first. */
.onboarding_help_trigger {
  align-self: center;
  margin-top: var(--wizard-hint-gap);
}

.onboarding_help_list {
  margin: 0;

  dt {
    font-size: var(--text-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
  }

  dd {
    margin: 0.25rem 0 1rem;
    font-size: var(--text-base);
    color: var(--color-text-light);
    line-height: var(--line-height-lg);

    &:last-child {
      margin-bottom: 0;
    }
  }
}

/* An optional, unchecked opt-in under a step's field. */
.onboarding_consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 48px;
  margin-top: var(--wizard-hint-gap);
  padding-block: 12px;
  font-size: var(--text-xs);
  color: var(--color-text);
  cursor: pointer;

  /* Its top meets the top of the label's capitals, however many lines the label wraps to. */
  input {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-block: calc((1lh - 1cap) / 2) 0;
    accent-color: var(--color-primary);
  }
}

.onboarding_note {
  margin-top: var(--wizard-hint-gap);
  font-size: var(--text-xs);
  color: var(--color-text-light);
}

/* Company card */
.onboarding_company_card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.onboarding_company_logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.onboarding_company_logo_placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  color: var(--color-on-brand);
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  border-radius: 8px;
}

.onboarding_company_info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.onboarding_company_name {
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
}

.onboarding_company_category {
  font-size: var(--text-xs);
  color: var(--color-text-light);
}

/* Info box */
.onboarding_info_box {
  width: 100%;
  padding: 1rem;
  background: var(--color-bg-light);
  border-radius: 8px;
  margin-bottom: 1.5rem;

  p {
    font-size: var(--text-sm);
    color: var(--color-text-light);
    margin: 0;
  }
}

/* Success icon */
.onboarding_icon_success {
  color: var(--color-success-dark);
  margin-bottom: 1rem;
  text-align: center;

  svg {
    width: 48px;
    height: 48px;
  }

  &.large svg {
    width: 64px;
    height: 64px;
  }
}

.onboarding_icon_info {
  color: var(--color-primary);
  margin-bottom: 1rem;
  text-align: center;

  svg {
    width: 48px;
    height: 48px;
  }
}

/* Celebration */
.onboarding_celebration {
  position: relative;

  .onboarding_title {
    text-align: center;
  }
}

.onboarding_confetti {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.confetti_piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  left: var(--confetti-left, 0);
  background-color: var(--confetti-color, #1C4E8F);
  animation: confettiFall var(--confetti-duration, 4s) linear var(--confetti-delay, 0s) forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.onboarding_booking_link {
  padding: 0.75rem 1rem;
  background: var(--color-bg-secondary);
  border-radius: 8px;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-primary);
  text-align: center;
  word-break: break-all;
}

/* Copy and WhatsApp side by side under the link, splitting its width. Both
   neutral — the celebration's one primary action is "Finalizar" below. */
.onboarding_share_buttons {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.onboarding_share_button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: var(--text-sm);
  cursor: pointer;
  text-decoration: none;
  color: var(--color-text);

  svg {
    width: 18px;
    height: 18px;
  }

  &:hover {
    border-color: var(--color-primary);
  }

  /* Copy-feedback state — toggled by clipboard_controller when copy succeeds. */
  &.copied {
    background: var(--color-success-dark);
    border-color: var(--color-success-dark);
    color: var(--color-on-success);
  }
}

/* Service Category Picker */
.service_category_picker {
  width: 100%;
}

.service_category_search {
  position: relative;
  width: 100%;
  margin-bottom: 1rem;
}

.service_category_dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: none;

  &.visible {
    display: block;
  }
}

.service_category_suggestion_tag {
  flex-shrink: 0;
  padding: 0.25rem 0.5rem;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-primary);
  background: var(--color-primary-light);
  border-radius: 4px;
}

.service_category_divider {
  height: 1px;
  background: var(--color-border);
  margin: 0.25rem 0;
}

.service_category_result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  height: 56px;
  padding: 0 1rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  text-align: left;

  &:last-child {
    border-bottom: none;
  }

  &:hover {
    background: var(--color-bg-light);
  }

  &.suggested {
    background: var(--color-bg-light);
    border-bottom: none;

    .service_category_result_icon {
      color: var(--color-primary);
    }
  }

  &.selected {
    background: var(--color-bg-light);
    border-left: 3px solid var(--color-primary);
  }
}

.service_category_result_icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--color-text-light);

  svg {
    width: 100%;
    height: 100%;
  }
}

.service_category_result_text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1;
  min-width: 0;
}

.service_category_result_name {
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

.service_category_result_aliases {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service_category_no_results {
  padding: 1rem;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

/* Selected Category */
.service_category_selected {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--color-bg-white);
  border: 1px solid var(--color-primary);
  border-radius: 4px;
  cursor: pointer;
  text-align: left;

  &.hidden {
    display: none;
  }

  &:hover {
    background: var(--color-bg-light);
  }
}

.service_category_selected_icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--color-primary);

  svg {
    width: 100%;
    height: 100%;
  }
}

.service_category_selected_text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1;
  min-width: 0;
}

.service_category_selected_name {
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

.service_category_selected_aliases {
  font-size: var(--text-xs);
  color: var(--color-text-light);
}

.service_category_clear {
  flex-shrink: 0;
  padding: 0.25rem;
  color: var(--color-muted);

  &:hover {
    color: var(--color-text);
  }

  svg {
    width: 18px;
    height: 18px;
  }
}

/* Suggested services: the checklist, then a price and a time screen per checked service */
.suggested_services_list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.suggested_services_note {
  font-size: var(--text-caption);
}

.suggested_service_card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 60px;
  padding: 0.75rem 1rem;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s, background-color 0.2s;

  &:has(.suggested_service_checkbox:checked) {
    border-color: var(--color-brand);
    background: var(--color-brand-wash);
  }

  @media (prefers-reduced-motion: reduce) {
    transition: none;
  }
}

/* The checked card again, at the top of a per-service screen: a label, not a control. */
.suggested_service_card--picked {
  min-height: 52px;
  margin-bottom: var(--wizard-header-gap);
  border-color: var(--color-brand);
  background: var(--color-brand-wash);
  cursor: default;
}

.suggested_service_name {
  flex: 1;
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  user-select: none;
}

/* The whole card toggles it, so the box only shows the state. */
.suggested_service_checkbox {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--color-brand);
  pointer-events: none;
}

/* A per-service screen is a full-height column with the CTA anchored at its foot, so the button
   stays put as the price picker opens and closes its rows. */
.suggested_service_step {
  flex: 1;

  .onboarding_title {
    margin-bottom: var(--wizard-hint-gap);
  }
}

.suggested_service_form {
  flex: 1;

  /* The column already pads horizontally — the picker's rows shouldn't double it. */
  .service-pricing {
    .radio-list-option {
      padding-inline: 0;
    }

    .radio-list-extra {
      padding-inline: 38px 0;
    }
  }
}

.suggested_service_cta {
  margin-top: auto;
  padding-top: calc(var(--cta-gap) - var(--field-gap));
}

.suggested_service_minutes {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;

  .wizard_input {
    flex: 1;
  }
}

.suggested_service_minutes_unit {
  font-size: var(--text-base);
  color: var(--color-text-light);
}

.suggested_service_section {
  margin-top: calc(var(--wizard-hint-gap) - var(--field-gap));
}

.suggested_service_section_title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.suggested_service_section_hint {
  margin: 0.25rem 0 0;
  font-size: var(--text-caption);
  color: var(--color-text-light);
}

/* Services gate */
.services_gate_form {
  margin-top: 2rem;
}

/* CNPJ Lookup */
.cnpj_lookup {
  width: 100%;
}

.cnpj_result {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-top: 0.5rem;
}

.cnpj_result_card {
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
}

.cnpj_result_row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0;

  &:not(:last-child) {
    border-bottom: 1px solid var(--color-border-light);
  }
}

.cnpj_result_label {
  font-size: var(--text-xs);
  color: var(--color-text-light);
}

.cnpj_result_value {
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

.cnpj_error {
  background: var(--color-warning-wash);
  color: var(--color-warning-text);
  font-size: var(--text-sm);
  text-align: center;
}

.cnpj_result_placeholder {
  height: 0;
}

/* Legal name display in business_name step */
.onboarding_legal_name_display {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--color-bg-secondary);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.onboarding_legal_name_label {
  font-size: var(--text-xs);
  color: var(--color-text-light);
}

.onboarding_legal_name_value {
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

/* Welcome step */
.onboarding_welcome_steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  margin-bottom: 1.5rem;
}

.welcome_step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.welcome_step_icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--color-primary-light);
  border-radius: 50%;
  color: var(--color-primary);
  flex-shrink: 0;
}

.welcome_step_text {
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

.onboarding_welcome_footer {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

/* Back link */
.onboarding_back {
  width: var(--back-tap-size);
  height: var(--back-tap-size);
  margin-left: calc(-1 * var(--back-ink-inset));
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  border-radius: 50%;
  transition: background-color 0.2s, color 0.2s;

  &:hover {
    background-color: var(--color-bg-secondary);
    color: var(--color-text);
  }

  svg {
    width: var(--back-icon-size);
    height: var(--back-icon-size);
  }
}

/* The trial's payment methods: bordered rows, each its own submit. The one Stripe came back from
   unfinished leads, outlined in the brand and tagged to try again. */
.onboarding_payment_notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 var(--wizard-hint-gap);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--color-success-wash);
  color: var(--color-success-text);
  font-size: var(--text-sm);

  svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
  }

  strong {
    font-weight: var(--font-weight-semibold);
  }
}

.onboarding_payment_options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.onboarding_payment_option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1.5px var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  &:active {
    background: var(--color-bg-secondary);
  }

  &.retry {
    box-shadow: inset 0 0 0 2px var(--color-brand);

    .onboarding_payment_option_icon {
      background: var(--color-brand-wash);
      color: var(--color-brand);
    }
  }
}

.onboarding_payment_option_icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-secondary);

  svg {
    width: 22px;
    height: 22px;
  }
}

.onboarding_payment_option_text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.onboarding_payment_option_name {
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
}

.onboarding_payment_option_tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-brand-wash);
  color: var(--color-brand);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  vertical-align: 1px;
}

.onboarding_payment_option_description {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.onboarding_payment_option_chevron {
  display: flex;
  color: var(--color-text-subtle);

  svg {
    width: 20px;
    height: 20px;
  }
}

.onboarding_payment_footer {
  margin: 16px 0 0;
  font-size: var(--text-sm);
  color: var(--color-muted);
  text-align: center;
}
