/* See You Soon — the look of an appointment card: white card stock,
   ballpoint-blue ink, and highlighter yellow saved for rewards. */
@import url('https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:wght@400;500;600;700;800&display=swap');

:root {
  --pen: #2a45b8;          /* ballpoint blue: actions, links, active tab */
  --pen-deep: #1e338f;
  --pen-wash: #eef2fd;     /* the "fill in" card */
  --pen-ring: rgba(42, 69, 184, 0.22);
  --ink: #1b2440;          /* text */
  --ink-soft: #5a6378;     /* secondary text */
  --line: #e1e5ee;
  --line-strong: #c8cfdc;
  --paper: #ffffff;
  --highlight: #ffd23f;    /* highlighter: rewards only */
  --highlight-ink: #5c4300;
  --danger: #b8352a;
  --danger-wash: #fbeceb;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Schibsted Grotesk', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 36px 20px 72px; }
.wrap.wide { max-width: 1120px; }

h1, h2 { font-weight: 700; margin: 0 0 4px; letter-spacing: -0.015em; line-height: 1.2; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.2rem; }
p.sub { color: var(--ink-soft); font-size: 0.95rem; margin: 2px 0 18px; max-width: 60ch; }
a { color: var(--pen); }
a:hover { color: var(--pen-deep); }

/* ---- Header ---- */
header.letterhead { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
header.letterhead .stamp {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%;
  background: var(--pen); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 800;
}
header.letterhead .letterhead-text { flex: 1; min-width: 0; }
header.letterhead h1 { margin: 0; font-size: 1.6rem; }
header.letterhead .tagline { color: var(--ink-soft); font-size: 0.9rem; margin: 1px 0 0; }
header.letterhead button { margin-top: 0; }

/* Login, reset and admin pages: the product name is the headline. */
.brand-head { margin: 8px 0 6px; }
.brand-head h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; margin: 0; }
.brand-head .tagline { font-size: 1.05rem; color: var(--ink-soft); margin: 2px 0 0; }

/* ---- Tabs ---- */
nav.tabs { display: flex; gap: 26px; margin-bottom: 24px; border-bottom: 1px solid var(--line); overflow-x: auto; }
nav.tabs .tab-btn {
  background: none; border: none; margin: 0 0 -1px; padding: 10px 0 12px; border-radius: 0;
  font: inherit; font-size: 0.98rem; font-weight: 600; color: var(--ink-soft);
  border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap;
}
nav.tabs .tab-btn:hover { color: var(--ink); background: none; }
nav.tabs .tab-btn.active { color: var(--pen); border-bottom-color: var(--pen); }

/* ---- Sections ---- */
section.panel { padding: 22px 0; border-top: 1px solid var(--line); }
.tab-page > section.panel:first-child, .designer-controls > section.panel:first-child { border-top: none; padding-top: 4px; }
section.panel h2 { margin-bottom: 2px; }
/* The one filled-in card on each screen: where the main action happens. */
section.panel.panel-primary {
  background: var(--pen-wash); border: none; border-radius: 16px;
  padding: 24px 26px 26px; margin-bottom: 10px;
}
section.panel.panel-primary + section.panel { border-top: none; }

/* ---- Forms ---- */
label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--ink); margin: 14px 0 6px; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: #fff; color: var(--ink); font: inherit; font-size: 1rem;
}
input::placeholder, textarea::placeholder { color: #8a92a5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pen); box-shadow: 0 0 0 3px var(--pen-ring); }
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
input[type=checkbox] { width: auto; accent-color: var(--pen); }
.hint { font-size: 0.85rem; color: var(--ink-soft); margin: 6px 0 0; max-width: 62ch; }
.optional { font-weight: 400; color: var(--ink-soft); margin-left: 4px; font-size: 0.85rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* ---- Buttons ---- */
button {
  background: var(--pen); color: #fff; border: 1px solid var(--pen); padding: 11px 20px;
  border-radius: 10px; font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer;
  margin-top: 14px; transition: background-color .12s ease, border-color .12s ease;
}
button:hover { background: var(--pen-deep); border-color: var(--pen-deep); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--pen-ring); outline-offset: 2px; }
button:disabled { opacity: .45; cursor: default; }
button.secondary { background: #fff; color: var(--ink); border-color: var(--line-strong); }
button.secondary:hover { background: var(--pen-wash); border-color: var(--pen); color: var(--pen-deep); }
button.danger { background: var(--danger); border-color: var(--danger); }
button.danger:hover { background: #962a21; }
button.link-btn {
  background: none; border: none; padding: 2px 0; margin: 0; border-radius: 4px;
  color: var(--ink-soft); font-size: 0.88rem; font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong);
}
button.link-btn:hover { background: none; color: var(--pen); text-decoration-color: currentColor; }
button.link-btn.danger-link:hover { color: var(--danger); }

/* ---- Tables (send history) ---- */
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th { text-align: left; font-weight: 600; color: var(--ink-soft); font-size: 0.85rem; padding: 0 10px 10px 0; border-bottom: 1px solid var(--line); }
td { padding: 12px 10px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-soft); }

.error { color: var(--danger); font-size: 0.9rem; margin-top: 10px; }
.error:empty { display: none; }
.notice { color: var(--ink-soft); font-size: 0.92rem; padding: 8px 0; }
#run-result .notice { background: #fff; border-radius: 10px; padding: 10px 14px; margin-top: 10px; }

/* ---- Customer list ---- */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
section.panel .list-head h2 { margin: 0; }
.list-head input[type=search] { width: 280px; max-width: 100%; }
.count-pill {
  display: inline-block; min-width: 28px; padding: 1px 9px; margin-left: 6px; border-radius: 99px;
  background: var(--pen-wash); color: var(--pen); font-size: 0.85rem; font-weight: 700;
  text-align: center; vertical-align: 3px; font-variant-numeric: tabular-nums;
}

.customer-list { border-top: 1px solid var(--line); margin-top: 8px; }
.cust-row { display: grid; grid-template-columns: 1fr 170px 170px; gap: 18px; align-items: center; padding: 18px 2px; border-bottom: 1px solid var(--line); }
.cust-name { font-weight: 700; font-size: 1.05rem; }
.cust-contact, .cust-dates { display: flex; flex-wrap: wrap; gap: 2px 16px; color: var(--ink-soft); font-size: 0.9rem; margin-top: 3px; word-break: break-word; }
.cust-contact .warn { color: var(--danger); }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--danger-wash); color: var(--danger); vertical-align: 2px; margin-left: 6px; }

.visits-num { font-size: 1.5rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.visits-label { color: var(--ink-soft); font-size: 0.88rem; }
.reward-hint { font-size: 0.82rem; color: var(--ink-soft); margin-top: 5px; }
.reward-hint.ready { color: var(--highlight-ink); font-weight: 700; }
.reward-hint.ready span { background: var(--highlight); padding: 1px 6px; border-radius: 4px; line-height: 1.7; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* The punch card: one hole per visit, the last one is the reward. */
.punch { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.punch i { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: #fff; }
.punch i.on { background: var(--pen); border-color: var(--pen); }
.punch i.reward { border: 2px solid #e0b10f; background: #fff6cc; }
.punch i.reward.next { background: var(--highlight); border-color: #d9a400; }

.cust-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cust-actions .visit-btn { margin: 0; padding: 10px 18px; min-width: 120px; }
.cust-links { display: flex; gap: 14px; }
.empty-list { color: var(--ink-soft); padding: 20px 2px; margin: 0; }

/* ---- Automation rules ---- */
.rule { padding: 20px 0; border-top: 1px solid var(--line); }
.rule-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.rule-name { font-weight: 700; font-size: 1.05rem; }
.rule-timing { color: var(--ink-soft); font-size: 0.92rem; }
.rule-head button { margin: 0; padding: 7px 14px; font-size: 0.88rem; flex-shrink: 0; }
.rule-active { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-top: 12px; }
.rule-active input { margin: 0; width: 18px; height: 18px; }
.new-rule { margin-top: 10px; }

/* ---- Admin ---- */
.admin-link { text-align: center; margin: 32px 0 0; font-size: 0.92rem; }
.admin-link a { color: var(--ink-soft); text-underline-offset: 3px; }
.admin-link a:hover { color: var(--pen); }
.admin-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--ink); color: #fff; border-radius: 12px; padding: 9px 10px 9px 12px; margin: -12px 0 24px; font-size: 0.92rem;
}
.admin-bar-label { background: var(--highlight); color: var(--highlight-ink); font-weight: 700; font-size: 0.82rem; padding: 2px 8px; border-radius: 6px; }
.admin-bar-name { font-weight: 600; flex: 1; min-width: 0; }
.admin-bar-btn { color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; padding: 5px 12px; font-weight: 600; }
.admin-bar-btn:hover { color: #fff; background: rgba(255,255,255,.12); border-color: #fff; }
.admin-note { display: inline-block; background: var(--highlight); color: var(--highlight-ink); font-weight: 600; font-size: 0.85rem; padding: 3px 10px; border-radius: 6px; margin-bottom: 16px; }
.biz-row { grid-template-columns: 1fr 130px 170px; }

/* ---- Email designer (admin-only tab) ---- */
.designer { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 40px; align-items: start; }
.designer-controls .admin-note { margin-bottom: 6px; }
.field-group { padding: 20px 0; border-bottom: 1px solid var(--line); }
.field-group h3 { margin: 0 0 12px; font-size: 1rem; font-weight: 700; }
.field-group h3 .optional { font-size: 0.85rem; }
.field-group label:first-of-type { margin-top: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.logo-row { display: flex; gap: 16px; align-items: center; }
.logo-box { width: 120px; height: 72px; flex-shrink: 0; border: 1.5px dashed var(--line-strong); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; padding: 8px; background: #fff; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-box span { font-size: 0.82rem; color: var(--ink-soft); }
.logo-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.logo-actions .hint { margin: 0; }
.file-btn { display: inline-block; margin: 0; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: #fff; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.file-btn:hover { border-color: var(--pen); color: var(--pen-deep); background: var(--pen-wash); }
.file-btn:focus-within { outline: 3px solid var(--pen-ring); outline-offset: 2px; }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.swatch-row { display: flex; flex-wrap: wrap; gap: 10px; }
button.swatch, .swatch { width: 34px; height: 34px; margin: 0; padding: 0; border-radius: 50%; border: none; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); position: relative; }
button.swatch:hover { opacity: .9; }
.swatch.selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.swatch.custom { display: inline-block; background: conic-gradient(#e5484d, #f5a524, #46a758, #0090ff, #8e4ec6, #e5484d); }
.swatch.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: none; padding: 0; }

.style-grid { --brand: #1d2b4a; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.style-card { position: relative; display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 10px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; }
.style-card:hover { border-color: var(--line-strong); }
.style-card.selected { border-color: var(--pen); box-shadow: 0 0 0 3px var(--pen-ring); }
.style-card input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.style-card:focus-within { outline: 3px solid var(--pen-ring); outline-offset: 2px; }
.style-name { font-weight: 600; font-size: 0.9rem; text-align: center; }
/* Tiny drawings of each header, in the chosen color */
.style-thumb { display: flex; flex-direction: column; gap: 5px; height: 78px; border-radius: 7px; overflow: hidden;
  background: #fff; border: 1px solid var(--line); padding-bottom: 8px; }
.style-thumb i { display: block; flex-shrink: 0; background: var(--brand); }
.thumb-banner i { height: 24px; }
.thumb-clean i { height: 4px; }
.thumb-clean em { display: block; height: 7px; width: 40%; margin: 6px 10px 3px; border-radius: 3px; background: var(--brand); }
.style-thumb b { display: block; height: 5px; margin: 0 10px; border-radius: 3px; background: #dfe3ec; }
.thumb-banner b:first-of-type { margin-top: 6px; height: 7px; width: 55%; background: #b9c0cf; }
.thumb-clean b:first-of-type { height: 7px; width: 55%; background: #b9c0cf; }
.style-thumb b.short { width: 45%; }

.designer-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 20px 0 8px; }
.designer-actions button { margin: 0; }

.designer-preview { position: sticky; top: 16px; }
.preview-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.preview-bar select { flex: 1; min-width: 0; }
.seg { display: inline-flex; padding: 3px; background: #eef0f4; border-radius: 10px; flex-shrink: 0; }
.seg-btn { margin: 0; padding: 7px 12px; border: none; background: transparent; color: var(--ink-soft); font-size: 0.88rem; border-radius: 8px; }
.seg-btn:hover { background: transparent; color: var(--ink); }
.seg-btn.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(27,36,64,.12); }
.preview-stage { background: #eef0f4; border-radius: 14px; padding: 14px; display: flex; justify-content: center; }
#t-preview { width: 100%; height: 700px; border: none; border-radius: 10px; background: #fff; display: block; transition: width .2s ease; }
.preview-stage.phone #t-preview { width: 375px; max-width: 100%; }

/* ---- Small screens ---- */
@media (max-width: 980px) {
  .designer { grid-template-columns: 1fr; gap: 12px; }
  .designer-preview { position: static; }
  #t-preview { height: 620px; }
}
@media (max-width: 640px) {
  .wrap { padding-top: 24px; }
  .brand-head h1 { font-size: 2.1rem; }
  section.panel.panel-primary { padding: 20px 18px 22px; border-radius: 14px; }
  .form-row { grid-template-columns: 1fr; }
  .cust-row, .biz-row { grid-template-columns: 1fr auto; gap: 12px 14px; }
  .cust-main { grid-column: 1 / -1; }
  .list-head input[type=search] { width: 100%; }
  header.letterhead h1 { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
section.panel h2 + table { margin-top: 14px; }
.failed { color: var(--danger); font-weight: 600; }
.fail-reason { font-size: 0.8rem; color: var(--ink-soft); margin-top: 2px; max-width: 260px; word-break: break-word; }
.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0 0; font-weight: 600; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin: 2px 0 0; flex-shrink: 0; }
.admin-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.admin-tools button { margin: 0; }
.brand-head h1.lockup { color: var(--pen); }
.brand-head h1.lockup .line2 { display: block; color: var(--ink); }

/* ---- Language: globe switcher and French/English columns ---- */
.lang-bar { display: flex; justify-content: flex-end; margin: -20px 0 8px; }
.lang-btn { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 6px 12px; border-radius: 99px;
  background: #fff; color: var(--ink); border: 1px solid var(--line-strong); font-size: 0.88rem; font-weight: 600; }
.lang-btn:hover { background: var(--pen-wash); border-color: var(--pen); color: var(--pen-deep); }
.lang-btn svg { flex-shrink: 0; }
.lang-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.lang-col { min-width: 0; }
.lang-tag { display: inline-block; margin-top: 14px; font-size: 0.8rem; font-weight: 700; color: var(--pen); background: var(--pen-wash); padding: 2px 9px; border-radius: 99px; }
section.panel-primary .lang-tag { background: #fff; }
.lang-col .lang-tag + label { margin-top: 8px; }
.lang-pill { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--pen-wash); color: var(--pen); vertical-align: 2px; margin-left: 6px; }
select.narrow { max-width: 280px; }
select.lang-select { width: auto; flex: 0 0 auto; }
@media (max-width: 640px) {
  .lang-cols { grid-template-columns: 1fr; }
  .lang-bar { margin-top: -8px; }
}
.lang-col textarea { min-height: 104px; }
.lang-bar + .admin-bar { margin-top: 0; }

/* ---- privacy policy page ---- */
.legal-brand { margin: 0 0 18px; font-weight: 700; }
.legal-brand a { color: var(--pen); text-decoration: none; }
.legal h1 { font-size: 1.9rem; letter-spacing: -0.02em; margin: 0 0 4px; }
.legal .updated { color: var(--ink-soft); margin: 0 0 22px; font-size: 0.92rem; }
.legal h2 { font-size: 1.12rem; margin: 30px 0 8px; }
.legal p, .legal li { line-height: 1.6; max-width: 68ch; }
.legal p { margin: 8px 0; }
.legal ul { padding-left: 22px; margin: 8px 0; }
.legal li { margin: 5px 0; }
.legal a { color: var(--pen); text-underline-offset: 2px; }
.signup-terms { margin: 14px 0 0; }
.signup-terms a { color: var(--pen); }
