/* =====================================================================
 *  ordres.css  -  shared pieces for /ordres
 *  ---------------------------------------------------------------------
 *  Buttons, fields, chips and the toast, used by both the builder and the
 *  admin screen. Everything here is built from the theme tokens in
 *  assets/css/bico-theme.css so the section follows the site when the
 *  theme or the language changes, rather than carrying its own palette.
 * ===================================================================== */

/* ---------------- buttons ---------------- */

.oa-btn,
.or-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-xs);
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.92rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
}

.oa-btn:hover,
.or-btn:hover { background: var(--surface-3); border-color: var(--gold-soft); }

.oa-btn:focus-visible,
.or-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.oa-btn[disabled],
.or-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.oa-btn--gold,
.or-btn--gold {
  background: var(--gold-wash);
  border-color: var(--gold-soft);
  color: var(--text-primary);
  font-weight: 600;
}
.oa-btn--gold:hover,
.or-btn--gold:hover { background: var(--gold-soft); }

.oa-btn--quiet,
.or-btn--quiet { background: transparent; border-color: var(--border); color: var(--text-secondary); }

.oa-btn--danger { border-color: color-mix(in srgb, var(--danger) 55%, var(--border-strong)); }
.oa-btn--danger:hover {
  background: color-mix(in srgb, var(--danger) 16%, var(--surface-2));
  border-color: var(--danger);
}

.oa-btn--sm { padding: 5px 8px; font-size: 0.85rem; }

/* ---------------- labelled inputs ---------------- */

.oa-f,
.or-f {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.oa-f > input,
.oa-f > select,
.oa-f > textarea,
.or-f > input,
.or-f > select,
.or-f > textarea {
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: normal;
}

.oa-f > input:focus,
.oa-f > select:focus,
.or-f > input:focus,
.or-f > select:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--surface-2);
}

.oa-f--grow { flex: 1 1 200px; }
.oa-f--narrow { flex: 0 0 130px; }

.oa-check,
.or-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.oa-check input,
.or-check input { accent-color: var(--gold); width: 15px; height: 15px; }

.oa-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-1);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.oa-chip input { accent-color: var(--gold); }
.oa-chip:has(input:checked) { border-color: var(--gold-soft); background: var(--gold-wash); color: var(--text-primary); }

.oa-hint,
.or-hint {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
}

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

.oa-toast,
.or-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 80;
  max-width: min(560px, calc(100vw - 32px));
  padding: 10px 16px;
  border: 1px solid var(--gold-soft);
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.92rem;
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.35);
}

.oa-toast.is-bad,
.or-toast.is-bad {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, var(--surface-3));
  /* A server error can be long; let it wrap rather than clip. */
  white-space: pre-wrap;
  word-break: break-word;
}
