/* =============================================================================
   deals.contact — components & layout
   -----------------------------------------------------------------------------
   A direct translation of site-layout-docs/components/*.jsx into plain CSS.
   The design kits render those components with React + Babel compiled in the
   browser, which is fine for a prototype but costs hundreds of milliseconds per
   page load. This app is server-rendered, so the same visual language is
   expressed as classes and ships with no JavaScript runtime at all.

   Values here mirror the JSX exactly — padding, radii, tones, transitions.
   If a component changes in the design system, change it here to match.
   ============================================================================= */

/* ---------------------------------------------------------------- reset ---- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  margin: 0;
  text-wrap: pretty;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--coral-100); color: var(--coral-700); }

:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* The one signature motion in the system. */
@keyframes dc-pulse { 50% { opacity: .35; } }
@keyframes dc-rise  { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* -------------------------------------------------------------- brand ----- */

.wordmark {
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  letter-spacing: -0.02em;
  color: var(--ink-1);
  white-space: nowrap;
}
.wordmark .dot { color: var(--coral-500); }
.wordmark--invert { color: var(--text-on-brand); }

/* Mono marginalia / small-caps labels — the editorial texture of the brand. */
.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-faint);
}
.mono--plain { text-transform: none; letter-spacing: 0.02em; }

/* Oversized outlined numerals used to number sections. */
.ghost-numeral {
  font-family: var(--font-display);
  font-weight: var(--weight-heavy);
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1.3px oklch(70% 0.02 70);
  line-height: 1;
}

.rule-dotted { border: 0; border-top: var(--border-dotted); margin: 0; }

/* -------------------------------------------------------------- button ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: var(--weight-bold);
  line-height: 1.2;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  padding: 9px 20px;
  font-size: var(--text-base);
  transition: background var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: default; }

.btn--primary   { background: var(--brand); color: var(--text-on-brand); }
.btn--primary:hover:not(:disabled)   { background: var(--brand-hover); }

.btn--secondary { background: var(--surface-card); color: var(--text-body); border-color: var(--border-default); }
.btn--secondary:hover:not(:disabled) { background: var(--surface-inset); }

.btn--ghost     { background: transparent; color: var(--text-link); }
.btn--ghost:hover:not(:disabled)     { background: var(--brand-soft); }

.btn--danger    { background: var(--danger); color: #fff; }
.btn--danger:hover:not(:disabled)    { background: oklch(48% 0.19 25); }

.btn--s { padding: 6px 14px;  font-size: var(--text-sm); }
.btn--l { padding: 13px 28px; font-size: var(--text-md); }
.btn--block { width: 100%; }

.btn svg { width: 1em; height: 1em; flex: none; }

/* Square icon-only button. */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-m);
  border: 1px solid var(--border-default);
  background: var(--surface-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--surface-inset); color: var(--text-body); }

/* ---------------------------------------------------------------- card ---- */

.card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-l);
  padding: var(--space-5);
  box-shadow: var(--shadow-s);
  transition: box-shadow var(--dur-med) var(--ease-out);
}
.card--flush { padding: 0; }
.card--hover:hover { box-shadow: var(--shadow-m); }

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: 14px;
}
.card__title {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-display);
  margin: 0;
}

/* --------------------------------------------------------------- badge ---- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-heavy);
  letter-spacing: 0.02em;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--surface-inset);
  color: var(--text-muted);
}
.badge__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

.badge--brand   { background: var(--brand-soft);  color: var(--ink-1); }
.badge--neutral { background: var(--surface-inset); color: var(--text-muted); }
.badge--success { background: var(--success-bg);  color: var(--success); }
.badge--warning { background: var(--warning-bg);  color: var(--warning-text); }
.badge--danger  { background: var(--danger-bg);   color: var(--danger); }
.badge--live    { background: var(--coral-100);   color: var(--coral-700); }
.badge--live .badge__dot { animation: dc-pulse 1.4s ease-in-out infinite; }

/* ----------------------------------------------------------------- tag ---- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-s);
  background: var(--surface-inset);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

/* --------------------------------------------------------------- forms ---- */

.field { display: block; margin-bottom: var(--space-4); }
.field__label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  margin-bottom: 6px;
  color: var(--text-body);
}
.field__hint { display: block; font-size: var(--text-sm); color: var(--text-faint); margin-top: 6px; }
.field__error { display: block; font-size: var(--text-sm); color: var(--danger); margin-top: 6px; }

.input, .select, .textarea {
  width: 100%;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-m);
  padding: 9px 14px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-body);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--coral-500);
  box-shadow: var(--focus-ring);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.textarea { resize: vertical; min-height: 96px; line-height: var(--leading-body); }

.select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6660' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

/* Input with a leading icon. */
.input-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-m);
  padding: 9px 14px;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.input-group:focus-within { border-color: var(--coral-500); box-shadow: var(--focus-ring); }
.input-group > svg { color: var(--text-faint); flex: none; }
.input-group > input {
  border: 0; outline: none; background: transparent; flex: 1; min-width: 0;
  font-family: var(--font-body); font-size: var(--text-base); color: var(--text-body);
}

/* Switch — matches the sidebar "Answering on" control. */
.switch { display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 40px; height: 23px; border-radius: var(--radius-pill);
  background: var(--surface-inset); border: 1px solid var(--border-default);
  position: relative; flex: none;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--surface-card); box-shadow: var(--shadow-s);
  transition: transform var(--dur-fast) var(--ease-out);
}
.switch input:checked + .switch__track { background: var(--success); border-color: var(--success); }
.switch input:checked + .switch__track::after { transform: translateX(17px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--focus-ring); }

.checkbox { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; font-size: var(--text-sm); }
.checkbox input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------------------------------------------------------------- tabs ---- */

.tabs {
  display: flex;
  gap: var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}
.tab {
  appearance: none; background: none; border: 0; cursor: pointer;
  padding: 10px 0 11px;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 7px;
  transition: color var(--dur-fast) var(--ease-out);
}
.tab:hover { color: var(--text-body); }
.tab[aria-selected="true"] { color: var(--ink-1); border-bottom-color: var(--coral-500); }
.tab__count {
  font-family: var(--font-mono); font-size: 11px;
  background: var(--surface-inset); color: var(--text-faint);
  border-radius: var(--radius-pill); padding: 1px 7px;
}

/* --------------------------------------------------------------- table ---- */

.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th {
  text-align: left;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--text-faint); font-weight: var(--weight-regular);
  padding: 10px 16px; border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-inset); }
.table__scroll { overflow-x: auto; }

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- modal ---- */

.modal {
  position: fixed; inset: 0; z-index: 90;
  display: none; align-items: center; justify-content: center;
  padding: var(--space-5);
  background: oklch(24% 0.02 60 / 0.42);
}
.modal.is-open { display: flex; animation: dc-rise var(--dur-med) var(--ease-out); }
.modal__panel {
  background: var(--surface-card);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-l);
  width: 100%; max-width: 560px;
  max-height: 88vh; overflow-y: auto;
  padding: var(--space-6);
}
.modal__title {
  font-family: var(--font-display); font-size: var(--text-lg);
  font-weight: var(--weight-bold); letter-spacing: var(--tracking-display);
  margin: 0 0 4px;
}
.modal__sub { font-size: var(--text-sm); color: var(--text-muted); margin-bottom: var(--space-5); }

/* -------------------------------------------------------------- states ---- */

.empty {
  text-align: center;
  padding: var(--space-8) var(--space-5);
  color: var(--text-muted);
}
.empty__title {
  font-family: var(--font-display); font-size: var(--text-md);
  font-weight: var(--weight-medium); color: var(--text-body); margin-bottom: 6px;
}
.empty__body { font-size: var(--text-sm); max-width: 42ch; margin: 0 auto; }

.notice { padding: 10px 14px; border-radius: var(--radius-m); font-size: var(--text-sm); }
.notice--ok    { background: var(--success-bg); color: var(--success); }
.notice--warn  { background: var(--warning-bg); color: var(--warning-text); }
.notice--error { background: var(--danger-bg);  color: var(--danger); }

/* ------------------------------------------------------------ utilities ---- */

.stack   { display: flex; flex-direction: column; }
.row     { display: flex; align-items: center; }
.gap-1 { gap: var(--space-1); } .gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); } .gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); } .gap-6 { gap: var(--space-6); }
.grow    { flex: 1; min-width: 0; }
.wrap    { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center  { justify-content: center; }
.baseline{ align-items: baseline; }
.muted   { color: var(--text-muted); }
.faint   { color: var(--text-faint); }
.truncate{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden  { display: none !important; }
.mt-0{margin-top:0} .mt-2{margin-top:var(--space-2)} .mt-3{margin-top:var(--space-3)}
.mt-4{margin-top:var(--space-4)} .mt-5{margin-top:var(--space-5)} .mt-6{margin-top:var(--space-6)}
.mb-2{margin-bottom:var(--space-2)} .mb-3{margin-bottom:var(--space-3)}
.mb-4{margin-bottom:var(--space-4)} .mb-5{margin-bottom:var(--space-5)} .mb-6{margin-bottom:var(--space-6)}
.text-sm{font-size:var(--text-sm)} .text-xs{font-size:var(--text-xs)}
.grid { display: grid; gap: var(--space-4); }
.grid--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 900px) { .grid--2, .grid--3 { grid-template-columns: 1fr; } }

/* Inner padding wrapper emitted by some JS templates. `.card` already carries
   its own padding, so this only needs to exist for cards rendered flush. */
.card__body { padding: var(--space-5); }
.card:not(.card--flush) > .card__body { padding: 0; }

/* ---------------------------------------------------- setup checklist ---- */
/* Shown on the dashboard until an account can actually answer a call. It is
   the first thing a paying customer sees, so it reads as a short list of
   decisions rather than a progress-bar game: no confetti, no badges, and it
   removes itself the moment it stops being useful. */

.setup {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-l);
  padding: var(--space-5) var(--space-6) var(--space-4);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-m);
}

.setup__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-5); flex-wrap: wrap; margin-bottom: var(--space-4);
}
.setup__title {
  font-family: var(--font-display); font-size: var(--text-xl);
  font-weight: var(--weight-bold); letter-spacing: var(--tracking-display);
  margin: var(--space-1) 0 var(--space-2);
}
.setup__sub { color: var(--text-muted); margin: 0; font-size: var(--text-sm); }

.setup__progress { flex: none; min-width: 116px; text-align: right; }
.setup__count {
  font-family: var(--font-display); font-size: var(--text-lg);
  font-weight: var(--weight-bold); font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.setup__meter {
  height: 4px; border-radius: 999px; background: var(--surface-inset);
  margin-top: var(--space-2); overflow: hidden;
}
.setup__fill {
  height: 100%; background: var(--coral-500); border-radius: 999px;
  transition: width var(--dur-med) var(--ease-out);
}

.setup__list { list-style: none; margin: 0; padding: 0; }

.setup__step {
  display: grid; grid-template-columns: 24px 1fr auto;
  gap: var(--space-2) var(--space-4); align-items: center;
  padding: var(--space-4) 0; border-top: 1px solid var(--border-subtle);
}
.setup__mark {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--border-default);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-on-brand); align-self: start; margin-top: 2px;
}
.setup__step.is-done .setup__mark {
  background: var(--success); border-color: var(--success);
}
.setup__step-title {
  font-family: var(--font-display); font-size: var(--text-md);
  font-weight: var(--weight-medium); letter-spacing: var(--tracking-display);
  color: var(--ink-1);
}
.setup__step.is-done .setup__step-title { color: var(--text-muted); }
.setup__optional {
  font-family: var(--font-mono); font-size: 9.5px; margin-left: var(--space-3);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--text-faint); vertical-align: 1px;
}
.setup__blurb {
  color: var(--text-muted); font-size: var(--text-sm);
  margin: var(--space-1) 0 0; max-width: 58ch; line-height: 1.5;
}
.setup__go { flex: none; white-space: nowrap; }

@media (max-width: 720px) {
  .setup { padding: var(--space-5) var(--space-4); }
  .setup__step { grid-template-columns: 24px 1fr; }
  .setup__go { grid-column: 2; justify-self: start; margin-top: var(--space-2); }
}
