/* The appointment sheet in the chat (js/termin.js): a sheet of paper with a headline, three times, a short
   form and the button that books. Ink, ground, paper and yellow only; yellow marks the chosen time.
   The layout follows the width of the sheet, so it fits a chat of 720 px as well as one of 390 px. */
.termin {
  --t-tinte: var(--tinte, #121212);
  --t-grund: var(--grund, #f3f2ee);
  --t-papier: var(--papier, #fbfaf7);
  --t-gelb: var(--gelb, #ffd83a);
  --t-haar: var(--haar, rgba(18, 18, 18, 0.16));
  /* Ink at two thirds, for small labels. Mixed from the ink of the theme, so it also reads on the dark sheet. */
  --t-leise: color-mix(in srgb, var(--t-tinte) 68%, transparent);
  /* What stands on yellow is dark in both themes. */
  --t-auf-gelb: var(--fest-tinte, #121212);
  /* Behind marked text the page has its own colour, darker in the dark theme. */
  --t-marker: var(--marker, var(--t-gelb));
  --t-marke: var(--marke, Unbounded, system-ui, sans-serif);
  --t-antiqua: var(--antiqua, Newsreader, "Source Serif 4", Georgia, serif);
  --t-mono: var(--mono, "IBM Plex Mono", ui-monospace, Menlo, monospace);
  container: termin / inline-size;
  display: block;
  max-width: 600px;
  margin: 18px 0 0;
  border: 1px solid var(--t-haar);
  background: var(--t-papier);
  box-shadow: 0 2px 6px rgba(18, 18, 18, 0.08);
  color: var(--t-tinte);
  font: 400 17px / 1.5 var(--t-antiqua);
  text-align: left;
}
.termin *,
.termin *::before,
.termin *::after {
  box-sizing: border-box;
}
.termin :is(h3, p, fieldset, legend) {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.termin [hidden] {
  display: none;
}

.termin .termin__kopf {
  padding: 18px 20px 15px;
  border-bottom: 1.5px solid var(--t-tinte);
}
.termin .termin__titel {
  font: 600 clamp(16px, 3.4cqw, 20px) / 1.22 var(--t-marke);
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.termin .termin__notiz {
  color: var(--t-leise);
  font: 400 12px / 1.5 var(--t-mono);
}
.termin .termin__kopf .termin__notiz {
  margin-top: 7px;
}
.termin .termin__inhalt {
  display: grid;
  gap: 20px;
  padding: 18px 20px 22px;
}
.termin .termin__marke {
  display: block;
  margin-bottom: 8px;
  color: var(--t-leise);
  font: 500 12px / 1.3 var(--t-mono);
  letter-spacing: 0.02em;
}

/* The three times. Narrow: one below the other, day on the left, time on the right. Wide: side by side. */
.termin .termin__reihe {
  display: grid;
  gap: 8px;
}
.termin .termin__zeit {
  display: grid;
  grid-template: "tag uhr" auto "datum uhr" auto / minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 9px 14px 10px;
  border: 1px solid var(--t-tinte);
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms;
}
.termin .termin__zeit:hover {
  background: var(--t-grund);
}
.termin .termin__zeit[aria-pressed="true"] {
  border-color: var(--t-auf-gelb);
  background: var(--t-gelb);
  box-shadow: inset 0 0 0 1px var(--t-auf-gelb);
  color: var(--t-auf-gelb);
}
.termin .termin__zeit[aria-pressed="true"] .termin__tag {
  color: color-mix(in srgb, var(--t-auf-gelb) 72%, transparent);
}
.termin .termin__tag {
  grid-area: tag;
  color: var(--t-leise);
  font: 500 12px / 1.3 var(--t-mono);
  letter-spacing: 0.02em;
}
.termin .termin__datum {
  grid-area: datum;
  font: 400 17px / 1.3 var(--t-antiqua);
}
.termin .termin__uhr {
  grid-area: uhr;
  font: 600 15px / 1.2 var(--t-marke);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
/* The commas of the label stay in the text for screen readers and for copying; the eye does not need them. */
.termin .termin__komma {
  font-size: 0;
}

.termin .termin__paar {
  display: grid;
  gap: 18px;
}
.termin .termin__eingabe {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--t-tinte);
  border-radius: 0;
  background: var(--t-grund);
  color: var(--t-tinte);
  font: 400 17px / 1.45 var(--t-antiqua);
}
.termin textarea.termin__eingabe {
  min-height: calc(3lh + 20px);
  resize: vertical;
  field-sizing: content;
}
.termin .termin__einwilligung {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  font: 400 15.5px / 1.5 var(--t-antiqua);
  cursor: pointer;
}
.termin .termin__einwilligung input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--t-tinte);
  cursor: pointer;
}
/* A link in a consent is marked by weight, without an underline. */
.termin .termin__einwilligung a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}
.termin .termin__fehler {
  padding: 11px 14px 12px;
  border-left: 3px solid var(--t-tinte);
  background: var(--t-grund);
  font: 400 16px / 1.45 var(--t-antiqua);
}

.termin .termin__fuss {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}
.termin .termin__buchen {
  min-height: 48px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: var(--t-tinte);
  color: var(--t-papier);
  font: 600 14.5px / 1 var(--t-marke);
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms;
}
.termin .termin__buchen:hover:not(:disabled) {
  background: color-mix(in srgb, var(--t-tinte) 84%, var(--t-papier));
}
.termin .termin__buchen:disabled {
  background: color-mix(in srgb, var(--t-tinte) 30%, var(--t-papier));
  cursor: not-allowed;
}
/* Focus. Buttons and boxes keep a frame for the keyboard. A text field gets none:
   the line below it grows stronger instead, and the field a shade deeper. */
.termin :is(.termin__zeit, .termin__buchen, .termin__einwilligung input):focus-visible {
  outline: 2px solid var(--t-tinte);
  outline-offset: 2px;
}
.termin .termin__eingabe:focus-visible {
  outline: 0;
  background: color-mix(in srgb, var(--t-tinte) 6%, var(--t-grund));
  box-shadow: 0 2px 0 var(--t-tinte);
}

/* What is wrong with a field, in a sentence right below it. */
.termin .termin__meldung {
  margin-top: 7px;
  padding-left: 9px;
  border-left: 2px solid var(--t-tinte);
  font: 400 15px / 1.4 var(--t-antiqua);
}
.termin .termin__einwilligung + .termin__meldung {
  margin-left: 34px;
}

/* After the booking: day and time under the yellow marker. */
.termin .termin__bestaetigung {
  display: grid;
  gap: 12px;
  padding: 20px 20px 24px;
  outline: 0;
}
.termin .termin__wann {
  font: 600 clamp(16px, 3.8cqw, 21px) / 1.5 var(--t-marke);
  letter-spacing: -0.02em;
}
.termin mark {
  padding: 0.1em 0.3em;
  background: var(--t-marker);
  color: inherit;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

@container termin (min-width: 460px) {
  .termin .termin__reihe {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .termin .termin__zeit {
    grid-template: "tag" auto "datum" auto "uhr" auto / minmax(0, 1fr);
    align-content: start;
    padding: 12px 14px 13px;
  }
  .termin .termin__uhr {
    margin-top: 9px;
  }
  .termin .termin__paar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  .termin .termin__zeit,
  .termin .termin__buchen {
    transition: none;
  }
}

/* The newsletter in the chat (js/newsletter-blatt.js): the send arrow sits inside the field, as in the composer. */
.termin .newsletter__zeile {
  position: relative;
}
.termin .newsletter__zeile .termin__eingabe {
  padding-right: 56px;
}
.termin .newsletter__senden {
  position: absolute;
  top: 50%;
  right: 4px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--t-tinte);
  color: var(--t-papier);
  cursor: pointer;
  translate: 0 -50%;
}
.termin .newsletter__senden:is(:hover, :focus-visible):not(:disabled) {
  background: var(--t-gelb);
  color: var(--t-auf-gelb);
}
.termin .newsletter__senden:disabled {
  background: color-mix(in srgb, var(--t-tinte) 30%, var(--t-papier));
  cursor: not-allowed;
}
.termin .newsletter__senden .icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}
.termin .newsletter__text {
  margin-top: 7px;
  font: 400 16px / 1.45 var(--t-antiqua);
}
.termin .newsletter__klein {
  color: var(--t-leise);
  font: 400 14px / 1.45 var(--t-antiqua);
}
.termin .newsletter__klein a {
  color: inherit;
}
