/*
 * Roca Professionals, participant site and cabinet: form fields.
 * The mockup: section 05 Поля of Дизайн-система; the checkbox and Кто вы? from Публичная часть, the switch
 * from Кабинет участника (Claude Design).
 *
 * The label is always above the control, the text of a control is 16 px (iOS zooms in on smaller text).
 * Focus is a 2 px accent frame drawn inside, without a glow; an error is the same frame in danger.
 * is-focus / is-active repeat the native focus and selection for the component page (no JS there).
 */

/* ---- Field: label, control, hint, error ------------------------------------------------------- */

.rp-field {
  display: flex;
  flex-direction: column;
  gap: var(--rp-sp-2);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.rp-field__label {
  padding: 0;
  font-size: var(--rp-fs-small);
  font-weight: var(--rp-fw-medium);
  line-height: var(--rp-lh-snug);
  color: var(--rp-text);
}

.rp-field__hint {
  font-size: var(--rp-fs-small);
  line-height: var(--rp-lh-snug);
  color: var(--rp-text-tertiary);
}

.rp-field__error {
  display: flex;
  gap: var(--rp-sp-1-5);
  font-size: var(--rp-fs-small);
  line-height: var(--rp-lh-snug);
  color: var(--rp-danger);
}

.rp-field__error::before {
  content: "";
  flex: none;
  width: var(--rp-icon-sm);
  height: var(--rp-icon-sm);
  background: currentColor;
  -webkit-mask: var(--rp-ic-alert);
  mask: var(--rp-ic-alert);
}

.rp-field__success {
  display: flex;
  gap: var(--rp-sp-1-5);
  font-size: var(--rp-fs-small);
  line-height: var(--rp-lh-snug);
  color: var(--rp-success);
}

.rp-field__success::before {
  content: "";
  flex: none;
  width: var(--rp-icon-sm);
  height: var(--rp-icon-sm);
  background: currentColor;
  -webkit-mask: var(--rp-ic-check);
  mask: var(--rp-ic-check);
}

/* Hint on the left, counter (81 / 1000) on the right. */
.rp-field__meta {
  display: flex;
  justify-content: space-between;
  gap: var(--rp-sp-3);
  font-size: var(--rp-fs-small);
  line-height: var(--rp-lh-snug);
  color: var(--rp-text-tertiary);
}

.rp-field__counter {
  flex: none;
  margin-inline-start: auto;
  font-variant-numeric: tabular-nums;
}

.rp-field__counter.is-error {
  color: var(--rp-danger);
}

/* A small action under a control (Отправить код ещё раз): its text lines up with the field edge. */
.rp-field__action {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: var(--rp-tap);
  margin: 0 0 0 calc(-1 * var(--rp-sp-3));
  padding: 0 var(--rp-sp-3);
  border: 0;
  border-radius: var(--rp-r-control);
  background: transparent;
  color: var(--rp-accent);
  font-size: var(--rp-fs-small);
  font-weight: var(--rp-fw-medium);
  line-height: var(--rp-lh-snug);
  text-align: left;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

@media (hover: hover) {
  .rp-field__action:hover {
    background: var(--rp-accent-soft);
  }
}

.rp-field__action:focus-visible {
  outline: none;
  box-shadow: var(--rp-focus);
}

/* While the timer runs the same button is disabled and reads as plain text. */
.rp-field__action:disabled {
  background: transparent;
  color: var(--rp-text-secondary);
  font-weight: var(--rp-fw-regular);
  cursor: default;
}

.rp-field.is-disabled .rp-field__label,
.rp-field:has(.rp-input:disabled, .rp-phone__input:disabled) .rp-field__label {
  color: var(--rp-disabled-text);
}

/* ---- Input, select, textarea, date ------------------------------------------------------------ */

.rp-input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: var(--rp-field-h);
  margin: 0;
  padding: 0 var(--rp-sp-4);
  border: 0;
  border-radius: var(--rp-r-control);
  background: var(--rp-surface);
  box-shadow: inset 0 0 0 var(--rp-bw) var(--rp-line-field);
  color: var(--rp-text);
  font-family: var(--rp-font);
  font-size: var(--rp-fs-body);
  line-height: var(--rp-lh-snug);
  -webkit-appearance: none;
  appearance: none;
}

.rp-input::placeholder {
  color: var(--rp-text-tertiary);
  opacity: 1;
}

.rp-input:focus,
.rp-input.is-focus {
  outline: none;
  box-shadow: inset 0 0 0 var(--rp-bw-strong) var(--rp-accent);
}

.rp-input[aria-invalid="true"],
.rp-input.is-error {
  box-shadow: inset 0 0 0 var(--rp-bw-strong) var(--rp-danger);
}

/* Safari greys disabled text by itself; the fill colour keeps it at the token. */
.rp-input:disabled {
  background: var(--rp-disabled-bg);
  box-shadow: none;
  color: var(--rp-disabled-text);
  -webkit-text-fill-color: var(--rp-disabled-text);
  opacity: 1;
  cursor: not-allowed;
}

/* Browser autofill paints its own yellow; an inset shadow of the field height covers it. */
.rp-input:-webkit-autofill {
  box-shadow: inset 0 0 0 var(--rp-bw) var(--rp-line-field), inset 0 0 0 var(--rp-field-h) var(--rp-surface);
  -webkit-text-fill-color: var(--rp-text);
}

.rp-input:-webkit-autofill:focus {
  box-shadow: inset 0 0 0 var(--rp-bw-strong) var(--rp-accent), inset 0 0 0 var(--rp-field-h) var(--rp-surface);
}

textarea.rp-input {
  min-height: var(--rp-textarea-h);
  padding: var(--rp-sp-4);
  line-height: var(--rp-lh-body);
  resize: vertical;
}

select.rp-input {
  cursor: pointer;
}

/* Date: iOS centres the value (min-height keeps an empty one from collapsing); the picker icon becomes ours. */
.rp-input::-webkit-date-and-time-value {
  text-align: left;
}

.rp-input::-webkit-calendar-picker-indicator {
  width: var(--rp-icon);
  height: var(--rp-icon);
  margin: 0;
  padding: 0;
  background: var(--rp-text-secondary);
  -webkit-mask: var(--rp-ic-calendar);
  mask: var(--rp-ic-calendar);
  opacity: 1;
  cursor: pointer;
}

.rp-input:disabled::-webkit-calendar-picker-indicator {
  background: var(--rp-disabled-text);
}

.rp-input[type="search"]::-webkit-search-decoration,
.rp-input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

/* ---- Control: a field with an icon, an arrow, a unit, a clear button or a spinner -------------- */

.rp-control {
  position: relative;
  display: block;
  min-width: 0;
}

.rp-control__icon {
  position: absolute;
  top: 50%;
  left: var(--rp-sp-4);
  width: var(--rp-icon);
  height: var(--rp-icon);
  background: var(--rp-text-tertiary);
  -webkit-mask: var(--rp-i);
  mask: var(--rp-i);
  transform: translateY(-50%);
  pointer-events: none;
}

.rp-control__icon + .rp-input {
  padding-inline-start: var(--rp-sp-12);
}

.rp-control--select .rp-input,
.rp-control--search .rp-input,
.rp-control--suffix .rp-input,
.rp-control.is-loading .rp-input {
  padding-inline-end: var(--rp-sp-12);
}

/* Select: the system list opens on a phone; the arrow is ours. */
.rp-control--select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: var(--rp-sp-4);
  width: var(--rp-icon);
  height: var(--rp-icon);
  background: var(--rp-text-secondary);
  -webkit-mask: var(--rp-ic-down);
  mask: var(--rp-ic-down);
  transform: translateY(-50%);
  pointer-events: none;
}

.rp-control--select:has(.rp-input:disabled)::after {
  background: var(--rp-disabled-text);
}

/* The unit after the value: ₸, м². */
.rp-control__suffix {
  position: absolute;
  top: 50%;
  right: var(--rp-sp-4);
  color: var(--rp-text-tertiary);
  font-size: var(--rp-fs-body);
  transform: translateY(-50%);
  pointer-events: none;
}

.rp-control__clear {
  position: absolute;
  top: 50%;
  right: var(--rp-sp-1-5);
  display: grid;
  place-items: center;
  width: var(--rp-tap);
  height: var(--rp-tap);
  padding: 0;
  border: 0;
  border-radius: var(--rp-r-control);
  background: transparent;
  color: var(--rp-text-secondary);
  transform: translateY(-50%);
  cursor: pointer;
}

.rp-control__clear:focus-visible {
  outline: none;
  box-shadow: var(--rp-focus);
}

/* Loading: the spinner takes the place of the arrow or the unit. */
.rp-control.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  right: var(--rp-sp-4);
  width: var(--rp-icon-sm);
  height: var(--rp-icon-sm);
  margin-top: calc(-1 * var(--rp-icon-sm) / 2);
  border: var(--rp-bw-strong) solid var(--rp-text-tertiary);
  border-right-color: transparent;
  border-radius: 50%;
  background: none;
  -webkit-mask: none;
  mask: none;
  transform: none;
  animation: rp-spin var(--rp-dur-spin) linear infinite;
}

.rp-control.is-loading .rp-control__suffix {
  opacity: 0;
}

/* ---- Phone with the country code --------------------------------------------------------------- */

/* The code is a transparent select over KZ +7: the script copies the chosen code into the visible text. */
.rp-phone {
  display: flex;
  align-items: stretch;
  min-width: 0;
  min-height: var(--rp-field-h);
  border-radius: var(--rp-r-control);
  background: var(--rp-surface);
  box-shadow: inset 0 0 0 var(--rp-bw) var(--rp-line-field);
}

.rp-phone:focus-within,
.rp-phone.is-focus {
  box-shadow: inset 0 0 0 var(--rp-bw-strong) var(--rp-accent);
}

.rp-phone.is-error,
.rp-phone:has([aria-invalid="true"]) {
  box-shadow: inset 0 0 0 var(--rp-bw-strong) var(--rp-danger);
}

.rp-phone:has(.rp-phone__input:disabled) {
  background: var(--rp-disabled-bg);
  box-shadow: none;
  color: var(--rp-disabled-text);
}

.rp-phone__country {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--rp-sp-1-5);
  padding: 0 var(--rp-sp-3) 0 var(--rp-sp-4);
  box-shadow: inset calc(-1 * var(--rp-bw)) 0 0 var(--rp-line);
}

.rp-phone__country::after {
  content: "";
  width: var(--rp-icon-sm);
  height: var(--rp-icon-sm);
  background: var(--rp-text-secondary);
  -webkit-mask: var(--rp-ic-down);
  mask: var(--rp-ic-down);
}

.rp-phone__iso {
  font-size: var(--rp-fs-caption);
  font-weight: var(--rp-fw-medium);
  color: var(--rp-text-tertiary);
}

.rp-phone__code {
  font-size: var(--rp-fs-body);
  font-weight: var(--rp-fw-medium);
}

.rp-phone__select {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  font-size: var(--rp-fs-body);
  opacity: 0;
  cursor: pointer;
}

.rp-phone__input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0 var(--rp-sp-4);
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--rp-font);
  font-size: var(--rp-fs-body);
  font-variant-numeric: tabular-nums;
}

.rp-phone__input:focus {
  outline: none;
}

.rp-phone__input::placeholder {
  color: var(--rp-text-tertiary);
  opacity: 1;
}

/* ---- Code from SMS: six cells over one transparent input -------------------------------------- */

/*
 * One real input (autocomplete="one-time-code", so iOS and Android offer the code from the SMS) lies over
 * the cells; the script writes the digits into the cells and marks the next empty one is-active.
 * Cells shrink below 48 px when the column is narrower than 6 x 48.
 */
.rp-otp {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, var(--rp-otp-w)));
  justify-content: space-between;
  column-gap: var(--rp-sp-1);
}

.rp-otp__cell {
  display: grid;
  place-items: center;
  height: var(--rp-otp-h);
  border-radius: var(--rp-r-control);
  background: var(--rp-surface);
  box-shadow: inset 0 0 0 var(--rp-bw) var(--rp-line-field);
  font-size: var(--rp-fs-h3);
  font-weight: var(--rp-fw-medium);
  font-variant-numeric: tabular-nums;
}

.rp-otp__cell.is-active {
  box-shadow: inset 0 0 0 var(--rp-bw-strong) var(--rp-accent);
}

.rp-otp.is-error .rp-otp__cell {
  box-shadow: inset 0 0 0 var(--rp-bw-strong) var(--rp-danger);
}

.rp-otp.is-done .rp-otp__cell {
  box-shadow: inset 0 0 0 var(--rp-bw-strong) var(--rp-success);
}

.rp-otp__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: var(--rp-fs-body);
  opacity: 0;
  cursor: text;
}

/* ---- Search with suggestions ------------------------------------------------------------------ */

.rp-suggest {
  display: flex;
  flex-direction: column;
  padding: var(--rp-sp-1-5);
  border-radius: var(--rp-r-lg);
  background: var(--rp-surface);
  box-shadow: var(--rp-sh-2);
}

.rp-suggest__option {
  display: flex;
  align-items: center;
  gap: var(--rp-sp-3);
  width: 100%;
  min-height: var(--rp-sp-16);
  padding: var(--rp-sp-1-5) var(--rp-sp-2);
  border: 0;
  border-radius: var(--rp-r-md);
  background: transparent;
  color: var(--rp-text);
  font-family: var(--rp-font);
  text-align: left;
  cursor: pointer;
}

@media (hover: hover) {
  .rp-suggest__option:hover {
    background: var(--rp-surface-sunken);
  }
}

.rp-suggest__option.is-active,
.rp-suggest__option[aria-selected="true"] {
  background: var(--rp-surface-sunken);
}

.rp-suggest__option:focus-visible {
  outline: none;
  box-shadow: var(--rp-focus);
}

/* A product photo, or the warm placeholder while there is none. */
.rp-suggest__thumb {
  flex: none;
  width: var(--rp-sp-12);
  height: var(--rp-sp-12);
  border-radius: var(--rp-r-sm);
  background: var(--rp-ph-fill);
  object-fit: cover;
}

.rp-suggest__text {
  display: flex;
  flex-direction: column;
  gap: var(--rp-sp-0-5);
  min-width: 0;
}

.rp-suggest__title {
  font-size: var(--rp-fs-body);
  line-height: var(--rp-lh-snug);
}

/* The typed part of the name. */
.rp-suggest__title b {
  font-weight: var(--rp-fw-strong);
}

.rp-suggest__code {
  font-family: var(--rp-font-mono);
  font-size: var(--rp-fs-caption);
  line-height: var(--rp-lh-snug);
  color: var(--rp-text-tertiary);
}

.rp-suggest__empty {
  padding: var(--rp-sp-3);
  font-size: var(--rp-fs-small);
  line-height: var(--rp-lh-body);
  color: var(--rp-text-secondary);
}

/* ---- Photo upload ------------------------------------------------------------------------------ */

.rp-upload {
  display: flex;
  flex-direction: column;
  gap: var(--rp-sp-4);
  min-width: 0;
}

.rp-upload__head {
  display: flex;
  flex-direction: column;
  gap: var(--rp-sp-1);
}

.rp-upload__offline {
  display: flex;
  align-items: flex-start;
  gap: var(--rp-sp-2);
  padding: var(--rp-sp-3) var(--rp-sp-4);
  border-radius: var(--rp-r-md);
  background: var(--rp-surface-inverse);
  color: var(--rp-text-inverse);
  font-size: var(--rp-fs-small);
  line-height: var(--rp-lh-snug);
}

.rp-upload__offline::before {
  content: "";
  flex: none;
  width: var(--rp-icon-sm);
  height: var(--rp-icon-sm);
  background: currentColor;
  -webkit-mask: var(--rp-ic-offline);
  mask: var(--rp-ic-offline);
}

/* Three 104 px tiles fit a 360 px phone (320 px column); a narrower column gets two. */
.rp-upload__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--rp-tile));
  justify-content: space-between;
  gap: var(--rp-sp-3) var(--rp-sp-1);
}

.rp-upload__tile {
  position: relative;
  width: var(--rp-tile);
  height: var(--rp-tile);
  overflow: hidden;
  border-radius: var(--rp-r-md);
  background: var(--rp-ph-fill);
}

.rp-upload__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rp-upload__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--rp-sp-1);
  padding: var(--rp-sp-2);
  font-size: var(--rp-fs-micro);
  line-height: var(--rp-lh-snug);
  text-align: center;
}

.rp-upload__tile.is-uploading .rp-upload__overlay {
  background: var(--rp-overlay);
  color: var(--rp-text-inverse);
}

.rp-upload__tile.is-queued .rp-upload__overlay {
  background: var(--rp-veil);
  color: var(--rp-text-secondary);
}

.rp-upload__tile.is-error .rp-upload__overlay {
  padding: 0;
  background: var(--rp-veil);
  color: var(--rp-danger);
}

/* Progress ring: the script sets --rp-upload-progress (0% to 100%) and aria-valuenow. */
.rp-upload__ring {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--rp-sp-12);
  height: var(--rp-sp-12);
  font-size: var(--rp-fs-caption);
  font-weight: var(--rp-fw-medium);
  font-variant-numeric: tabular-nums;
}

.rp-upload__ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--rp-text-inverse) var(--rp-upload-progress, 0%), var(--rp-line-inverse) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--rp-progress-h) - var(--rp-bw)), var(--rp-ink) calc(100% - var(--rp-progress-h)));
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--rp-progress-h) - var(--rp-bw)), var(--rp-ink) calc(100% - var(--rp-progress-h)));
}

.rp-upload__status {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--rp-sp-1);
  padding: var(--rp-sp-2) var(--rp-sp-1);
}

.rp-upload__retry {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  gap: var(--rp-sp-1);
  min-height: var(--rp-tap);
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--rp-surface);
  box-shadow: inset 0 var(--rp-bw) 0 var(--rp-line);
  color: var(--rp-accent);
  font-family: var(--rp-font);
  font-size: var(--rp-fs-caption);
  font-weight: var(--rp-fw-medium);
  cursor: pointer;
}

.rp-upload__retry .rp-icon {
  width: var(--rp-sp-4);
  height: var(--rp-sp-4);
}

.rp-upload__retry:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 var(--rp-bw-strong) var(--rp-accent);
}

/* A 32 px dark circle; ::after widens the touch area to 44 px up to the tile corner. */
.rp-upload__remove {
  position: absolute;
  top: var(--rp-sp-1-5);
  right: var(--rp-sp-1-5);
  display: grid;
  place-items: center;
  width: var(--rp-sp-8);
  height: var(--rp-sp-8);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--rp-surface-inverse);
  color: var(--rp-text-inverse);
  cursor: pointer;
}

.rp-upload__remove::after {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--rp-sp-1-5));
}

.rp-upload__remove:focus-visible {
  outline: none;
  box-shadow: var(--rp-focus);
}

/* Over the dark veil of a running upload the cancel cross needs no circle. */
.rp-upload__tile.is-uploading .rp-upload__remove {
  background: transparent;
}

/* Label around a hidden file input: the picker opens without a script. */
.rp-upload__add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--rp-sp-1-5);
  width: var(--rp-tile);
  height: var(--rp-tile);
  padding: var(--rp-sp-2);
  border: var(--rp-bw) dashed var(--rp-line-field);
  border-radius: var(--rp-r-md);
  background: var(--rp-surface);
  color: var(--rp-accent);
  font-size: var(--rp-fs-micro);
  font-weight: var(--rp-fw-medium);
  line-height: var(--rp-lh-snug);
  text-align: center;
  cursor: pointer;
}

@media (hover: hover) {
  .rp-upload__add:hover {
    background: var(--rp-accent-soft);
  }
}

.rp-upload__add:focus-visible,
.rp-upload__add:has(:focus-visible) {
  outline: none;
  box-shadow: var(--rp-focus);
}

/* ---- Checkbox ---------------------------------------------------------------------------------- */

.rp-check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--rp-sp-3);
  min-height: var(--rp-tap);
  padding-block: var(--rp-sp-2);
  cursor: pointer;
}

.rp-check__box {
  display: grid;
  flex: none;
  place-content: center;
  width: var(--rp-checkbox);
  height: var(--rp-checkbox);
  margin: 0;
  border-radius: var(--rp-r-xs);
  background: var(--rp-surface);
  box-shadow: inset 0 0 0 var(--rp-bw-strong) var(--rp-line-field);
  color: var(--rp-on-accent);
  -webkit-appearance: none;
  appearance: none;
  cursor: inherit;
}

.rp-check__box::before {
  content: "";
  width: var(--rp-sp-4);
  height: var(--rp-sp-4);
  background: currentColor;
  -webkit-mask: var(--rp-ic-check);
  mask: var(--rp-ic-check);
  transform: scale(0);
  transition: transform var(--rp-dur-fast) var(--rp-ease);
}

.rp-check__box:checked {
  background: var(--rp-action);
  box-shadow: none;
}

.rp-check__box:checked::before {
  transform: none;
}

.rp-check__box:focus-visible,
.rp-check__box.is-focus {
  outline: none;
  box-shadow: inset 0 0 0 var(--rp-bw-strong) var(--rp-line-field), var(--rp-focus);
}

.rp-check__box:checked:focus-visible,
.rp-check__box:checked.is-focus {
  box-shadow: var(--rp-focus);
}

.rp-check__box[aria-invalid="true"] {
  box-shadow: inset 0 0 0 var(--rp-bw-strong) var(--rp-danger);
}

.rp-check__box:disabled {
  background: var(--rp-disabled-bg);
  box-shadow: none;
  color: var(--rp-disabled-text);
}

.rp-check__text {
  display: flex;
  flex-direction: column;
  gap: var(--rp-sp-0-5);
  min-width: 0;
  padding-top: var(--rp-sp-0-5);
  font-size: var(--rp-fs-body);
  line-height: var(--rp-lh-snug);
}

.rp-check:has(:disabled) {
  color: var(--rp-disabled-text);
  cursor: not-allowed;
}

/* ---- Switch ------------------------------------------------------------------------------------ */

/* A checkbox with role="switch": the label on the left, the switch on the right. */
.rp-switch {
  display: flex;
  align-items: center;
  gap: var(--rp-sp-3);
  min-height: var(--rp-tap);
  cursor: pointer;
}

.rp-switch__text {
  flex: 1;
  min-width: 0;
  font-size: var(--rp-fs-body);
  line-height: var(--rp-lh-snug);
}

.rp-switch__input {
  position: relative;
  flex: none;
  width: var(--rp-tap);
  height: calc(var(--rp-sp-6) + var(--rp-sp-0-5));
  margin: 0;
  border-radius: var(--rp-r-pill);
  background: var(--rp-line-strong);
  -webkit-appearance: none;
  appearance: none;
  cursor: inherit;
}

.rp-switch__input::before {
  content: "";
  position: absolute;
  top: var(--rp-sp-0-5);
  left: var(--rp-sp-0-5);
  width: calc(var(--rp-sp-5) + var(--rp-sp-0-5));
  height: calc(var(--rp-sp-5) + var(--rp-sp-0-5));
  border-radius: 50%;
  background: var(--rp-surface);
  box-shadow: var(--rp-sh-1);
  transition: transform var(--rp-dur-fast) var(--rp-ease);
}

.rp-switch__input:checked {
  background: var(--rp-action);
}

.rp-switch__input:checked::before {
  transform: translateX(calc(var(--rp-sp-4) + var(--rp-sp-0-5)));
}

.rp-switch__input:focus-visible,
.rp-switch__input.is-focus {
  outline: none;
  box-shadow: var(--rp-focus);
}

.rp-switch__input:disabled {
  background: var(--rp-disabled-bg);
}

.rp-switch__input:disabled::before {
  box-shadow: none;
}

.rp-switch:has(:disabled) {
  color: var(--rp-disabled-text);
  cursor: not-allowed;
}

/* ---- Radio buttons as cards (Кто вы?) ---------------------------------------------------------- */

/*
 * A fieldset with a legend, or a plain list. A card is either a label around a visually hidden radio
 * (choice inside a form) or a link (the choice opens the next screen): the same classes fit both.
 */
.rp-choice {
  display: flex;
  flex-direction: column;
  gap: var(--rp-sp-3);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.rp-choice__option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--rp-sp-4);
  padding: var(--rp-sp-4);
  border-radius: var(--rp-r-lg);
  background: var(--rp-surface);
  box-shadow: var(--rp-sh-1);
  color: var(--rp-text);
  text-decoration: none;
  cursor: pointer;
}

/* A link card: the base a:hover colour must not reach it, also after a tap on a touch screen. */
.rp-choice__option:hover {
  color: var(--rp-text);
}

@media (hover: hover) {
  .rp-choice__option:hover {
    box-shadow: 0 0 0 var(--rp-bw) var(--rp-line-strong);
  }
}

.rp-choice__option:has(:checked),
.rp-choice__option.is-active {
  background: var(--rp-accent-soft);
  box-shadow: inset 0 0 0 var(--rp-bw-strong) var(--rp-accent);
}

.rp-choice__option:focus-visible,
.rp-choice__option:has(:focus-visible),
.rp-choice__option.is-focus {
  outline: none;
  box-shadow: var(--rp-sh-1), var(--rp-focus);
}

.rp-choice__option:has(:checked:focus-visible),
.rp-choice__option.is-active.is-focus {
  box-shadow: inset 0 0 0 var(--rp-bw-strong) var(--rp-accent), var(--rp-focus);
}

/* Скоро: a radio with disabled, a link with aria-disabled="true" (and no href). */
.rp-choice__option:has(:disabled),
.rp-choice__option[aria-disabled="true"],
.rp-choice__option.is-disabled {
  box-shadow: var(--rp-sh-1);
  color: var(--rp-text-tertiary);
  cursor: not-allowed;
}

.rp-choice__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: var(--rp-sp-12);
  height: var(--rp-sp-12);
  border-radius: var(--rp-r-md);
  background: var(--rp-stone);
}

/* The selected card is stone itself: the square turns white to stay visible. */
.rp-choice__option:has(:checked) .rp-choice__icon,
.rp-choice__option.is-active .rp-choice__icon {
  background: var(--rp-surface);
}

/* A link card shows where it leads: a chevron on the right. */
.rp-choice__go {
  flex: none;
  align-self: center;
  color: var(--rp-text-tertiary);
}

.rp-choice__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--rp-sp-1);
  min-width: 0;
}

.rp-choice__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--rp-sp-2);
  font-size: var(--rp-fs-body);
  font-weight: var(--rp-fw-medium);
  line-height: var(--rp-lh-snug);
}

.rp-choice__text {
  font-size: var(--rp-fs-small);
  line-height: var(--rp-lh-snug);
  color: var(--rp-text-secondary);
}

/* Скоро: an option that opens at the second stage. */
.rp-choice__tag {
  display: inline-flex;
  align-items: center;
  min-height: var(--rp-sp-6);
  padding: 0 var(--rp-sp-2);
  border-radius: var(--rp-r-pill);
  background: var(--rp-surface-inverse);
  color: var(--rp-text-inverse);
  font-size: var(--rp-fs-micro);
  font-weight: var(--rp-fw-regular);
}

/* ---- Letter keys of the choice cards (AI SDK Agents: questions panel) ------------------------- */

/* A-D in the corner: a key on a computer picks the option, on a phone it is just a mark. */
.rp-choice__key {
  position: absolute;
  top: var(--rp-sp-3);
  right: var(--rp-sp-3);
  display: grid;
  place-items: center;
  width: var(--rp-sp-6);
  height: var(--rp-sp-6);
  border-radius: var(--rp-r-sm);
  box-shadow: inset 0 0 0 var(--rp-bw) var(--rp-line-strong);
  font-family: var(--rp-font-mono);
  font-size: var(--rp-fs-micro);
  color: var(--rp-text-tertiary);
}

.rp-choice__option:has(:checked) .rp-choice__key {
  background: var(--rp-ink);
  color: var(--rp-text-inverse);
  box-shadow: none;
}

.rp-choice__option:has(.rp-choice__key) .rp-choice__body {
  padding-right: var(--rp-sp-8);
}
