/*
 * The application's own stylesheet.
 *
 * It carries the same tokens, fonts and shapes as the marketing site's
 * `receptionist-site.css`, but it is a separate file on purpose: the two are
 * deployed from different places, and a signup form that loses its styling
 * because the marketing site moved a file is a worse failure than a little
 * duplication. The tokens below are the contract between them -- change a
 * colour there, change it here.
 *
 * Covers every page a customer or an owner sees, and the admin console too.
 */

:root {
  --ink: #17243b;
  --muted: #5e6a79;
  --paper: #fffdf8;
  --white: #ffffff;
  --powder: #eaf2f8;
  --powder-2: #f4f7fa;
  --blue: #235f7b;
  --blue-dark: #17485f;
  --amber: #e7a93d;
  --amber-soft: #fbefd8;
  --line: #d5e0e8;
  --danger: #9d1c1c;
  --danger-soft: #fdecec;
  --success: #176b34;
  --success-soft: #e8f5ed;
  --shadow: 0 24px 70px rgba(23, 36, 59, .12);
  --shadow-soft: 0 12px 34px rgba(23, 36, 59, .07);
  --radius: 24px;
  --radius-sm: 14px;
  --shell: min(1180px, calc(100% - 40px));
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
button, input, select, textarea { font: inherit; }

.shell { width: var(--shell); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---- Header and footer ---------------------------------------------- */

.app-header {
  background: rgba(255, 253, 248, .94);
  border-bottom: 1px solid rgba(35, 95, 123, .12);
  backdrop-filter: blur(14px);
}
.app-header .shell {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.12rem;
  letter-spacing: -.02em;
}
.brand img { width: 31px; height: 44px; object-fit: contain; }
.brand strong { color: var(--blue); }
.header-links { display: flex; align-items: center; gap: 22px; }
.header-links a { color: #354154; text-decoration: none; font-size: .92rem; font-weight: 600; }
.header-links a:hover { color: var(--blue); }
.header-links .nav-cta {
  color: var(--white);
  background: var(--blue);
  padding: 10px 18px;
  border-radius: 999px;
}
.header-links .nav-cta:hover { background: var(--blue-dark); color: var(--white); }

.app-footer {
  margin-top: 64px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
}
.app-footer .shell { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.app-footer a { color: var(--muted); text-decoration: none; }
.app-footer a:hover { color: var(--blue); }

/* ---- Page frame ------------------------------------------------------ */

.app-main { padding: 48px 0 8px; }
.app-main.narrow .shell { width: min(640px, calc(100% - 40px)); }
.app-main.wide .shell { width: var(--shell); }

.page-head { margin-bottom: 28px; }
.eyebrow {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow span {
  display: inline-block;
  width: 28px;
  height: 2px;
  margin: 0 9px 3px 0;
  background: var(--amber);
}
h1 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.08;
  font-size: clamp(2.3rem, 5vw, 3.1rem);
}
h2 {
  margin: 0 0 14px;
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  letter-spacing: -.03em;
  font-size: 1.6rem;
}
h3 { margin: 0 0 10px; font-size: 1.02rem; font-weight: 700; }
.lede { margin: 14px 0 0; color: var(--muted); font-size: 1.02rem; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }

/* ---- Panels ---------------------------------------------------------- */

.card {
  padding: 30px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.card + .card { margin-top: 20px; }
.card-tight { padding: 22px; border-radius: var(--radius-sm); }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.stat { padding: 20px 22px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.stat strong { display: block; font-family: "Newsreader", Georgia, serif; font-size: 1.9rem; line-height: 1.1; }
.stat span { display: block; color: var(--muted); font-size: .82rem; }

/* ---- Messages -------------------------------------------------------- */

.notice, .error, .warning {
  margin: 0 0 20px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: .94rem;
}
.notice { color: var(--success); background: var(--success-soft); border: 1px solid #bfe0cc; }
.error { color: var(--danger); background: var(--danger-soft); border: 1px solid #f0c9c9; }
.warning { color: #7a5312; background: var(--amber-soft); border: 1px solid #f0dcb2; }
.field-error { margin: .35rem 0 0; color: var(--danger); font-size: .86rem; font-weight: 600; }

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

form .field { margin-top: 22px; }
label { display: block; font-weight: 600; font-size: .94rem; }
label .hint { display: block; margin-top: 2px; color: var(--muted); font-weight: 400; font-size: .86rem; }

input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="search"], input[type="number"], input[type="url"], input[type="date"],
input[type="time"], select, textarea {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(35, 95, 123, .16);
}
input[aria-invalid="true"], .has-error input, .has-error select { border-color: var(--danger); }
textarea { min-height: 120px; resize: vertical; }

/* The one-time code is read off a phone and typed in one go, so it is set
   wide and centred rather than left-aligned like an ordinary field. */
input[name="code"] { max-width: 13rem; font-size: 1.35rem; letter-spacing: .35rem; text-align: center; }

.plans { display: grid; gap: 12px; margin-top: 12px; }
.plan {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-weight: 400;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.plan:hover { border-color: var(--blue); }
.plan input { width: auto; margin: 6px 0 0; accent-color: var(--blue); }
.plan:has(input:checked) { border-color: var(--blue); background: var(--powder-2); box-shadow: 0 0 0 1px var(--blue); }
.plan-name { display: block; font-weight: 700; font-size: 1.02rem; }
.plan em { display: block; margin-top: 4px; color: var(--muted); font-style: normal; font-size: .92rem; line-height: 1.5; }

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

.button, button[type="submit"], form > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  padding: 14px 26px;
  color: var(--white);
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 999px;
  font-size: .98rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.button:hover, button[type="submit"]:hover, form > button:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: var(--white);
}
.button-ghost {
  color: var(--ink);
  background: var(--white);
  border-color: var(--line);
}
.button-ghost:hover { color: var(--ink); background: var(--powder-2); border-color: var(--blue); }
.button-small { margin-top: 0; padding: 9px 18px; font-size: .88rem; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.button-full { width: 100%; }

/* ---- Tables ---------------------------------------------------------- */

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
caption { margin-bottom: 10px; text-align: left; color: var(--muted); font-size: .86rem; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--powder-2); }
.table-wrap { overflow-x: auto; }

.pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.pill-live { color: var(--success); background: var(--success-soft); }
.pill-pending { color: #7a5312; background: var(--amber-soft); }
.pill-stopped { color: var(--danger); background: var(--danger-soft); }
.pill-quiet { color: var(--muted); background: var(--powder); }

/* ---- Odds and ends --------------------------------------------------- */

dl.detail { display: grid; grid-template-columns: minmax(130px, auto) 1fr; gap: 10px 20px; margin: 0; }
dl.detail dt { color: var(--muted); font-size: .86rem; }
dl.detail dd { margin: 0; }

hr { margin: 28px 0; border: 0; border-top: 1px solid var(--line); }

ul.ticks { margin: 0; padding: 0; list-style: none; }
ul.ticks li { position: relative; padding-left: 26px; margin-bottom: 8px; }
ul.ticks li::before { position: absolute; left: 0; color: var(--blue); content: "\2713"; font-weight: 700; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .app-main { padding: 32px 0 8px; }
  .card { padding: 22px; border-radius: var(--radius-sm); }
  .app-header .shell { min-height: 66px; gap: 12px; }
  .header-links { gap: 14px; }
  .header-links a:not(.nav-cta) { display: none; }
  .button, button[type="submit"], form > button { width: 100%; }
  .button-small { width: auto; }
  dl.detail { grid-template-columns: 1fr; gap: 2px 0; }
  dl.detail dd { margin-bottom: 12px; }
}

/* ---- Owner dashboard and admin console ------------------------------- */
/*
 * These class names were already in the pages. They are restyled here rather
 * than renamed, so that converting a page to this stylesheet touches only its
 * head and foot -- a 400-line dashboard is not worth re-marking-up to gain a
 * different word for "tile".
 */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 24px 0;
}
.tile {
  padding: 18px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.tile b {
  display: block;
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: 1.85rem;
  line-height: 1.15;
}
.tile { color: var(--muted); font-size: .84rem; }
.tile b { color: var(--ink); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 10px; }
.filters a {
  margin: 0;
  padding: 7px 15px;
  color: #354154;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  font-size: .86rem;
  font-weight: 600;
}
.filters a:hover { border-color: var(--blue); color: var(--blue); }
.filters a.on {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
  text-decoration: none;
}

.score { font-weight: 700; }
.urgent { color: var(--danger); font-weight: 700; }

.entry {
  margin: 14px 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--line);
}
.entry.inbound { border-left-color: var(--success); }
.entry.call { border-left-color: var(--blue); }
.entry .when { color: var(--muted); font-size: .82rem; }

.login { max-width: 420px; }

/* A form button that has to read as a link -- "Sign out" sits in a sentence,
   and a pill there would look like the page's main action. */
.linkish {
  width: auto;
  margin: 0;
  padding: 0;
  color: var(--blue);
  background: none;
  border: 0;
  border-radius: 0;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.linkish:hover { color: var(--blue-dark); background: none; border: 0; }

/* Tables stack on a phone: a lead row has more columns than a phone has
   width, and a horizontal scrollbar hides the column that matters. */
@media (max-width: 650px) {
  table, thead, tbody, th, td, tr { display: block; }
  thead, th { display: none; }
  td { padding: 2px 0; border: 0; }
  tbody tr {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }
  tbody tr:hover { background: transparent; }
}

/* ---- What used to be inline style attributes ------------------------- */
/*
 * Four declarations lived in `style="..."` attributes, which forced
 * `style-src 'unsafe-inline'` into the Content-Security-Policy of every page.
 * They are here instead so the policy can name `'self'` and nothing else:
 * an injected `style` attribute is now refused by the browser.
 */

.inline-form { display: inline; }

pre.trace {
  margin: 0;
  padding: 16px 18px;
  background: var(--powder-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .82rem;
  white-space: pre-wrap;
  word-break: break-word;
}

label.check { display: inline-block; margin-right: 18px; font-weight: 400; }
label.check input[type="checkbox"] { width: auto; margin-right: 4px; accent-color: var(--blue); }
