/* Figment UI theme - plain CSS, no build step. See DESIGN.md.
   Tokens match the live website (figment.live, measured Oct 2026). */

:root {
  --background: #ffffff;        /* page: white, like figment.live */
  --foreground: #111111;        /* text: near-black */
  --surface: #f7f2ef;           /* light cream panels */
  --sand: #eee6de;              /* sand blocks: hero, sidebars, topic cards */
  --muted: #eee6de;             /* tonal fills */
  --muted-foreground: #6b6460;  /* secondary text */
  --border: #e4dad1;            /* hairlines */
  --input: #ffffff;

  --brand: #c65e33;             /* terracotta: primary actions (website buttons) */
  --brand-foreground: #ffffff;
  --brand-hover: #a94c27;
  --brand-soft: #f6e3d8;        /* selected rows, soft highlights */
  --brand-ring: #e6b9a1;        /* focus rings */

  --accent: #478ba1;            /* teal: labels, links, scrolled header on the website */
  --accent-soft: #e4eff2;
  --deep: #1c3d44;              /* deep teal: dark strips */

  --destructive: #b3261e;
  --success: #2f6b3a;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-display: "DM Serif Display", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; border-radius: 0; }  /* sharp corners everywhere */

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font: 16px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

.page { max-width: 36rem; margin: 0 auto; padding: 3rem 1rem; }
.header { text-align: center; margin-bottom: 2.5rem; }
.logo { height: 2.5rem; width: auto; }

h1, .display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.25rem, 6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 1.5rem 0 0.75rem;
}
h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; margin: 0 0 1rem; }
.lead, .muted { color: var(--muted-foreground); }
.small { font-size: 0.8125rem; }

.card { background: var(--surface); border: 1px solid var(--border); padding: 1.5rem; }
@media (min-width: 640px) { .card { padding: 2rem; } }
.stack { display: flex; flex-direction: column; gap: 1.25rem; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }

label { display: flex; flex-direction: column; gap: 0.375rem; }
.label {
  font-size: 0.75rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted-foreground);
}

input, select, textarea {
  font: inherit; font-size: 0.875rem;
  color: var(--foreground);
  background: var(--input);
  border: 1px solid var(--border);
  padding: 0.7rem 0.875rem;
  width: 100%;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring);
}
input[type="file"] { padding: 0.5rem; color: var(--muted-foreground); cursor: pointer; }
input[type="file"]::file-selector-button {
  margin-right: 0.75rem; padding: 0.5rem 1rem; cursor: pointer;
  font: 500 0.8125rem var(--font-sans); color: var(--foreground);
  background: var(--surface); border: 1px solid var(--border); transition: background 0.15s;
}
input[type="file"]::file-selector-button:hover { background: var(--brand-soft); }
input[readonly] { background: var(--muted); color: var(--muted-foreground); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 3rem; padding: 0 1.5rem;
  font: 500 0.875rem var(--font-sans);
  color: var(--brand-foreground); background: var(--brand);
  border: 1px solid var(--brand); cursor: pointer; transition: background 0.15s;
}
.btn:hover { background: var(--brand-hover); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--foreground); border-color: var(--border); }
.btn.secondary:hover { background: var(--brand-soft); }
.btn.block { width: 100%; }
.btn.loading:disabled { opacity: 0.85; cursor: progress; }
.spinner {
  width: 1rem; height: 1rem; border-radius: 9999px;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab {
  flex: 1; padding: 0.75rem; background: none; border: 0; border-bottom: 2px solid transparent;
  font: 500 0.875rem var(--font-sans); color: var(--muted-foreground); cursor: pointer;
}
.tab[aria-selected="true"] { color: var(--foreground); border-bottom-color: var(--brand); }

.pill {
  display: inline-block; padding: 0.15rem 0.6rem;
  font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--brand-soft); color: var(--brand-hover);
}
.alert { padding: 0.75rem 1rem; font-size: 0.875rem; border: 1px solid; }
.alert.error { color: var(--destructive); border-color: color-mix(in srgb, var(--destructive) 30%, transparent);
  background: color-mix(in srgb, var(--destructive) 5%, transparent); }
.alert.ok { color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent);
  background: color-mix(in srgb, var(--success) 6%, transparent); }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr)); gap: 0.5rem; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--border); }
.mono { font-family: var(--font-mono); }
.note { padding: 0.75rem 1rem; background: var(--input); border-left: 2px solid var(--brand-ring); }
h2#hi { margin: 0; }

.field { display: flex; flex-direction: column; gap: 0.375rem; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 480px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.grid2:has(> [hidden]) > * { grid-column: 1 / -1; }

/* Bill / order summary */
.bill { display: flex; flex-direction: column; gap: 0.5rem; padding: 1rem 1.25rem; background: var(--input); border: 1px solid var(--border); }
.bill-row, .bill-total { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.875rem; }
.bill-total { padding-top: 0.5rem; border-top: 1px solid var(--border); font-family: var(--font-display); font-size: 1.5rem; }

/* Select: trigger + popover with search (replaces native <select>/<datalist>) */
.select { position: relative; }
.select-trigger {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  padding: 0.7rem 0.875rem; text-align: left;
  font: inherit; font-size: 0.875rem; color: var(--foreground);
  background: var(--input); border: 1px solid var(--border); cursor: pointer;
}
.select-trigger svg { color: var(--muted-foreground); flex-shrink: 0; transition: transform 0.15s; }
.select-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.select-trigger:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.select-value { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-pop {
  position: absolute; left: 0; right: 0; top: 100%; margin-top: 0.5rem; z-index: 30;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}
.select-group { padding: 0.625rem 0.875rem 0.25rem; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-foreground); list-style: none; }
.select-search {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border);
}
.select-search svg { color: var(--muted-foreground); flex-shrink: 0; }
.select-search input { border: 0; background: transparent; padding: 0.25rem 0; box-shadow: none; }
.select-search input:focus { box-shadow: none; }
.select-list { list-style: none; margin: 0; padding: 0.25rem; max-height: 16rem; overflow-y: auto; }
.select-opt {
  display: flex; align-items: center; gap: 0.5rem; justify-content: space-between;
  padding: 0.5rem 0.75rem; font-size: 0.875rem; cursor: pointer;
}
.select-opt.active, .select-opt:hover { background: var(--brand-soft); cursor: pointer; } /* hover colours the option (every page) */
.select-opt.selected { color: var(--brand); font-weight: 500; }
.select-opt svg { color: var(--brand); flex-shrink: 0; }
.select-sub { display: block; font-size: 0.75rem; font-weight: 400; color: var(--muted-foreground); }
.select-empty { padding: 0.5rem 0.75rem; font-size: 0.875rem; color: var(--muted-foreground); }

/* Date picker: trigger + popover calendar (port of Agent Portal date-filter.tsx) */
.datepick { position: relative; }
.date-trigger {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  padding: 0.7rem 0.875rem; text-align: left;
  font: inherit; font-size: 0.875rem; color: var(--foreground);
  background: var(--input); border: 1px solid var(--border); cursor: pointer;
}
.date-trigger svg { color: var(--muted-foreground); flex-shrink: 0; }
.date-trigger:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.cal {
  position: absolute; left: 0; top: 100%; margin-top: 0.5rem; z-index: 20; width: 18rem;
  padding: 0.75rem; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; padding: 0 0.25rem; }
.cal-title { font-family: var(--font-display); font-size: 1rem; background: none; border: 0; color: inherit; cursor: pointer; padding: 0.25rem 0.5rem; }
.cal-title:hover:not(:disabled) { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.cal-title:disabled { cursor: default; }
/* months and years: 3 across, wide buttons (also beats the rental form's 7-column day grid) */
.cal .cal-grid.cal-months, .cal .cal-grid.cal-years { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.25rem; }
.cal .cal-grid.cal-months .cal-day, .cal .cal-grid.cal-years .cal-day { width: 100%; max-width: none; height: 2.5rem; aspect-ratio: auto; border-radius: 0 !important; }
.cal-type { width: 100%; margin-top: 0.5rem; padding: 0.4rem 0.6rem; border: 1px solid var(--border); background: var(--surface); font: inherit; font-size: 0.875rem; color: var(--foreground); }
.cal-type:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.cal-type.bad { border-color: #c0392b; color: #c0392b; }
.cal-nav, .cal-day {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 9999px; background: none; cursor: pointer;
  font: inherit; transition: background 0.15s, color 0.15s;
}
.cal-nav { width: 1.75rem; height: 1.75rem; color: var(--muted-foreground); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); justify-items: center; }
.cal-dow {
  padding: 0.25rem 0; font-size: 0.75rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-foreground);
}
.cal-day { width: 2.25rem; height: 2.25rem; font-size: 0.875rem; color: var(--foreground); }
.cal-day.out { color: color-mix(in srgb, var(--muted-foreground) 40%, transparent); }
.cal-day.today { font-weight: 600; color: var(--brand); }
.cal-nav:hover:not(:disabled), .cal-day:hover:not(:disabled) { background: var(--brand-soft); color: var(--brand); }
.cal-day.selected, .cal-day.selected:hover { background: var(--brand); color: var(--brand-foreground); font-weight: 500; }
.cal-nav:disabled, .cal-day:disabled { opacity: 0.3; cursor: not-allowed; }
.cal-nav:focus-visible, .cal-day:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
[hidden] { display: none !important; }

html { scrollbar-width: thin; scrollbar-color: var(--brand-ring) var(--brand-soft); }

/* calendar footer (Clear / Today) and link buttons: shared by every page (were only in the staff portal) */
.cal-foot { display: flex; justify-content: space-between; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.cal-foot .linkbtn:only-child { margin-left: auto; }
.linkbtn { background: none; border: 0; padding: 0.25rem 0.375rem; color: var(--brand); font: inherit; font-size: 0.8125rem; font-weight: 500; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }

/* THEMED TIME PICKER (themed.js themeTime): hours and minutes side by side, each scrolling */
.time-pop { width: 15rem; }
.time-heads, .time-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; text-align: center; }
.time-col { display: flex; flex-direction: column; max-height: 13rem; overflow-y: auto; border: 1px solid var(--border); background: var(--surface); }
/* options look like the portal's dropdown lists (sharp, no pills): soft highlight on hover, brand colour when chosen */
.time-col .cal-day { flex: none; width: 100%; height: 2.125rem; border-radius: 0 !important; justify-content: center; }
.time-col .cal-day:hover:not(:disabled) { background: var(--brand-soft); color: var(--brand); }
.time-col .cal-day.selected, .time-col .cal-day.selected:hover { background: var(--brand-soft); color: var(--brand); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
