/* Shared Club OS controls. Load after feature styles so spacing has one owner. */
:root {
  --field-height: 44px;
  --field-radius: 12px;
  --field-padding: 14px;
  --select-arrow-inset: 16px;
  --select-text-space: 46px;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%23717b8d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

:is(.club-shell, dialog) :is(input:not([type=checkbox], [type=radio], [type=color], [type=range], [type=hidden]), select, textarea) {
  min-width: 0;
  max-width: 100%;
  min-height: var(--field-height);
  border: 1px solid #dce2eb;
  border-radius: var(--field-radius);
  padding: 11px var(--field-padding);
  background-color: #fff;
  color: #253145;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 1px 2px #17243a04;
  transition: border-color 160ms, box-shadow 160ms, background-color 160ms;
}

/* Never use padding shorthand in a feature select rule: it erases the arrow gutter. */
:is(.club-shell, dialog) select:not([multiple], [size]) {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: var(--select-text-space);
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-size: 12px 12px;
  background-position: right var(--select-arrow-inset) center;
  text-overflow: ellipsis;
  cursor: pointer;
}
:is(.club-shell, dialog) select:is([multiple], [size]) { background-image: none; }
:is(.club-shell, dialog) textarea { min-height: 108px; resize: vertical; }
:is(.club-shell, dialog) input::placeholder,
:is(.club-shell, dialog) textarea::placeholder { color: #8c96a6; }
:is(.club-shell, dialog) :is(input, select, textarea):hover:not(:disabled) { border-color: #b8c4d6; }
:is(.club-shell, dialog) :is(input, select, textarea):focus-visible {
  outline: 3px solid #2563eb24;
  outline-offset: 2px;
  border-color: #497bea;
  box-shadow: 0 0 0 1px #497bea;
}
:is(.club-shell, dialog) button:focus-visible {
  outline: 3px solid #2563eb50;
  outline-offset: 3px;
}
:is(.club-shell, dialog) :is(input, select, textarea):disabled {
  background-color: #f3f5f8;
  color: #8791a1;
  cursor: not-allowed;
  opacity: .72;
  box-shadow: none;
}
:is(.club-shell, dialog) :is(input, select, textarea)[aria-invalid=true] {
  border-color: var(--danger);
  background-color: #fff8f9;
}
:is(.club-shell, dialog) input:is([type=checkbox], [type=radio]) {
  width: 18px;
  height: 18px;
  min-height: 18px;
  flex-shrink: 0;
  accent-color: var(--accent);
}
:is(.club-shell, dialog) input[type=color] {
  width: 100%;
  min-width: 60px;
  height: var(--field-height);
  padding: 5px;
  border: 1px solid #dce2eb;
  border-radius: var(--field-radius);
  background: #fff;
  cursor: pointer;
}
:is(.club-shell, dialog) input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
:is(.club-shell, dialog) input[type=color]::-webkit-color-swatch { border: 0; border-radius: 7px; }
:is(.club-shell, dialog) input[type=file] { padding: 5px; font-size: 12px; }
:is(.club-shell, dialog) input[type=file]::file-selector-button {
  margin-inline-end: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: #eef3fc;
  color: #315fbb;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.club-form { gap: 16px; }
:is(.club-form, .auth-form) label:has(> :is(select, textarea, input:not([type=checkbox], [type=radio]))) {
  gap: 8px;
  min-width: 0;
  color: #536176;
  font-size: 13px;
  font-weight: 600;
}
:is(.club-form, .auth-form) button:not(.icon-button, .modal-close, .text-button) {
  min-height: var(--field-height);
  border-radius: 11px;
}
.form-grid { gap: 14px; }
/* Currency adornments own their border; do not draw a second input border inside. */
:is(.club-shell, dialog) .field-with-suffix { border-radius: var(--field-radius); }
:is(.club-shell, dialog) .field-with-suffix input { border: 0; border-radius: 0; box-shadow: none; }
:is(.club-shell, dialog) .field-with-suffix:focus-within { border-color: #497bea; }
/* The same arrow gutter also applies to the dark club picker. */
.club-sidebar #clubSelector,
.club-sidebar .club-search input {
  min-height: var(--field-height);
  border-color: #373a44;
  background-color: #22242a;
  color: #f6f7fa;
  box-shadow: none;
}
.club-sidebar #clubSelector {
  padding-inline-end: var(--select-text-space);
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-size: 12px 12px;
  background-position: right var(--select-arrow-inset) center;
}
.club-sidebar .club-search input::placeholder { color: #929aaa; }

@media (max-width: 600px) {
  :is(.club-shell, dialog) :is(input:not([type=checkbox], [type=radio], [type=color], [type=range], [type=hidden]), select, textarea) {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  :is(.club-shell, dialog) :is(input, select, textarea) { transition: none; }
}
@media (forced-colors: active) {
  :is(.club-shell, dialog) select:not([multiple], [size]),
  .club-sidebar #clubSelector {
    appearance: auto;
    -webkit-appearance: auto;
    background-image: none;
  }
}
