/* ============================================================
   WOMARKT OS — HUD Form Controls
   Custom select, checkbox, radio, toggle — no browser defaults
   ============================================================ */

:root {
  --hud-input-bg: rgba(6, 6, 6, 0.92);
  --hud-input-border: rgba(0, 172, 172, 0.22);
  --hud-input-border-hover: rgba(0, 172, 172, 0.42);
  --hud-input-border-focus: rgba(0, 212, 170, 0.65);
  --hud-input-glow: 0 0 0 1px rgba(0, 212, 170, 0.18), 0 0 12px rgba(0, 172, 172, 0.12);
  --hud-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300d4aa' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
}

/* ── Custom Select (global) ── */
select,
.sector-select,
.lang-select,
.form-select,
.date-range-select,
.hud-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  display: inline-block;
  min-height: 30px;
  padding: 5px 34px 5px 10px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
  background-color: var(--hud-input-bg);
  background-image: var(--hud-chevron);
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  border: 1px solid var(--hud-input-border);
  border-radius: 0 !important;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  line-height: 1.4;
}

select:hover,
.sector-select:hover,
.lang-select:hover,
.form-select:hover,
.date-range-select:hover {
  border-color: var(--hud-input-border-hover);
  background-color: rgba(0, 172, 172, 0.04);
}

select:focus,
.sector-select:focus,
.lang-select:focus,
.form-select:focus,
.date-range-select:focus {
  border-color: var(--hud-input-border-focus);
  box-shadow: var(--hud-input-glow);
  outline: none;
}

select:disabled,
.form-select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

select option,
.form-select option {
  background: #0a0a0a;
  color: var(--text);
  padding: 6px 8px;
}

/* Topbar sector selector — HUD bracket frame */
.sector-selector {
  position: relative;
  padding-left: 8px;
}
.sector-selector::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--accent-bright);
  box-shadow: 0 0 6px rgba(0, 212, 170, 0.45);
}
.sector-select,
.lang-select {
  min-width: 148px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sector-label {
  display: inline-flex;
  align-items: center;
  min-width: 148px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  user-select: none;
  cursor: default;
}

.lang-selector .lang-select {
  min-width: 96px;
}

/* ── Custom Checkbox (square HUD) ── */
input[type="checkbox"]:not(.sidebar-toggle-input):not(.sidebar-collapse-input):not(.rp-collapse-input):not(.hud-switch-input) {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  margin: 0;
  flex-shrink: 0;
  border: 1px solid var(--hud-input-border-hover);
  background: var(--hud-input-bg);
  cursor: pointer;
  position: relative;
  border-radius: 0 !important;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  vertical-align: middle;
}

input[type="checkbox"]:not(.sidebar-toggle-input):not(.sidebar-collapse-input):not(.rp-collapse-input):not(.hud-switch-input):hover {
  border-color: var(--accent-bright);
  background: rgba(0, 172, 172, 0.06);
}

input[type="checkbox"]:not(.sidebar-toggle-input):not(.sidebar-collapse-input):not(.rp-collapse-input):not(.hud-switch-input):focus-visible {
  outline: none;
  box-shadow: var(--hud-input-glow);
}

input[type="checkbox"]:not(.sidebar-toggle-input):not(.sidebar-collapse-input):not(.rp-collapse-input):not(.hud-switch-input):checked {
  background: rgba(0, 172, 172, 0.18);
  border-color: var(--accent-bright);
}

input[type="checkbox"]:not(.sidebar-toggle-input):not(.sidebar-collapse-input):not(.rp-collapse-input):not(.hud-switch-input):checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--accent-bright);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="checkbox"]:not(.sidebar-toggle-input):not(.sidebar-collapse-input):not(.rp-collapse-input):not(.hud-switch-input):disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

input[type="checkbox"]:not(.sidebar-toggle-input):not(.sidebar-collapse-input):not(.rp-collapse-input):not(.hud-switch-input):disabled:checked::after {
  border-color: var(--text3);
}

/* ── Toggle switch (.ai-toggle, .hud-switch) ── */
.ai-toggle,
.hud-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text2);
  user-select: none;
}

.ai-toggle input[type="checkbox"],
.hud-switch input[type="checkbox"],
input[type="checkbox"].hud-switch-input {
  width: 38px;
  height: 18px;
  border: 1px solid var(--hud-input-border-hover);
  background: #050505;
  position: relative;
  overflow: hidden;
}

.ai-toggle input[type="checkbox"]::after,
.hud-switch input[type="checkbox"]::after,
input[type="checkbox"].hud-switch-input::after {
  display: none !important;
}

.ai-toggle input[type="checkbox"]::before,
.hud-switch input[type="checkbox"]::before,
input[type="checkbox"].hud-switch-input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: var(--text3);
  transition: transform 0.18s ease, background 0.18s ease;
}

.ai-toggle input[type="checkbox"]:checked,
.hud-switch input[type="checkbox"]:checked,
input[type="checkbox"].hud-switch-input:checked {
  background: rgba(0, 172, 172, 0.15);
  border-color: var(--accent-bright);
}

.ai-toggle input[type="checkbox"]:checked::before,
.hud-switch input[type="checkbox"]:checked::before,
input[type="checkbox"].hud-switch-input:checked::before {
  transform: translateX(20px);
  background: var(--accent-bright);
  box-shadow: 0 0 8px rgba(0, 212, 170, 0.55);
}

.ai-toggle--compact {
  margin: 0;
  gap: 0;
}

/* ── Custom Radio ── */
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin: 0;
  border: 1px solid var(--hud-input-border-hover);
  background: var(--hud-input-bg);
  border-radius: 0 !important;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="radio"]:hover {
  border-color: var(--accent-bright);
}

input[type="radio"]:checked {
  border-color: var(--accent-bright);
  background: rgba(0, 172, 172, 0.12);
}

input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--accent-bright);
  box-shadow: 0 0 6px rgba(0, 212, 170, 0.5);
}

input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: var(--hud-input-glow);
}

/* ── Text inputs (HUD unified) ── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
textarea:not(.sap-chat-input),
.form-control,
.form-input {
  background: var(--hud-input-bg) !important;
  border: 1px solid var(--hud-input-border) !important;
  border-radius: 0 !important;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="search"]:hover,
textarea:not(.sap-chat-input):hover,
.form-control:hover,
.form-input:hover {
  border-color: var(--hud-input-border-hover) !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
textarea:not(.sap-chat-input):focus,
.form-control:focus,
.form-input:focus {
  border-color: var(--hud-input-border-focus) !important;
  box-shadow: var(--hud-input-glow);
  outline: none;
}

/* ── License module checklist (Licensing page) ── */
.license-module-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 12px;
  border: 1px solid var(--hud-input-border);
  background: rgba(0, 0, 0, 0.35);
}

.license-module-chip {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 7px 12px !important;
  margin: 0 !important;
  border: none !important;
  border-bottom: 1px solid rgba(0, 172, 172, 0.08) !important;
  border-radius: 0 !important;
  background: transparent !important;
  font-family: var(--font-mono);
  font-size: 10px !important;
  font-weight: 500 !important;
  letter-spacing: 0.03em;
  color: var(--text2) !important;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.license-module-chip:last-child {
  border-bottom: none !important;
}

.license-module-chip:hover {
  background: rgba(0, 172, 172, 0.05) !important;
  color: var(--text) !important;
}

.license-module-chip.active {
  background: rgba(0, 172, 172, 0.1) !important;
  color: var(--accent-bright) !important;
  box-shadow: inset 3px 0 0 var(--accent-bright);
}

.license-module-chip span {
  flex: 1;
  text-transform: lowercase;
}

.license-module-chip span::first-letter {
  text-transform: uppercase;
}

/* Table inline selects */
.data-table select,
.hud-table select,
table.data-table .sector-select {
  min-width: 120px;
  font-size: 10px;
}

/* Date range bar */
.date-range-selects {
  align-items: center;
}
.date-range-selects .date-range-select {
  min-width: 108px;
}

.page-tab-date-range .date-range-select {
  font-family: var(--font-mono);
  font-size: 10px;
}

/* Form labels */
.form-group label,
.hud-field-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0, 172, 172, 0.65);
}

/* Checkbox/radio in labels */
label:has(> input[type="checkbox"]:not(.hud-switch-input)),
label:has(> input[type="radio"]) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
