:root {
  --form-padding: .375rem .75rem;
  --form-color: #333;
  --form-background: #fff;
  --form-border-width: 1px;
  --form-border-color: currentColor;
  --form-vertical-rhythm: 1rem;
}

/* CSS Toolkit - form */

/*
 * Avoid 300ms click delay on touch devices that support the `touch-action` CSS
 * property.
 */

input,
label,
select,
textarea {
  touch-action: manipulation;
}

/*
 * Remove inner padding and border in Firefox 4+.
 */

input::-moz-focus-inner {
  padding: 0;
  border: 0;
}

/*
 * Fix the cursor style for Chrome's increment/decrement buttons. For certain
 * `font-size` values of the `input`, it causes the cursor style of the
 * decrement button to change from `default` to `text`.
 */

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  height: auto;
}

/*
 * 1. Address `appearance` set to `searchfield` in Safari and Chrome.
 * 2. This overrides the extra rounded corners on search inputs in iOS so that our
 *    `.form-control` class can properly style them. Note that this cannot simply
 *    be added to `.input` as it's not specific enough.
 */

/* stylelint-disable property-no-vendor-prefix, rule-no-duplicate-properties */

input[type="search"] {
  -webkit-appearance: textfield; /* 1 */
  -webkit-appearance: none; /* 2 */
}

/* stylelint-enable */

/*
 * Remove inner padding and search cancel button in Safari and Chrome on OS X.
 * Safari (but not Chrome) clips the cancel button when the search input has
 * padding (and `textfield` appearance).
 */

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  appearance: none;
}

/*
 * 1. Remove default vertical scrollbar in IE 8/9/10/11.
 * 2. Textareas should really only resize vertically so they don't break their
 *    (horizontal) containers.
 */

textarea {
  overflow: auto; /* 1 */
  resize: vertical; /* 2 */
}

/*
 * 1. Chrome and Firefox set a `min-width: min-content;` on fieldsets,
 *    so we reset that to ensure it behaves more like a standard block element.
 * 2. Reset the default outline behavior of fieldsets so they don't affect
 *    page layout.
 */

fieldset {
  min-width: 0; /* 1 */
  margin: 0; /* 2 */
  padding: 0; /* 2 */
  border: 0; /* 2 */
}

.form-group {
  margin: 0 0 var(--form-vertical-rhythm);
}

/*
 * 1. Normalize `box-sizing` across all elements that this component could be
 *    applied to.
 * 2. Address margins set differently in Firefox 4+, Safari, and Chrome.
 *    Known issue: affects color of disabled elements.
 * 3. Correct font properties not being inherited.
 * 4. Correct color not being inherited.
 * 5. iOS adds rounded borders by default.
 */

.form-control {
  box-sizing: border-box; /* 1 */
  display: inline-block;
  width: 100%;
  margin: 0; /* 2 */
  padding: var(--form-padding);
  vertical-align: middle;
  font: inherit; /* 3 */
  line-height: inherit; /* 3 */
  color: var(--form-color); /* 4 */
  background: var(--form-background);
  background-image: none;
  border: var(--form-border-width) solid var(--form-border-color);
  border-radius: 0; /* 5 */
}

/*
 * Unstyle the caret on `<select>`s in IE10+.
 */

.form-control::-ms-expand {
  background-color: transparent;
  border: 0;
}

.form-control:focus {
  outline: none;
}

.form-control:disabled {
  cursor: not-allowed;
  opacity: 1;
}

.radio,
.checkbox {
  position: relative;
  display: block;
  margin-bottom: .75rem;
}

.radio label,
.checkbox label {
  margin-bottom: 0;
  padding-left: 1.25rem;
  cursor: pointer;
}

.radio.disabled label,
.checkbox.disabled label {
  cursor: not-allowed;
}

.radio label input:only-child,
.checkbox label input:only-child {
  position: static;
}

.radio input[type="radio"],
.checkbox input[type="checkbox"] {
  position: absolute;
  margin-top: .25rem;
  margin-left: -1.25rem;
}

.radio + .radio,
.checkbox + .checkbox {
  margin-top: -.25rem;
}

