/* Ticket Office — Localpro, Inc. Self-hosted, no external fonts or CDNs. */
:root {
  --brand: #0f5f5c;
  --brand-strong: #0b4744;
  --brand-soft: #e3f1ef;
  --accent: #c2410c;
  --danger: #b42318;
  --danger-strong: #8f1c13;
  --danger-soft: #fdecea;
  --success: #17663a;
  --success-soft: #e6f4ea;
  --warning: #8a5a00;
  --warning-soft: #fdf3dc;
  --info: #1d4f91;
  --info-soft: #e8f0fb;
  --bg: #f6f3ec;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --text: #1d2329;
  --text-muted: #5b6570;
  --border: #e3ddd0;
  --input-border: #b9b2a3;
  --focus: #2563eb;
  --shadow: 0 1px 2px rgba(29, 35, 41, .06), 0 4px 16px rgba(29, 35, 41, .06);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #4fc1b8;
    --brand-strong: #7fd6cf;
    --brand-soft: #123634;
    --accent: #fb923c;
    --danger: #f97066;
    --danger-strong: #fda29b;
    --danger-soft: #3a1714;
    --success: #6ccf8e;
    --success-soft: #133120;
    --warning: #f5c35b;
    --warning-soft: #352a10;
    --info: #8db8f2;
    --info-soft: #14243b;
    --bg: #111518;
    --surface: #1a2024;
    --surface-2: #20272c;
    --text: #e8ebee;
    --text-muted: #a3adb6;
    --border: #2d363d;
    --input-border: #4a555e;
    --focus: #8db8f2;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
ul { margin: 0 0 .75rem; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-strong); }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface); color: var(--text); padding: .5rem 1rem; z-index: 10;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.nav-content { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand-mark { color: var(--brand); flex: none; }
.brand-by { font-weight: 500; font-size: .75rem; color: var(--text-muted); letter-spacing: .02em; }
.nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .5rem; }
.nav-links a, .nav-links .link-button {
  color: var(--text-muted); text-decoration: none; font-size: .925rem; padding: .4rem .6rem; border-radius: 8px;
}
.nav-links a:hover, .nav-links .link-button:hover { color: var(--text); background: var(--surface-2); }
.nav-links a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.nav-user { font-size: .85rem; color: var(--text-muted); padding: 0 .4rem; overflow-wrap: anywhere; }
.nav-sep { width: 1px; height: 1.25rem; background: var(--border); margin: 0 .25rem; }
.link-button { background: none; border: 0; font: inherit; cursor: pointer; }
.inline-form { display: inline; margin: 0; }

.main-content { flex: 1; padding: 2rem 0 3rem; }
.site-footer { border-top: 1px solid var(--border); color: var(--text-muted); font-size: .8rem; padding: 1rem 0; }
.site-footer .container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.75rem;
}
.card + .card { margin-top: 1rem; }
.card-header { margin-bottom: 1.25rem; }
.card-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
.card-description { color: var(--text-muted); margin-top: .35rem; }

/* Auth pages: ticket-stub card */
.auth-container { max-width: 440px; margin: 1.5rem auto; }
.auth-container .card { position: relative; border-top: 4px solid var(--brand); }
.auth-brand { display: flex; justify-content: center; margin-bottom: 1rem; color: var(--brand); }

/* Forms */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .35rem; }
.form-hint { font-size: .82rem; color: var(--text-muted); margin-top: .3rem; }
.form-input, select.form-input, textarea.form-input {
  width: 100%; padding: .65rem .8rem; font: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--input-border); border-radius: 8px;
}
.form-input:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.form-input[readonly] { background: var(--surface-2); }
.checkbox { display: flex; align-items: flex-start; gap: .5rem; margin: .35rem 0; font-size: .95rem; }
.checkbox input { margin-top: .3rem; width: 1rem; height: 1rem; accent-color: var(--brand); }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: .75rem 1rem; margin: 0 0 1.1rem; }
legend { font-weight: 600; font-size: .9rem; padding: 0 .25rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.05rem; font: inherit; font-size: .925rem; font-weight: 600; line-height: 1.2;
  border-radius: 8px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); color: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary { color: #0b1a19; }
  :root:not([data-theme="light"]) .btn-primary:hover { color: #0b1a19; }
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-strong); color: #fff; }
.btn-outline { background: transparent; border-color: var(--input-border); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: .3rem .6rem; font-size: .8rem; }
.btn-full { width: 100%; }
.btn-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 auto; }

/* Alerts */
.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .925rem; border: 1px solid transparent; }
.alert p:last-child, .alert ul:last-child { margin-bottom: 0; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: currentColor; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: currentColor; }
.alert-info { background: var(--info-soft); color: var(--info); border-color: currentColor; }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: currentColor; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .7rem .75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; color: var(--text-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover { background: var(--surface-2); }

/* Badges */
.badge { display: inline-flex; padding: .1rem .55rem; font-size: .75rem; font-weight: 600; border-radius: 999px; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }

/* Stats */
.grid { display: grid; gap: 1.25rem; }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.stat-value { font-size: 2rem; font-weight: 700; }
.stat-label { color: var(--text-muted); font-size: .875rem; }

/* Scope list on consent */
.scope-list { list-style: none; padding: 0; margin: .5rem 0 1.25rem; }
.scope-list li { display: flex; gap: .6rem; padding: .55rem 0; border-bottom: 1px dashed var(--border); }
.scope-list li::before { content: ""; flex: none; width: .55rem; height: .55rem; margin-top: .5rem; border-radius: 50%; background: var(--brand); }

/* Perforation divider (ticket motif) */
.perforation { border: 0; border-top: 2px dashed var(--border); margin: 1.5rem -1.75rem; }

dl.details { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1rem; margin: 0; }
dl.details dt { color: var(--text-muted); }
dl.details dd { margin: 0; overflow-wrap: anywhere; }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: .875rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); }

@media (max-width: 768px) {
  .grid-cols-3 { grid-template-columns: 1fr; }
  .card { padding: 1.25rem; }
  .perforation { margin: 1.25rem -1.25rem; }
  .main-content { padding: 1.25rem 0 2rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
