/* Fields, the search box, segmented controls and the range picker. */

.input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--radius-small);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--ink);
  font-size: 14px;
  outline: none;
}

.input:focus {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.input:disabled {
  background: var(--surface-sunk);
  color: var(--ink-3);
}

.input::placeholder {
  color: var(--ink-3);
  font-family: var(--font);
  text-transform: none;
}

.input-code {
  text-transform: uppercase;
}

.textarea {
  height: auto;
  min-height: 64px;
  padding: 9px 11px;
  resize: vertical;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field[hidden] {
  display: none;
}

.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.field-hint {
  font-size: 12px;
  color: var(--ink-3);
}

.field-problem {
  font-size: 13px;
  color: var(--critical-ink);
}

.field-problem:empty {
  display: none;
}

.search {
  position: relative;
  display: block;
  flex: 1 1 280px;
  max-width: 420px;
}

.search .icon {
  position: absolute;
  top: 10px;
  left: 11px;
  color: var(--ink-3);
  pointer-events: none;
}

.search-input {
  padding-left: 36px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* Segmented control, as the range picker and the code kind use it */
.segments {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: var(--surface-hover);
  box-shadow: inset 0 0 0 1px var(--line);
}

.segment {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
}

.segment:hover {
  color: var(--ink);
}

.segment.is-on {
  background: var(--surface);
  color: var(--ink);
  box-shadow:
    0 0 0 1px var(--line),
    0 1px 2px rgba(20, 22, 31, 0.08);
}

.segments-wide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 560px;
}

.segment-tall {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: auto;
  padding: 9px 12px;
  text-align: left;
  white-space: normal;
}

.segment-tall span {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
}

.range {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.range-custom {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 300px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--line),
    var(--shadow-lift);
}

.range-custom .button {
  grid-column: 1 / -1;
}

.range-custom .field-problem {
  grid-column: 1 / -1;
}

.input-date {
  padding: 0 8px;
}
