/* The public site (spec 9.4): the home page, the documents and the not-found page.
   Its own stylesheet, without Tabler: ink blue of an agenda pen, and the yellow of a
   highlighter only where something gets marked (the chosen time, the main action). */

:root {
  --ink: #1e2756;
  --ink-soft: #2d3876;
  --marker: #ffd54a;
  --marker-strong: #ffc929;
  --paper: #fff;
  --mist: #eef1f8;
  --rule: #c9d0ea;
  --text: #1a1e33;
  --muted: #4b5270;
  --on-ink: #fff;
  --on-ink-soft: #d4daf0;
  --on-ink-muted: #aeb6da;
  --serif: "Alegreya", Georgia, "Times New Roman", serif;
  --sans: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
}

/* Base */

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

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--paper);
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

a {
  color: var(--ink);
}

/* Links in text do not rely on color alone (spec 12). */
:where(p, li) a:not(.button) {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

:where(.site-header, .hero, .site-footer) :focus-visible {
  outline-color: var(--marker);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--marker);
  border-radius: 0.375rem;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.site-main {
  flex: 1 0 auto;
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 48em) {
  .wrap {
    padding-inline: 1.5rem;
  }
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.375rem;
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 0.5rem;
}

.button-marker {
  color: var(--ink);
  background: var(--marker);
}

.button-marker:hover {
  color: var(--ink);
  background: var(--marker-strong);
}

.button-on-ink {
  color: var(--on-ink);
  border-color: rgb(255 255 255 / 55%);
}

.button-on-ink:hover {
  color: var(--on-ink);
  background: rgb(255 255 255 / 10%);
}

.button-ink {
  color: var(--on-ink);
  background: var(--ink);
}

.button-ink:hover {
  color: var(--on-ink);
  background: var(--ink-soft);
}

.button-outline {
  color: var(--ink);
  border-color: var(--rule);
}

.button-outline:hover {
  background: var(--mist);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Header */

.site-header {
  color: var(--on-ink);
  background: var(--ink);
  border-bottom: 1px solid rgb(255 255 255 / 12%);
}

.site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.site-bar .button {
  min-height: 2.5rem;
  padding: 0 1rem;
  font-size: 1rem;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--serif);
  font-size: 1.4375rem;
  font-weight: 700;
  line-height: 1;
  color: var(--on-ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--on-ink);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding-bottom: 0.1em;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--marker);
  border-radius: 50%;
}

/* Hero: a rescheduling as the patient sees it, and the request in her panel */

.hero {
  padding: 4.5rem 0 5.5rem;
  color: var(--on-ink);
  background: var(--ink);
}

.hero a:not(.button) {
  color: var(--on-ink);
}

.hero-grid {
  display: grid;
  gap: 3.5rem;
  align-items: center;
}

.hero-title {
  max-width: 18ch;
  font-family: var(--serif);
  font-size: clamp(2.375rem, 1.5rem + 3.4vw, 3.75rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.hero-lead {
  max-width: 34rem;
  margin-top: 1.5rem;
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--on-ink-soft);
  text-wrap: pretty;
}

.hero .actions {
  margin-top: 2rem;
}

.hero-note {
  max-width: 34rem;
  margin-top: 1rem;
  font-size: 0.9375rem;
  color: var(--on-ink-muted);
}

.demo {
  width: 100%;
  max-width: 27rem;
}

.chat {
  padding: 1rem 1rem 3.5rem;
  color: var(--text);
  background: #f3f5fb;
  border-radius: 1.25rem;
  box-shadow: 0 1.5rem 3rem rgb(8 12 40 / 35%);
}

.chat-contact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  border-bottom: 1px solid #dde2ef;
}

.chat-contact small {
  display: block;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
}

.chat-avatar {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.875rem;
  color: var(--on-ink);
  background: var(--ink-soft);
  border-radius: 50%;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.875rem;
  list-style: none;
}

.bubble {
  max-width: 88%;
  padding: 0.5rem 0.75rem 0.375rem;
  font-size: 0.96875rem;
  line-height: 1.4;
  border-radius: 0.875rem;
}

.bubble time {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.75rem;
  color: #555c7a;
  text-align: right;
}

.bubble-patient {
  align-self: flex-end;
  background: #dce4ff;
  border-bottom-right-radius: 0.25rem;
}

.bubble-bot {
  align-self: flex-start;
  background: var(--paper);
  border-bottom-left-radius: 0.25rem;
  box-shadow: 0 1px 0 rgb(30 39 86 / 8%);
}

.chat-options {
  display: block;
  margin-top: 0.375rem;
}

.chat-options > span {
  display: block;
}

/* A highlighter stroke, as on a paper agenda. */
.chat-chosen,
.request-new {
  background-image: linear-gradient(
    transparent 10%,
    var(--marker) 10%,
    var(--marker) 92%,
    transparent 92%
  );
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.chat-chosen {
  width: fit-content;
  margin-inline: -0.25em;
  padding-inline: 0.25em;
}

.request {
  position: relative;
  width: calc(100% - 1.5rem);
  max-width: 19rem;
  margin: -2.5rem 0 0 0.75rem;
  padding: 1rem 1.125rem 1.125rem;
  color: var(--text);
  background: var(--paper);
  border-radius: 1rem;
  box-shadow: 0 1rem 2.5rem rgb(8 12 40 / 35%);
}

.request-kind {
  font-size: 0.875rem;
  color: var(--muted);
}

.request-patient {
  font-size: 1.0625rem;
  font-weight: 700;
}

.request-when {
  margin-top: 0.25rem;
  line-height: 1.35;
}

.request-new {
  display: inline;
  padding-inline: 0.2em;
  margin-inline: -0.2em;
  font-weight: 500;
}

.request-old {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.request-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.875rem;
  font-size: 0.9375rem;
  font-weight: 700;
}

.request-actions span {
  padding: 0.3rem 0.875rem;
  border-radius: 0.375rem;
}

.request-approve {
  color: var(--on-ink);
  background: var(--ink);
}

.request-refuse {
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--rule);
}

.demo figcaption {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  color: var(--on-ink-muted);
}

@media (min-width: 60em) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 4rem;
  }

  .demo {
    justify-self: end;
  }

  .request {
    margin-left: -2rem;
  }
}

/* The conversation plays once when the page opens. */
@media (prefers-reduced-motion: no-preference) {
  .chat-messages .bubble {
    animation: appear 0.45s ease-out both;
  }

  .chat-messages .bubble:nth-child(1) {
    animation-delay: 0.3s;
  }

  .chat-messages .bubble:nth-child(2) {
    animation-delay: 1s;
  }

  .chat-messages .bubble:nth-child(3) {
    animation-delay: 2.1s;
  }

  .chat-messages .bubble:nth-child(4) {
    animation-delay: 2.8s;
  }

  .chat-chosen {
    animation: mark 0.5s ease-out 2.3s both;
  }

  .request {
    animation: appear 0.5s ease-out 3.5s both;
  }

  .request-new {
    animation: mark 0.5s ease-out 4s both;
  }
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
}

@keyframes mark {
  from {
    background-size: 0% 100%;
  }
}

/* Bands */

.band {
  padding: 4.5rem 0;
}

.band-mist {
  background: var(--mist);
}

.band-title,
.band-subtitle {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--ink);
  text-wrap: balance;
}

.band-title {
  font-size: clamp(1.875rem, 1.5rem + 1.4vw, 2.5rem);
  line-height: 1.15;
}

.band-subtitle {
  font-size: 1.625rem;
  line-height: 1.2;
}

.band-intro {
  max-width: 38rem;
  margin-top: 0.75rem;
  font-size: 1.1875rem;
  color: var(--muted);
  text-wrap: pretty;
}

.split {
  display: grid;
  gap: 3rem;
}

.split p,
.split .checks,
.split .inline-links {
  max-width: 36rem;
}

.split .band-subtitle + p {
  margin-top: 0.75rem;
  color: var(--muted);
}

.split .checks {
  margin-top: 1.25rem;
}

.split .checks + p,
.inline-links {
  margin-top: 1.25rem;
}

@media (min-width: 60em) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

/* How it works: a real sequence, from the first message to the reminder */

.steps {
  display: grid;
  gap: 2.75rem 2rem;
  margin-top: 3.25rem;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding-top: 1.75rem;
  border-top: 2px solid var(--rule);
  counter-increment: step;
}

.steps li::before {
  position: absolute;
  top: -1.15rem;
  left: 0;
  padding-right: 0.625rem;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  content: counter(step);
  background: var(--paper);
}

.steps h3,
.principles h3 {
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.steps p,
.principles p {
  margin-top: 0.5rem;
  font-size: 1.0625rem;
  color: var(--muted);
}

@media (min-width: 40em) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64em) {
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* What the bot never does */

.statement {
  max-width: 20ch;
  font-family: var(--serif);
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
}

.principles {
  display: grid;
  gap: 2rem;
  margin-top: 2.5rem;
  list-style: none;
}

.principles li {
  max-width: 36rem;
}

@media (min-width: 56em) {
  .principles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem 4rem;
  }
}

/* Price */

.price-value {
  font-family: var(--serif);
  font-size: clamp(3rem, 2.2rem + 3vw, 4.25rem);
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.price-value span {
  margin-left: 0.25rem;
  font-family: var(--sans);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--muted);
}

.price .checks {
  margin-top: 1.5rem;
}

.price-note {
  margin-top: 1.25rem;
  font-size: 1rem;
  color: var(--muted);
}

.price .actions {
  margin-top: 1.75rem;
}

/* Lists */

.checks {
  list-style: none;
}

.checks li {
  position: relative;
  padding-left: 1.875rem;
}

.checks li + li {
  margin-top: 0.625rem;
}

.checks li::before {
  position: absolute;
  top: 0.3em;
  left: 0.3rem;
  width: 0.5rem;
  height: 0.875rem;
  content: "";
  border: solid var(--ink);
  border-width: 0 0.1875rem 0.1875rem 0;
  transform: rotate(40deg);
}

.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
}

/* Documents and the not-found page */

.document {
  max-width: 46rem;
  padding-block: 3rem 4.5rem;
}

.document-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 1.6rem + 1.6vw, 2.625rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}

.document-version {
  margin-top: 0.5rem;
  color: var(--muted);
}

.document-draft {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: #4a3b00;
  background: #fff6d6;
  border: 1px solid #ebd38a;
  border-radius: 0.5rem;
}

.document .actions {
  margin-top: 2rem;
}

.prose {
  margin-top: 2rem;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.prose p,
.prose ul,
.prose ol {
  margin-top: 1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.375rem;
}

.prose li + li {
  margin-top: 0.375rem;
}

.prose h2 {
  margin-top: 2.5rem;
  font-family: var(--serif);
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

.prose h3 {
  margin-top: 1.75rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
}

.prose code {
  font-size: 0.875em;
}

.prose :target {
  scroll-margin-top: 1.5rem;
}

/* Footer */

.site-footer {
  padding: 3rem 0;
  font-size: 1rem;
  color: var(--on-ink-muted);
  background: var(--ink);
}

.site-footer a {
  color: var(--on-ink);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 1.5rem 0;
  list-style: none;
}

.footer-company {
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* The CNPJ breaks at its hyphen, and a line should not end in "CNPJ". */
.footer-company .unbroken {
  white-space: nowrap;
}

@media (max-width: 29.99em) {
  .hero {
    padding: 2.75rem 0 3.5rem;
  }

  .band {
    padding: 3.25rem 0;
  }

  .actions .button {
    flex: 1 1 100%;
  }
}
