/* Forms, the drawer they open in, toasts and empty states. */

/* --- forms ------------------------------------------------------------------ */

.form-row {
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
}

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

.input,
.select,
.textarea {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 120ms, box-shadow 120ms;
}

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

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(33, 102, 55, 0.16);
}

.with-unit {
  display: flex;
}

.with-unit .input {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.with-unit .select {
  width: 96px;
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--sunk);
}

.unit-tag {
  display: grid;
  place-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--sunk);
  color: var(--ink-2);
  font-size: 13px;
  white-space: nowrap;
}

.form-error {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 14px;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  background: var(--late-tint);
  color: #7d2b19;
  font-weight: 600;
}

/* --- drawer ---------------------------------------------------------------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 32, 22, 0.32);
  animation: fade-in 140ms ease-out;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 460px;
  max-width: 100vw;
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 180ms ease-out;
}

.drawer.is-open {
  transform: none;
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.drawer-head h2 {
  font: 600 20px/1.2 var(--display);
  font-stretch: 90%;
  margin: 0;
}

.drawer-head .btn {
  margin-left: auto;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.drawer-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 24px;
  border-top: 1px solid var(--line-soft);
  background: var(--sunk);
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

/* --- toast ------------------------------------------------------------------ */

.toast {
  position: fixed;
  left: calc(50% + var(--rail) / 2);
  bottom: 24px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 22px;
  background: var(--brand-deep);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-lift);
  transition: opacity 160ms, transform 160ms;
}

.toast.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --- empty states ----------------------------------------------------------- */

.empty {
  text-align: center;
  padding: 44px 24px 48px;
  color: var(--ink-2);
}

.empty .icon {
  width: 36px;
  height: 36px;
  color: var(--brand);
  margin-bottom: 10px;
}

.empty h3 {
  font: 600 17px/1.3 var(--display);
  color: var(--ink);
  margin: 0 0 6px;
}

.empty p {
  margin: 0 auto 18px;
  max-width: 420px;
}
