/* Sign-in page only: the base look, buttons, forms, the demo picker and the sign-in card.
   Everything the signed-in app needs is in app.css, which boot.js adds after sign-in. */
:root {
  --text: #1a1a1a;
  --text-2: #55554f;
  --text-3: #85857e;
  --border: #d6d6d0;
  --border-light: #e8e8e3;
  --page: #f4f4f1;
  --white: #ffffff;
  --button: #26332d;
  --button-hover: #1a231f;
  --button-active: #0f1613;
  --free: #3b6a4c;
  --busy: #94510a;
  --danger: #a32a22;
  --focus: #1f5fbf;
  color-scheme: light;
  font-family: var(--font, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font-size: 15px; line-height: 1.5; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.25; }
h1, h2, h3, .brand, .timer { font-family: var(--font-heading, inherit); }
h1 { font-size: 20px; }
h2, h3 { font-size: 16px; }
h2[tabindex="-1"]:focus { outline: none; }
.muted { color: var(--text-3); margin: 2px 0 0; font-size: 14px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }

/* Taps register immediately on touch screens (no double-tap-zoom delay). */
button, label, select, summary { touch-action: manipulation; }
button { -webkit-tap-highlight-color: transparent; }

/* Buttons */
.btn { font: inherit; font-size: 14px; font-weight: 500; border: 1px solid transparent; border-radius: var(--radius, 4px); padding: 8px 14px; min-height: 40px; cursor: pointer; }
.btn:focus-visible, .link-btn:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--button); color: var(--button-text, #fff); }
.btn-primary:hover:not(:disabled) { background: var(--button-hover); }
.btn-primary:active:not(:disabled) { background: var(--button-active); }
.btn-secondary { background: var(--white); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--page); }
.btn-secondary:active:not(:disabled) { background: var(--border-light); }
.btn-quiet { background: transparent; color: var(--text-2); }
.btn-quiet:hover:not(:disabled) { background: var(--border-light); }
.btn-quiet:active:not(:disabled) { background: var(--border); }
.btn-danger { background: var(--danger); color: var(--danger-text, #fff); }
.btn-danger:active:not(:disabled) { background: #7c1f19; }
.btn-block { width: 100%; }
.btn-sm { padding: 4px 10px; min-height: 32px; font-size: 13px; }
.link-btn { background: none; border: 0; padding: 8px 4px; font: inherit; font-size: 13px; color: var(--text-2); text-decoration: underline; cursor: pointer; }
.link-btn:hover:not(:disabled) { color: var(--text); }
.link-btn:active:not(:disabled) { color: var(--text); opacity: .6; }
.link-btn:disabled { opacity: .4; cursor: not-allowed; }
.link-btn.is-danger:hover:not(:disabled) { color: var(--danger); }

/* Forms. 16px text stops iPhones zooming in when an input is tapped. */
label { display: block; font-size: 14px; font-weight: 500; }
input, select { display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 16px; color: var(--text); background: var(--white); border: 1px solid #bdbdb6; border-radius: var(--radius, 4px); padding: 8px 10px; min-height: 42px; }
.form-error { color: var(--danger); font-size: 14px; margin: 0; }
.form-info { color: var(--free); font-size: 14px; margin: 0; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
label.check input { width: 20px; height: 20px; min-height: 0; margin: 0; flex: none; }
.link-left { justify-self: start; padding-left: 0; }

/* Demo banner and the demo sign-in picker */
.demo-banner { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 14px; background: #fff4d6; border-bottom: 1px solid #e6cf8a; padding: 4px 16px; font-size: 13px; text-align: center; color: #5c4a12; }
.demo-actions { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 0 12px; }
.demo-actions .link-btn { color: #5c4a12; padding: 4px 2px; min-height: 0; min-width: 0; }
.demo-people-list { display: grid; gap: 8px; }
.demo-person { display: grid; gap: 2px; width: 100%; text-align: left; font: inherit; color: var(--text); background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg, 6px); padding: 10px 12px; cursor: pointer; }
.demo-person:hover { border-color: var(--text-3); background: var(--page); }
.demo-person:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.demo-person-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.demo-person small { font-size: 13px; color: var(--text-3); line-height: 1.35; }
.demo-or { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; font-size: 12px; color: var(--text-3); }
.demo-or::before, .demo-or::after { content: ""; flex: 1; border-top: 1px solid var(--border-light); }
.demo-or span { flex: none; }

/* Sign in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 360px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg, 6px); padding: 28px; display: grid; gap: 14px; }
.auth-sub { margin: -8px 0 4px; color: var(--text-3); font-size: 14px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: -6px; }
.auth-card h1 { font-size: 18px; }

.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; }
.brand::before { content: ""; flex: none; width: 24px; height: 24px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='7' fill='%2326332d'/%3E%3Cg fill='%23ffffff'%3E%3Ccircle cx='9.5' cy='14' r='2.5'/%3E%3Ccircle cx='13.6' cy='9.3' r='2.6'/%3E%3Ccircle cx='18.4' cy='9.3' r='2.6'/%3E%3Ccircle cx='22.5' cy='14' r='2.5'/%3E%3Cellipse cx='16' cy='20.5' rx='6.2' ry='5.2'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
.brand-lg { font-size: 20px; }
.brand-lg::before { width: 30px; height: 30px; }

/* White-label branding (see brand.js) */
.brand.has-logo::before { display: none; }
.brand-logo { display: block; height: 28px; width: auto; max-width: 160px; object-fit: contain; }
.brand-lg .brand-logo { height: 44px; max-width: 220px; }
.auth-card .brand { justify-self: start; }
.auth-note { margin: 0; color: var(--text-3); font-size: 13px; white-space: pre-line; }

@media (pointer: coarse), (max-width: 720px) {
  .btn { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
  .link-btn { min-height: 44px; min-width: 44px; padding: 10px 8px; }
  input { min-height: 44px; }
}

/* Form polish: softer borders, a clear focus state, a chevron on selects, tidy checkboxes and buttons.
   Looks only; sizes, hit areas and focus outlines are unchanged. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
select, textarea {
  border-color: var(--border); box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):hover:not(:disabled),
select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: var(--text-3); }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):focus,
select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(31, 95, 191, .15); }
input:disabled, select:disabled, textarea:disabled { background: var(--page); color: var(--text-3); cursor: not-allowed; }
::placeholder { color: var(--text-3); opacity: 1; }
select:not([multiple]):not([size]) {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%2355554f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px;
  background-color: var(--white); font-weight: 500; border-radius: var(--radius, 8px);
}
select:not([multiple]):not([size]):hover:not(:disabled) { background-color: var(--page); }
select:not([multiple]):not([size]):disabled { background-color: var(--page); }
select option { font-weight: 400; color: var(--text); background: var(--white); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--button); cursor: pointer; }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { cursor: not-allowed; }
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"] { cursor: text; }
input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .7; }
input::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.btn { transition: background-color .15s, border-color .15s, box-shadow .15s, opacity .15s; }
.btn-primary:not(:disabled), .btn-danger:not(:disabled) { box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.btn-secondary:not(:disabled) { box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.btn-secondary:hover:not(:disabled) { border-color: var(--text-3); }
.btn-danger:hover:not(:disabled) { filter: brightness(.92); }
