/* legalfiles.ai — light theme only. Warm neutrals, low saturation, ample whitespace.
   Never a dark background anywhere in this file. */

:root {
  --bg: #faf8f4;            /* warm off-white page background */
  --surface: #ffffff;       /* cards and panels */
  --surface-soft: #f4f0e9;  /* subtle inset panels */
  --border: #e6dfd3;        /* hairline warm border */
  --border-strong: #d5ccbc;
  --text: #33302a;          /* warm near-black for text only (never a background) */
  --text-muted: #7d766a;
  --text-faint: #a39a8b;
  --accent: #8a6b45;        /* muted bronze — primary actions */
  --accent-hover: #755a39;
  --accent-soft: #f3ede3;   /* tint behind selected/active items */
  --ok: #5f7d5a;            /* muted green */
  --ok-soft: #eef3ec;
  --warn: #a3762f;          /* muted amber */
  --warn-soft: #f8f1e4;
  --bad: #a55a44;           /* muted terracotta */
  --bad-soft: #f8ece8;
  --info-soft: #eff2f0;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(70, 60, 45, 0.05), 0 4px 16px rgba(70, 60, 45, 0.06);
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
}

/* ---------- Top bar (owned by core.js) ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar .brand {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.topbar .brand .brand-dot { color: var(--accent); }

.topbar .topbar-spacer { flex: 1; }

.topbar .tenant-name {
  color: var(--text-muted);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

/* ---------- Notice region (owned by core.js) ---------- */

.notice-region { padding: 0 28px; }

.notice {
  margin: 18px auto 0;
  max-width: 1080px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--warn-soft);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.notice p { margin: 0; flex: 1; min-width: 220px; }

.notice .notice-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}

/* ---------- Main layout ---------- */

.app-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 28px 72px;
}

.app-footer {
  border-top: 1px solid var(--border);
  padding: 22px 28px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

.app-footer p { margin: 0; }

.noscript-msg { padding: 40px; text-align: center; }

/* ---------- Type & shared elements ---------- */

h1.page-title {
  font-size: 26px;
  font-weight: 650;
  margin: 0 0 6px;
}

p.page-subtitle {
  margin: 0 0 28px;
  color: var(--text-muted);
  font-size: 15px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.page-head .page-head-text { flex: 1; min-width: 240px; }
.page-head .page-head-text p.page-subtitle { margin-bottom: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.btn:disabled { opacity: 0.55; cursor: default; }

.btn-primary {
  background: var(--accent);
  color: #fffdf9;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-soft); }

.btn-quiet {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 10px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-quiet:hover { color: var(--text); }

.btn-sm { padding: 7px 14px; font-size: 14px; }

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.room-card {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.room-card .room-name {
  font-size: 17px;
  font-weight: 650;
  margin: 0;
}

.room-card .room-name a { color: var(--text); text-decoration: none; }
.room-card .room-name a:hover { text-decoration: underline; text-underline-offset: 3px; }

.room-card .room-deal-type {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

.room-card .room-stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 14px;
}

.room-card .room-open {
  margin-top: auto;
  padding-top: 6px;
}

/* ---------- Status chips ---------- */

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 550;
  border: 1px solid transparent;
  white-space: nowrap;
}

.chip-ok   { background: var(--ok-soft);   color: var(--ok);   border-color: #d8e2d4; }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: #eadfc4; }
.chip-bad  { background: var(--bad-soft);  color: var(--bad);  border-color: #ecd6cd; }
.chip-neutral { background: var(--surface-soft); color: var(--text-muted); border-color: var(--border); }

/* ---------- Forms ---------- */

.form-card {
  max-width: 460px;
  margin: 24px auto 0;
  padding: 36px 38px;
}

.form-card h1 {
  font-size: 22px;
  font-weight: 650;
  margin: 0 0 6px;
}

.form-card .form-lede {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 26px;
}

.form-field { margin-bottom: 18px; }

.form-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-field .field-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 6px 0 0;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"] {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.form-field input:focus {
  outline: 2px solid var(--accent-soft);
  outline-offset: 1px;
  border-color: var(--accent);
}

.form-error {
  display: none;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bad-soft);
  border: 1px solid #ecd6cd;
  color: var(--bad);
  font-size: 14px;
}

.form-error.is-visible { display: block; }

.form-actions { margin-top: 24px; }
.form-actions .btn { width: 100%; }

.form-alt {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.form-alt a { color: var(--accent); }

/* ---------- Inline new-room form on the dashboard ---------- */

.inline-form {
  padding: 24px 26px;
  margin-bottom: 24px;
}

.inline-form h2 {
  font-size: 17px;
  font-weight: 650;
  margin: 0 0 16px;
}

.inline-form .inline-form-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.inline-form .inline-form-row .form-field { flex: 1; min-width: 200px; margin-bottom: 0; }

.inline-form .inline-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

/* ---------- Empty & loading states ---------- */

.empty-state {
  text-align: center;
  padding: 64px 32px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.empty-state h2 {
  font-size: 18px;
  font-weight: 650;
  margin: 0 0 8px;
}

.empty-state p {
  color: var(--text-muted);
  margin: 0 0 22px;
}

.loading-state {
  padding: 64px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
}

.view-missing {
  padding: 48px 32px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.view-missing h2 { margin: 0 0 8px; font-size: 18px; }
.view-missing p { color: var(--text-muted); margin: 0; }

/* ---------- Plans ---------- */

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.plan-card {
  padding: 26px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-card .plan-name { font-size: 17px; font-weight: 650; margin: 0; }

.plan-card .plan-price {
  font-size: 26px;
  font-weight: 700;
  margin: 0;
}

.plan-card .plan-price .plan-interval {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.plan-card .plan-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
  flex: 1;
}

.plan-card ul.plan-features {
  list-style: none;
  margin: 4px 0 8px;
  padding: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.plan-card ul.plan-features li { padding: 3px 0 3px 20px; position: relative; }
.plan-card ul.plan-features li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--ok);
}

/* ---------- Confirmation (mock checkout) ---------- */

.confirm-panel {
  max-width: 520px;
  margin: 40px auto 0;
  padding: 44px 42px;
  text-align: center;
}

.confirm-panel .confirm-mark {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--ok-soft);
  border: 1px solid #d8e2d4;
  color: var(--ok);
  font-size: 26px;
  line-height: 50px;
}

.confirm-panel h1 { font-size: 22px; margin: 0 0 10px; }
.confirm-panel p { color: var(--text-muted); margin: 0 0 26px; }

/* ---------- Utility ---------- */

.muted { color: var(--text-muted); }
.mt-24 { margin-top: 24px; }

@media (max-width: 640px) {
  .topbar { padding: 0 16px; }
  .app-main { padding: 28px 16px 56px; }
  .form-card { padding: 28px 22px; }
  .topbar .tenant-name { display: none; }
}
