/*
 * Forms - Modern & Clean
 */

.form-label {
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: var(--space-2);
  font-size: var(--font-ui-label);
}

.form-control,
.form-select {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-secondary);
  color: var(--text-primary);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--font-ui-label);
  transition: all var(--transition-fast);
  min-height: 44px;
}

.form-control:focus,
.form-select:focus {
  background: var(--bg-surface);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.18);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-tertiary);
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
  background: var(--bg-tertiary);
  border-color: var(--border-primary);
  color: var(--text-tertiary);
  opacity: 1;
  cursor: not-allowed;
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.form-text {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  margin-top: var(--space-2);
}

/* Modern checkbox/radio styling used across forms */
.form-check-input {
  width: 1.125rem;
  height: 1.125rem;
  border: 1.5px solid var(--border-secondary);
  background-color: var(--bg-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.form-check-input[type="checkbox"] {
  border-radius: 0.35rem;
}

.form-check-input[type="radio"] {
  border-radius: 999px;
}

.form-check-input:checked {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.form-check-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--accent-primary-rgb), 0.22);
}

.task-definition-list {
  min-height: 16rem;
  max-height: 22rem;
  overflow-y: auto;
}

.task-definition-panel {
  border: 1.5px solid var(--border-secondary);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  max-height: 22rem;
  overflow-y: auto;
  padding: var(--space-2);
}

.task-definition-option {
  width: 100%;
  border: 1px solid transparent;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  text-align: left;
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-primary);
}

.task-definition-option:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.task-definition-option.active {
  border-color: var(--accent-primary);
  background: rgba(var(--accent-primary-rgb), 0.1);
}

.task-definition-option__catalog {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
}

.requirement-row-main {
  cursor: pointer;
}

.requirement-attendees-toggle {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.requirement-attendees-toggle .requirement-attendees-chevron {
  font-size: 1.05rem;
  font-weight: 700;
  display: inline-block;
  transition: transform var(--transition-fast);
}

.requirement-attendees-toggle.is-expanded .requirement-attendees-chevron {
  transform: rotate(180deg);
}

.input-group-text {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-secondary);
  border-right: none;
  color: var(--text-secondary);
}

.input-group .form-control {
  border-left: none;
}

.pick1-wager-group .input-group-text {
  background: var(--bg-elevated);
  color: var(--text-primary);
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-right: none;
  border-left: 1.5px solid var(--border-secondary);
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* Keep wager input and coin icon on one line to avoid wrapping on validation re-renders */
.pick1-wager-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
}

.pick1-wager-group .form-control {
  min-width: 0;
  border-left: none;
  border-right: 1.5px solid var(--border-secondary);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

/* Mobile forms */
@media (max-width: 768px) {
  .form-control,
  .form-select,
  .input-group-text {
    font-size: 16px; /* Prevents iOS zoom */
  }

  .input-group-sm .form-control,
  .input-group-sm .form-select,
  .input-group-sm .input-group-text {
    font-size: 16px;
  }

  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  textarea,
  select {
    font-size: 16px;
  }
}

/* Yes/No probability slider */
.yes-no-probability-slider {
  --yes-prob: 50%;
  height: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--success) 0%, var(--success) var(--yes-prob), var(--error) var(--yes-prob), var(--error) 100%);
}

.yes-no-probability-readout {
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.yes-no-probability-slider:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--success-rgb), 0.25);
}

.yes-no-probability-slider::-webkit-slider-runnable-track {
  height: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--success) 0%, var(--success) var(--yes-prob), var(--error) var(--yes-prob), var(--error) 100%);
}

.yes-no-probability-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 0 1px var(--border-secondary);
  margin-top: -5px;
}

.yes-no-probability-slider::-moz-range-track {
  height: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--success) 0%, var(--success) var(--yes-prob), var(--error) var(--yes-prob), var(--error) 100%);
  border: none;
}

.yes-no-probability-slider::-moz-range-progress {
  background: transparent;
}

.yes-no-probability-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 0 1px var(--border-secondary);
}

/* Claim probability slider (same visual as yes-no, using --claim-prob variable) */
.claim-probability-slider {
  --claim-prob: 67%;
  height: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--success) 0%, var(--success) var(--claim-prob), var(--error) var(--claim-prob), var(--error) 100%);
}

.claim-probability-slider:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--success-rgb), 0.25);
}

.claim-probability-slider::-webkit-slider-runnable-track {
  height: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--success) 0%, var(--success) var(--claim-prob), var(--error) var(--claim-prob), var(--error) 100%);
}

.claim-probability-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 0 1px var(--border-secondary);
  margin-top: -5px;
}

.claim-probability-slider::-moz-range-track {
  height: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--success) 0%, var(--success) var(--claim-prob), var(--error) var(--claim-prob), var(--error) 100%);
  border: none;
}

.claim-probability-slider::-moz-range-progress {
  background: transparent;
}

.claim-probability-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 0 1px var(--border-secondary);
}

/*
 * Grid matrix checkboxes — larger tap target, accent green when checked.
 * Use with `form-check-input form-check-grid` (requirement tracking, tabir distribution matrices, …).
 */
.form-check-input.form-check-grid {
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  min-height: 1.25rem;
  margin: 0;
  border: 1.5px solid var(--border-primary);
  background-color: var(--bg-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
}

.form-check-input.form-check-grid:checked {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: none;
}

.form-check-input.form-check-grid:indeterminate {
  background-color: color-mix(in srgb, var(--accent-primary) 58%, var(--bg-surface));
  border-color: var(--accent-primary);
}

.form-check-input.form-check-grid:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--accent-primary-rgb), 0.25);
}

.form-check-input.form-check-grid:checked:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--accent-primary-rgb), 0.25);
}

.form-check-input.form-check-grid:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Org access toolbar width — segmented-toggle--capsule lives in segmented_toggle.css */
.org-access-unit-type-toolbar {
  width: 100%;
}

/* Bilingual name: isolate margins so opening <details> does not shift the primary row; space before disclosure */
.bilingual-user-name {
  display: flow-root;
}

.bilingual-user-name__other {
  margin-top: var(--space-2);
}

.bilingual-user-name__other > .bilingual-user-name__summary {
  margin-block: 0;
  padding-block: 0;
}

.bilingual-user-name__secondary-row {
  margin-top: 0;
  margin-bottom: var(--space-4);
}

.bilingual-user-name__rule {
  margin-top: 0;
  padding-top: var(--space-1);
}
