/**
 * rt-fields - Form field styles
 *
 * Not a web component. Pure CSS classes for form inputs.
 * All inputs use 2px borders, mustard focus ring, surface-muted backgrounds.
 *
 * Classes:
 *   .input-brutalist   - Text inputs, selects, textareas (focus ring only)
 *   .checkbox-brutalist - Custom checkbox (rust when checked)
 *   .radio-brutalist    - Custom radio (navy when checked)
 *   .switch-brutalist   - Toggle switch (navy when on, checkmark in thumb)
 */

/* Focus ring for all interactive elements */
.input-brutalist:focus {
  outline: 3px solid #E6B800;
  outline-offset: 0;
}
button:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid #E6B800;
  outline-offset: 0;
}
.input-brutalist.input-error:focus {
  outline-color: #FCA5A5;
}

/* Checkbox */
.checkbox-brutalist {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #292524;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.checkbox-brutalist:checked {
  background: #C2410C;
}
.checkbox-brutalist:checked::after {
  content: '✓';
  position: absolute;
  color: white;
  font-size: 12px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.checkbox-brutalist:focus {
  outline: none;
  box-shadow: 0 0 0 3px #E6B800;
}
.checkbox-brutalist:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Radio */
.radio-brutalist {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #292524;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.radio-brutalist:checked {
  background: white;
  border-color: #1E3A5F;
}
.radio-brutalist:checked::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: #1E3A5F;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.radio-brutalist:focus {
  outline: none;
  box-shadow: 0 0 0 3px #E6B800;
}
.radio-brutalist:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Switch */
.switch-brutalist {
  appearance: none;
  width: 44px;
  height: 24px;
  border: 2px solid #292524;
  border-radius: 9999px;
  background: #F5F5F4;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.switch-brutalist::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border: 2px solid #292524;
  border-radius: 50%;
  top: 50%;
  left: 2px;
  transform: translateY(-50%);
  transition: left 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.switch-brutalist:checked {
  background: #EFF6FF;
  border-color: #1E3A5F;
}
.switch-brutalist:checked::after {
  left: calc(100% - 18px);
  background: #1E3A5F;
  border-color: #1E3A5F;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-size: 10px;
  background-position: center;
  background-repeat: no-repeat;
}
.switch-brutalist:focus {
  outline: none;
  box-shadow: 0 0 0 3px #E6B800;
}
.switch-brutalist:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
