/*
 * The app's look: "a warm room" (design D1 in brown, chosen 2026-11-26). Every app page loads this file after its
 * own stylesheet (portal.css, app.css or connect.css), so the pages keep their layout and take this look:
 * sign-in and invitations, the owners' portal, the WhatsApp helper, the sandbox and its list, the console.
 *
 * A soft, blurred warm backdrop; frosted panels and cards with very round corners; pill buttons and fields;
 * charcoal does the work (main buttons, chosen tabs, small dark devices like the test call); ONE accent, a
 * deep brown, marks what is working and answered; coral stays for what needs you. Heebo for everything.
 * Blur (backdrop-filter) only on small floating pieces: menus, top bars, dialogs.
 */

:root {
  --accent: #6b3f1f;
  --accent-deep: color-mix(in srgb, var(--accent) 80%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 15%, transparent);

  /* the room behind the glass */
  --room: #b8ab9b;
  --glass: rgb(255 255 255 / 0.5);
  --glass-strong: rgb(255 255 255 / 0.66);
  --glass-edge: rgb(255 255 255 / 0.74);
  --panel: rgb(255 255 255 / 0.36);
  --lift: inset 0 1px 0 rgb(255 255 255 / 0.85), 0 22px 40px -28px rgb(50 38 26 / 0.5);

  --bg: rgb(255 255 255 / 0.5);
  --bg-2: rgb(30 27 24 / 0.07);
  --bg-3: rgb(30 27 24 / 0.14);
  --surface: var(--glass);

  /* charcoal takes the place of the night green */
  --night: #1e1b18;
  --night-2: #2e2823;
  --night-3: #3f362e;
  --on-night: #fbf8f4;
  --on-night-2: rgb(251 248 244 / 0.78);
  --on-night-3: rgb(251 248 244 / 0.6);
  --night-line: rgb(255 255 255 / 0.14);

  --ink: #1e1b18;
  --ink-2: #3f362e;
  --ink-3: #54493f;
  --ink-4: #7a6d60;
  --line: rgb(30 27 24 / 0.11);
  --line-strong: rgb(30 27 24 / 0.2);

  /* "answered / working" is the accent now; on dark pieces it is a light warm tone */
  --answer: #f3e7d8;
  --answer-ink: var(--accent);
  --answer-soft: var(--accent-soft);

  /* the sandbox's own names (app.css) for the same things */
  --paper: var(--glass);
  --paper-2: rgb(30 27 24 / 0.06);
  --paper-3: rgb(30 27 24 / 0.12);
  --signal: var(--accent);
  --signal-soft: var(--accent-soft);
  --ok: var(--accent);
  --ok-soft: var(--accent-soft);
  --r: 18px;

  /* "needs you": coral, on every page (the sandbox pages don't load portal.css) */
  --missed: oklch(56% 0.2 30);
  --missed-ink: oklch(51% 0.19 30);
  --missed-soft: oklch(66% 0.18 30 / 0.13);

  --display: 'Heebo', system-ui, 'Segoe UI', Arial, sans-serif;
  --body: 'Heebo', system-ui, 'Segoe UI', Arial, sans-serif;
  --mono: 'Heebo', system-ui, 'Segoe UI', Arial, sans-serif;

  /* Heebo is wider than the condensed display face it replaces: the big steps come down */
  --step-2: clamp(1.6rem, 1.3rem + 1.1vw, 2.2rem);
  --step-3: clamp(2.3rem, 1.6rem + 2.4vw, 3.6rem);
  --step-4: clamp(3rem, 2rem + 4vw, 5rem);

  --r-control: 14px;
  --r-box: 26px;
  --r-band: 30px;
  --r-card: 30px;
  --shadow-float: 0 1px 2px rgb(50 38 26 / 0.12), 0 24px 48px -18px rgb(50 38 26 / 0.45);
}

html {
  background: var(--room);
  color: var(--ink);
}

/* The room: soft light from one side, shade on the other. Fixed, so it stays put while the page scrolls. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42% 48% at 64% 4%, #f4ecde 0%, rgb(244 236 222 / 0) 100%),
    radial-gradient(30% 60% at 0% 48%, #776758 0%, rgb(119 103 88 / 0) 100%),
    radial-gradient(48% 40% at 84% 104%, #8c7d6e 0%, rgb(140 125 110 / 0) 100%),
    radial-gradient(24% 32% at 42% 62%, #dcd0bf 0%, rgb(220 208 191 / 0) 100%),
    var(--room);
}

body {
  background: transparent;
}

::selection {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
}

h1 {
  letter-spacing: -0.03em;
  line-height: 1.02;
}

h2 {
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.num {
  font-size: 1em;
}

:focus-visible {
  outline-color: var(--accent);
}

/* ---------- buttons, fields, tags ---------- */
.btn {
  min-block-size: 3rem;
  padding: 0.4rem 1.35rem;
  border: 1px solid rgb(30 27 24 / 0.1);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: var(--ink);
}

.btn:hover:not(:disabled) {
  border-color: rgb(30 27 24 / 0.18);
  background: #fff;
}

.btn--sm {
  min-block-size: 2.5rem;
  padding: 0.25rem 1rem;
}

.btn--primary {
  border-color: var(--night);
  background: var(--night);
  color: var(--on-night);
  box-shadow: 0 14px 22px -14px rgb(30 27 24 / 0.8);
}

.btn--primary:hover:not(:disabled) {
  border-color: var(--night-3);
  background: var(--night-3);
}

.btn--signal {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 14px 22px -14px var(--accent-deep);
}

.btn--signal:hover:not(:disabled) {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
}

/* call a person back: coral, the one loud button */
.btn--call {
  border-color: var(--missed);
  background: var(--missed);
  color: #fff;
}

.btn--danger {
  border-color: color-mix(in srgb, var(--missed-ink) 35%, transparent);
  color: var(--missed-ink);
}

.btn--danger:hover:not(:disabled) {
  border-color: var(--missed-ink);
  background: var(--missed-soft);
}

.btn--call:hover:not(:disabled) {
  filter: brightness(0.92);
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='search'],
input[type='date'],
input[type='time'],
input[type='tel'],
input[type='number'],
input[type='url'],
select {
  min-block-size: 3rem;
  padding-inline: 1.1rem;
  border-color: rgb(30 27 24 / 0.14);
  border-radius: 999px;
  background-color: rgb(255 255 255 / 0.72);
  color: var(--ink);
}

textarea {
  border-color: rgb(30 27 24 / 0.14);
  border-radius: 18px;
  background-color: rgb(255 255 255 / 0.72);
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}

.pill {
  gap: 0.4rem;
  padding: 0.2rem 0.7rem;
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 0.8rem;
  font-weight: 700;
}

.pill--ok {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

/* waiting on a step: a quiet neutral tag, not a second colour */
.pill--warn {
  background: rgb(30 27 24 / 0.1);
  color: var(--ink-2);
}

.pill--signal {
  background: var(--missed-soft);
  color: var(--missed-ink);
}

/* the sandbox's message tags */
.pill--sent {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.pill--failed {
  background: var(--missed-soft);
  color: var(--missed-ink);
}

.pill--pending {
  background: rgb(30 27 24 / 0.1);
  color: var(--ink-2);
}

.note,
.copy {
  border-radius: 18px;
}

.copy {
  border: 1px solid var(--glass-edge);
  background: rgb(255 255 255 / 0.6);
}

.toast {
  border-radius: 999px;
}

.banner {
  background: rgb(255 255 255 / 0.55);
  border-bottom-color: rgb(255 255 255 / 0.7);
  text-align: center;
}

/* cards: lighter frosted tiles on the room or on a panel */
.card,
.panel,
.empty,
.metric,
.fold,
.sheet {
  border-color: var(--glass-edge);
  box-shadow: var(--lift);
}

.empty {
  border-style: solid;
}

/* ---------- the owners' portal ---------- */

/* the menu: a frosted panel that floats beside the page */
.rail {
  inset-block-start: 1rem;
  block-size: calc(100dvh - 2rem);
  margin: 1rem;
  margin-inline-end: 0;
  border: 1px solid rgb(255 255 255 / 0.75);
  border-radius: 30px;
  background: rgb(255 255 255 / 0.5);
  -webkit-backdrop-filter: blur(30px);
  backdrop-filter: blur(30px);
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.9),
    0 20px 34px -22px rgb(50 38 26 / 0.6);
}

.brand {
  color: var(--accent);
}

.brand span {
  color: var(--ink-2);
}

.rail__brand b {
  font-size: 1.7rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.rail__brand select {
  border-color: rgb(30 27 24 / 0.14);
  background-color: rgb(255 255 255 / 0.7);
  color: var(--ink);
}

.nav a {
  border-radius: 999px;
  color: var(--ink-2);
}

.nav a .icon {
  color: var(--ink-3);
}

.nav a:hover {
  background: rgb(255 255 255 / 0.65);
  color: var(--ink);
}

.nav a[aria-current='page'] {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 18px -12px rgb(50 38 26 / 0.7);
}

.nav a[aria-current='page'] .icon {
  color: var(--accent);
}

.nav a[aria-current='page']::before {
  display: none;
}

.rail__foot {
  border-top-color: var(--line);
  color: var(--ink-3);
}

.rail__foot .linkbtn {
  color: var(--ink-2);
}

/* the page: one frosted panel beside the menu */
.shell > div > .main {
  margin: 1rem;
  border: 1px solid rgb(255 255 255 / 0.7);
  border-radius: 40px;
  background: var(--panel);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.85),
    0 40px 70px -40px rgb(50 38 26 / 0.55);
  min-block-size: calc(100dvh - 2rem);
}

/* the line on the home screen: the one brown band of the page */
.hero {
  background: linear-gradient(170deg, color-mix(in srgb, var(--accent) 84%, #fff) 0%, var(--accent) 50%, var(--accent-deep) 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.3),
    0 26px 44px -26px var(--accent-deep);
}

.hero .seg,
.hero .btn:not(.btn--primary) {
  border-color: rgb(255 255 255 / 0.22);
  background: rgb(255 255 255 / 0.12);
  color: var(--on-night);
}

.hero .btn--primary {
  border-color: #fff;
  background: #fff;
  color: var(--accent-deep);
  box-shadow: none;
}

.hero__num:hover {
  background: rgb(255 255 255 / 0.1);
}

/* light buttons on dark pieces (the line card, "fill from a link", the test call): hover stays warm */
.hero .btn--primary:hover:not(:disabled),
.import .btn--primary:hover:not(:disabled),
.callbox .btn--signal:hover:not(:disabled) {
  border-color: #fff;
  background: #fff;
}

.import input:focus,
.import textarea:focus {
  box-shadow: 0 0 0 3px rgb(243 231 216 / 0.3);
}

/* the call-backs box and new cards: the red number says it; no thick coloured edge on round corners */
.callbacks,
.card--new {
  border-inline-start-width: 1px;
  border-inline-start-color: var(--glass-edge);
}

.callbacks {
  background: var(--glass);
  box-shadow: var(--lift);
}

/* the calendar: today and the appointments the receptionist booked take the accent */
.calcol--today .calcol__open {
  background: color-mix(in srgb, var(--accent) 6%, rgb(255 255 255 / 0.6));
}

.appt2--ai {
  background: color-mix(in srgb, var(--accent) 14%, #fff);
  color: var(--accent-deep);
}

.callegend__item--ai::before {
  background: color-mix(in srgb, var(--accent) 14%, #fff);
}

/* the WhatsApp helper's checklist and film */
.cx-check:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
}

.fm-chap__fill {
  background: rgb(243 231 216 / 0.22);
}

.fm-chap[aria-current='step'] {
  box-shadow: inset 0 0 0 1px rgb(243 231 216 / 0.45);
}

/* the guided tour's dim layer: warm, not green (tour.css loads after this file, hence :root:root) */
:root:root {
  --tour-dim: rgb(30 22 14 / 0.72);
}

/* ---------- the sandbox (/demo) and its list (/inbox) ---------- */
.sandbox .bar {
  margin: 0.75rem clamp(0.75rem, 2vw, 1.75rem) 0;
  padding: 0.55rem 0.6rem 0.55rem 1.4rem;
  padding-inline: 1.4rem 0.6rem;
  border: 1px solid rgb(255 255 255 / 0.7);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.46);
  -webkit-backdrop-filter: blur(30px);
  backdrop-filter: blur(30px);
  box-shadow: 0 18px 36px -24px rgb(50 38 26 / 0.45);
}

.sandbox .mode {
  border-color: rgb(255 255 255 / 0.8);
  background: rgb(255 255 255 / 0.6);
  min-block-size: 2.5rem;
}

/* the phone call stage: a charcoal device with round corners, the call button light on it */
.sandbox .stage {
  margin: clamp(0.75rem, 2vw, 1.5rem);
  border-radius: 36px;
  background: var(--night);
  color: var(--on-night);
  box-shadow: 0 40px 70px -40px rgb(30 22 14 / 0.75);
}

.sandbox .call-btn {
  background: var(--on-night);
  color: var(--night);
}

.sandbox .call-btn[data-state='live'] {
  background: var(--accent);
  color: #fff;
}

.sandbox .dial__ring {
  background: conic-gradient(var(--answer) calc(var(--progress) * 1turn), rgb(255 255 255 / 0.1) 0);
}

.sandbox .dial__pulse {
  background: var(--answer);
}

.sandbox .ticket,
.sandbox .lead {
  border: 1px solid var(--glass-edge);
  border-radius: 22px;
  background: var(--glass);
  box-shadow: var(--lift);
}

.sandbox .btn--signal:hover:not(:disabled) {
  background: var(--accent-deep);
}

.sandbox .empty {
  padding: 2rem;
  border: 1px solid var(--glass-edge);
  border-radius: 26px;
  background: var(--glass);
}

/* ---------- the WhatsApp helper ---------- */
.cxpage {
  background: transparent;
}

.cxbar {
  margin: 0.75rem clamp(0.75rem, 2vw, 1.75rem) 0;
  padding: 0.6rem 0.6rem 0.6rem 1.25rem;
  padding-inline: 1.25rem 0.6rem;
  border: 1px solid rgb(255 255 255 / 0.7);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.5);
  -webkit-backdrop-filter: blur(30px);
  backdrop-filter: blur(30px);
  color: var(--ink);
  box-shadow: 0 18px 36px -24px rgb(50 38 26 / 0.45);
}

.cxbar b {
  color: var(--ink-2);
}

.cxbar__back {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;
  padding-inline: 1.1rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.7);
  color: var(--ink);
  text-decoration: none;
}

.cx__head h1 em {
  color: var(--ink-3);
}

/* ---------- phones: a frosted top bar and a floating tab bar ---------- */
@media (max-width: 860px) {
  .topbar {
    margin: 0.6rem 0.75rem 0;
    border: 1px solid rgb(255 255 255 / 0.7);
    border-radius: 999px;
    background: rgb(255 255 255 / 0.55);
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
    color: var(--ink);
    box-shadow: 0 14px 30px -22px rgb(50 38 26 / 0.6);
    inset-block-start: 0.6rem;
  }

  .topbar .linkbtn {
    color: var(--ink-2);
  }

  .topbar b {
    font-size: 1.25rem;
    font-weight: 700;
  }

  .shell > div > .main {
    margin: 0.75rem;
    border-radius: 28px;
    min-block-size: 0;
  }

  .tabs {
    inset-inline: 0.6rem;
    inset-block-end: calc(0.5rem + env(safe-area-inset-bottom));
    block-size: var(--tabs);
    padding: 0.3rem;
    border: 1px solid rgb(255 255 255 / 0.75);
    border-radius: 28px;
    background: rgb(255 255 255 / 0.62);
    -webkit-backdrop-filter: blur(30px) saturate(1.1);
    backdrop-filter: blur(30px) saturate(1.1);
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / 0.9),
      0 18px 36px -18px rgb(50 38 26 / 0.65);
  }

  .tabs a {
    border-radius: 22px;
    color: var(--ink-3);
  }

  .tabs a[aria-current='page'] {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 8px 16px -10px rgb(50 38 26 / 0.7);
  }

  .tabs a[aria-current='page'] .icon {
    color: var(--accent);
  }

  .tabs a[aria-current='page']::before {
    display: none;
  }
}
