@layer base, components, pages;

@layer components {
  label { font-weight: 600; font-size: var(--text-sm); }
  fieldset { border: 0; padding: 0; margin: 0; }
  legend { font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--space-2); }
  input:is([type=email], [type=text], [type=number], [type=search], [type=date], [type=url], [type=tel]), textarea, select {
    font: inherit; padding: var(--space-3); border-radius: var(--radius-md); border: 1px solid color-mix(in srgb, var(--fg) 25%, transparent);
    background: var(--bg); color: var(--fg); width: 100%; }
  textarea { resize: vertical; }
  input[type=file] { font: inherit; max-width: 100%; }
  .field { display: grid; gap: var(--space-2); }
  .field.ask { padding: var(--space-3); border-radius: var(--radius-md); border: 1px dashed var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--bg)); }
  .form-foot { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; margin-top: var(--space-2); }
  .form-errors { border-left: var(--layer-line) solid var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--bg)); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); }
  .form-errors p, .form-errors ul { margin: 0; }
  .searchbar { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); }

  /* A checkbox with its sentence. */
  .check { display: flex; gap: var(--space-2) var(--space-3); align-items: flex-start; font-weight: 500; }
  .check input { flex: none; width: 1.15rem; height: 1.15rem; margin: .2rem 0 0; accent-color: var(--accent); }
  .choice-line { display: flex; align-items: center; gap: var(--space-2); font-weight: 500; }

  /* Choice rows (offering options) and pill-shaped choices (reserve form, materials). */
  .choice-group { border: 0; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
  .choice-group legend { font-family: var(--font-display); font-weight: 700; font-size: var(--text-base); margin-bottom: var(--space-2); }
  .choice { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3); align-items: center; min-height: 44px; padding: var(--space-3); border-radius: var(--radius-md); border: 1px solid color-mix(in srgb, var(--fg) 14%, transparent); cursor: pointer; font-weight: 500; }
  .choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
  .choice input { accent-color: var(--accent); width: 1.1rem; height: 1.1rem; }
  .choice-price { color: var(--muted); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
  .pill-choices { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
  .pill-choices legend { width: 100%; }
  .pill-choice, .choice-chip { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; font-weight: 500; padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill);
                               border: 1px solid color-mix(in srgb, var(--fg) 20%, transparent); cursor: pointer; }
  .pill-choice:has(input:checked), .choice-chip:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg)); }
  .pill-choice input, .choice-chip input { accent-color: var(--accent); margin: 0; }
  .modes { border: 0; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
  .mode { display: flex; gap: var(--space-3); align-items: flex-start; font-weight: 400; padding: var(--space-3); border: 1px solid color-mix(in srgb, var(--fg) 15%, transparent); border-radius: var(--radius-md); cursor: pointer; }
  .mode:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
  .mode input { margin-top: 4px; accent-color: var(--accent); }
}
