/* Mantey client portal. Colours, type and buttons follow the studio site. */

@font-face {
  font-family: "Outfit";
  src: url("/fonts/outfit.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/fonts/dmsans.ttf") format("truetype");
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  --paper: #f6f4f0;
  --card: #ffffff;
  --ink: #0d0d0d;
  --muted: #5c5854;
  --line: #e2ddd4;
  --field-line: #8f877b;
  --cream: #f3efe8;
  /* The darker terracotta is the one that passes contrast for small text and
     for white text on buttons. The lighter one is only for large accents. */
  --accent: #a8481a;
  --accent-hover: #8c3b14;
  --accent-soft: #fbeee6;
  --r-sm: 8px;
  --r-md: 16px;
  --pad: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

/* Focus rings sit flush on the element's edge, with no gap. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  z-index: 10;
}
.skip:focus { top: 12px; }

/* Top bar */
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top__inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.top__logo { display: block; line-height: 0; }
.top__logo img { height: 40px; width: auto; }
.top__right { display: flex; align-items: center; gap: 16px; }
.top__who {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 14px;
  color: var(--muted);
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-bar {
  background: var(--ink);
  color: #fff;
  text-align: center;
  padding: 10px var(--pad);
  font-size: 14px;
}
.preview-bar a { color: #fff; }

/* Page */
.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px var(--pad) 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.page--narrow { max-width: 520px; padding-top: 56px; }

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 24px var(--pad) 32px;
}
.foot p { margin: 0; }

/* Type */
.h1 { font-size: clamp(26px, 4vw, 34px); line-height: 1.15; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.h2 { font-size: 19px; font-weight: 600; margin: 0 0 12px; }
.lead { font-size: 17px; color: var(--muted); margin: 8px 0 0; max-width: 60ch; }
.big { font-size: 20px; font-weight: 500; margin: 0 0 10px; overflow-wrap: anywhere; }
.big a { color: var(--ink); }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 14px; }
.back { font-size: 14px; color: var(--muted); }

.hello { margin-bottom: 4px; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.card--pad { padding: 22px; }
.grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

.facts { margin: 0 0 16px; display: grid; gap: 8px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; border-top: 1px solid var(--line); padding-top: 8px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; }

.list { list-style: none; margin: 0 0 16px; padding: 0; }
.list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.list li:first-child { border-top: 0; }
.list__main { overflow-wrap: anywhere; }
.list__actions { display: flex; gap: 14px; }
.list__actions form { margin: 0; }

/* Status */
.pill {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  background: var(--cream);
  color: var(--muted);
}
.pill--upcoming { background: var(--cream); color: var(--ink); }
.pill--soon { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); }
.pill--overdue { background: var(--accent); color: #fff; }

.notice {
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  background: var(--card);
  border: 1px solid var(--line);
}
.notice--due { border-color: var(--accent); background: var(--accent-soft); }
.notice--error { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); margin-top: 16px; }

/* Invoices */
.invoices { list-style: none; margin: 0; padding: 0; }
.invoice {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.invoice:first-child { border-top: 0; }
.invoice__main { display: flex; flex-direction: column; }
.invoice__no { font-weight: 500; }
.invoice__amount { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.invoice .btn { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 640px) {
  .invoice { grid-template-columns: 1fr auto auto; }
  .invoice .btn { grid-column: auto; }
}
.tag {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 13px;
  color: var(--muted);
}
.tag--due { color: var(--accent); font-weight: 600; }
.tag--alert { color: #fff; background: var(--accent); padding: 2px 8px; border-radius: 999px; font-weight: 600; }

/* Buttons: rounded, solid, with an arrow */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 12px 20px;
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn--quiet { background: var(--card); color: var(--ink); border-color: var(--field-line); }
.btn--quiet:hover { background: var(--cream); color: var(--ink); border-color: var(--ink); }
.btn--small { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.btn--danger { background: var(--card); color: var(--accent); }
.btn--danger:hover { background: var(--accent); color: #fff; }
.btn__arrow { transition: transform 0.15s ease; }
.btn:hover .btn__arrow { transform: translateX(3px); }

.link-button {
  background: none;
  border: 0;
  padding: 4px 0;
  font: inherit;
  font-size: 14px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-button--danger { color: var(--muted); }
.link-button--danger:hover { color: var(--accent); }
.top .link-button { color: var(--ink); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; align-items: flex-start; }
.form .field { width: 100%; }
.form-grid { display: grid; gap: 16px; width: 100%; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-family: "DM Sans", system-ui, sans-serif; font-size: 14px; font-weight: 500; }
.field__hint { font-size: 13px; color: var(--muted); }
.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--field-line);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--ink);
  font: inherit;
}
textarea.input { resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.inline-form {
  display: grid;
  gap: 12px;
  align-items: end;
  grid-template-columns: 1fr;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
@media (min-width: 760px) {
  .inline-form { grid-template-columns: 1fr 1fr auto; }
  .inline-form .check { grid-column: 1 / -2; }
}

.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

/* Admin table */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 12px 16px; border-top: 1px solid var(--line); }
.table thead th { border-top: 0; font-family: "DM Sans", system-ui, sans-serif; font-size: 13px; color: var(--muted); font-weight: 500; }
@media (max-width: 640px) {
  .table thead { display: none; }
  .table tr { display: block; padding: 10px 16px; border-top: 1px solid var(--line); }
  .table td { display: block; border: 0; padding: 2px 0; }
}

.danger-zone { border-color: var(--line); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Locked Care previews: real layout under a blur, sample data only. */
.grow .h2 { margin-bottom: 12px; }
@media (min-width: 760px) {
  .grid--two { grid-template-columns: repeat(2, 1fr); }
}
.locked { position: relative; display: flex; flex-direction: column; gap: 8px; }
.locked .h2 { margin: 0; }
.locked__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.locked__tag {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.locked__preview {
  margin-top: 8px;
  filter: blur(6px);
  opacity: 0.7;
  user-select: none;
  pointer-events: none;
  min-height: 150px;
}
.locked__unlock {
  position: absolute;
  left: 50%;
  top: 62%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.locked__unlock:hover { background: var(--accent); }

.sample-stats { display: flex; gap: 24px; margin-bottom: 12px; }
.sample-stats div { display: flex; flex-direction: column; }
.sample-stats__n { font-size: 26px; font-weight: 600; }
.sample-bars { display: flex; align-items: flex-end; gap: 6px; height: 56px; margin-bottom: 12px; }
.sample-bars span { flex: 1; background: var(--accent); border-radius: 4px 4px 0 0; }
.sample-bars span:nth-child(1) { height: 40%; }
.sample-bars span:nth-child(2) { height: 55%; }
.sample-bars span:nth-child(3) { height: 35%; }
.sample-bars span:nth-child(4) { height: 70%; }
.sample-bars span:nth-child(5) { height: 60%; }
.sample-bars span:nth-child(6) { height: 85%; }
.sample-bars span:nth-child(7) { height: 75%; }
.sample-lines, .sample-ideas { list-style: none; margin: 0; padding: 0; }
.sample-lines li, .sample-ideas li { padding: 8px 0; border-top: 1px solid var(--line); }

/* Unlock dialog */
.unlock {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--ink);
}
.unlock::backdrop { background: rgb(13 13 13 / 0.55); }
.unlock__body { padding: 28px 24px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.unlock__body .h2 { margin: 4px 0 0; }
.unlock__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.unlock__icon .lock-icon { width: 22px; height: 22px; }
.unlock__actions { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 12px; }
.unlock__actions form { margin: 0; }
.unlock__actions .btn { width: 100%; }
