/* Campos al estilo shadcn (Field + Input + InputGroup), con los colores del tema de la web.
   El anillo de foco es el de estandares.md (indicador interior). */

html body .campo:not([hidden]) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

html body .campo-etiqueta {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text);
}

.campo-obligatorio { display: none; }
.campo:has(:required:not(:disabled)) > .campo-etiqueta > .campo-obligatorio {
  display: inline;
  margin-inline-start: .3em;
  color: var(--palos-oscuro);
}

html body .campo-ayuda {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

html body .campo-control {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--trio-edge, var(--line));
  border-radius: 8px;
  background: var(--trio-tint, var(--field));
  color: var(--text);
  box-shadow: 0 1px 2px rgb(0 0 0 / 6%);
  font: inherit;
}

html body .campo-control::placeholder {
  color: var(--muted);
  opacity: 1;
}

html body .campo-grupo {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 40px;
  padding-right: 4px;
  border: 1px solid var(--trio-edge, var(--line));
  border-radius: 8px;
  background: var(--trio-tint, var(--field));
  box-shadow: 0 1px 2px rgb(0 0 0 / 6%);
  outline: 2px solid transparent;
  outline-offset: -3px;
  transition: border-color 150ms ease, outline-color 150ms ease, box-shadow 150ms ease;
}

html body .campo-grupo > .campo-control {
  flex: 1;
  border: 0;
  background: transparent;
  box-shadow: none;
  min-height: 38px;
}

html body .campo-control:focus-visible,
html body .campo-grupo:has(> .campo-control:focus-visible) {
  border-color: var(--anillo);
}

html body .campo-grupo:has(> .campo-control:focus-visible) {
  outline-color: var(--anillo);
}

html body .campo-grupo > .campo-control:focus-visible {
  outline-color: transparent !important;
}

html body .campo[data-invalid] > .campo-control,
html body .campo[data-invalid] > .campo-grupo,
html body .campo-control[aria-invalid="true"] {
  border-color: #f1ac9d;
}

html body .campo[data-disabled],
html body .campo-control:disabled {
  opacity: 0.6;
}

html body button.campo-ojo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  transform: none;
}

html body button.campo-ojo morph-icon {
  display: block;
  pointer-events: none;
}

html body button.campo-ojo:hover:not(:disabled),
html body button.campo-ojo:active:not(:disabled) {
  background: var(--icono-placa);
  border-color: transparent;
  color: var(--accion);
  transform: none;
}

html body .campo-control::-ms-reveal,
html body .campo-control::-ms-clear {
  display: none;
}

html body #account-fields,
html body #new-password-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

html body #verification-fields:not([hidden]) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

html body .auth-card #account-fields,
html body .auth-card #verification-fields:not([hidden]),
html body .auth-card #new-password-fields:not([hidden]) {
  margin-top: 18px;
}

html body .auth-card :is(#account-fields, #verification-fields, #new-password-fields) .campo-etiqueta {
  display: block;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text);
}

html body .auth-card .field-help.campo-ayuda {
  margin-top: 0;
  font-size: 12px;
  color: var(--muted);
}

html body .club-management-dialog .campo-grupo {
  min-height: 44px;
}

/* Casilla al estilo shadcn: 16 px, radio 4 px, cobre al marcar. La fila es la etiqueta. */
html body input.campo-casilla,
html body[data-view][data-lobby-game] #club-view .club-toolbar input.campo-casilla,
html body[data-home-theme][data-view][data-lobby-game] #club-view .club-toolbar input.campo-casilla,
html body .auth-card #auth-community-accept.campo-casilla,
html body .union-debt-withdrawal input.campo-casilla,
html body .club-network-debt-option input.campo-casilla,
html body .bacc-create-dialog input.campo-casilla,
html body .union-bank-form .union-bank-member-option input[type=checkbox].campo-casilla,
html body .union-counter-recharge-confirm .union-counter-recharge-debt input.campo-casilla {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  margin: 1px 0 0;
  padding: 0;
  border: 1px solid var(--trio-edge, var(--line));
  border-radius: 4px;
  background: var(--trio-tint, var(--field));
  box-shadow: 0 1px 2px rgb(0 0 0 / 6%);
  color: var(--accion-tinta);
  cursor: pointer;
  accent-color: auto;
}

html body input.campo-casilla:hover:not(:disabled),
html body[data-view][data-lobby-game] #club-view .club-toolbar input.campo-casilla:hover:not(:disabled),
html body .auth-card #auth-community-accept.campo-casilla:hover:not(:disabled) {
  border-color: var(--anillo);
}

html body input.campo-casilla:checked,
html body[data-view][data-lobby-game] #club-view .club-toolbar input.campo-casilla:checked,
html body[data-home-theme][data-view][data-lobby-game] #club-view .club-toolbar input.campo-casilla:checked,
html body .auth-card #auth-community-accept.campo-casilla:checked,
html body .union-debt-withdrawal input.campo-casilla:checked,
html body .club-network-debt-option input.campo-casilla:checked,
html body .bacc-create-dialog input.campo-casilla:checked,
html body .union-bank-form .union-bank-member-option input[type=checkbox].campo-casilla:checked,
html body .union-counter-recharge-confirm .union-counter-recharge-debt input.campo-casilla:checked {
  border-color: var(--accion);
  background: var(--accion);
}

html body input.campo-casilla::after,
html body[data-view][data-lobby-game] #club-view .club-toolbar input.campo-casilla:checked::after,
html body .auth-card #auth-community-accept.campo-casilla::after {
  content: "";
  position: static;
  inset: auto;
  width: 8px;
  height: 4px;
  margin: 0;
  border: 2px solid transparent;
  border-top: 0;
  border-right: 0;
  background: none;
  color: currentColor;
  font-size: 0;
  transform: translateY(-1px) rotate(-45deg);
}

html body input.campo-casilla:checked::after,
html body[data-view][data-lobby-game] #club-view .club-toolbar input.campo-casilla:checked::after,
html body .auth-card #auth-community-accept.campo-casilla:checked::after {
  border-color: currentColor;
}

html body input.campo-casilla:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

html body .campo.campo-horizontal:not([hidden]) {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
}

html body .campo-horizontal > .campo-etiqueta {
  flex: 1;
  margin: 0;
  padding-top: 0;
  font-weight: 400;
  line-height: 1.35;
  cursor: pointer;
}

html body .campo-conjunto {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  margin: 4px 0 0;
  padding: 12px;
  border: 1px solid var(--trio-edge, var(--line));
  border-radius: 10px;
}

html body .campo-leyenda {
  padding: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 560;
  line-height: 1.3;
}

html body .campo-conjunto > .campo-ayuda {
  margin: 0;
}

/* Búsqueda: el campo común comparte la lupa y el contorno. */
html body .campo-grupo.campo-busqueda {
  min-height:44px;
  gap:8px;
  padding-inline:12px 3px;
}
html body .campo-grupo.campo-busqueda:hover:not(:focus-within) {
  border-color:color-mix(in srgb, var(--anillo) 55%, var(--trio-edge, var(--line)));
}
html body .campo-grupo.campo-busqueda > .campo-control {
  padding-inline:0 4px;
  font-variant-numeric:tabular-nums;
}
.campo-busqueda-lupa {
  order:-1;
  display:grid;
  place-items:center;
  align-self:stretch;
  flex:0 0 16px;
  color:var(--muted);
  cursor:text;
}

html body .campo-grupo.campo-busqueda[data-busqueda-debounce] > input.campo-control {
  height: auto;
  min-height: 38px;
  padding-block: 8px;
  border: 0;
  background: transparent;
  color: var(--trio-ink);
  box-shadow: none;
  font: inherit;
}
html body .campo-grupo.campo-busqueda[data-busqueda-debounce] {
  color: var(--trio-ink);
  font: 500 14px/1.25 system-ui, sans-serif;
}
html body .campo-busqueda[data-busqueda-debounce] .campo-busqueda-lupa { color: var(--trio-muted); }
