/*
 * The InnDesk page.
 *
 * Loaded after style.css and only by this page, so the three legal pages keep
 * the narrow column they were written for and nothing here can move them.
 *
 * The drawings are HTML and CSS, not images. A hotel owner on a slow phone
 * gets them at the same moment as the text, they stay sharp on any screen, and
 * they can be read by a screen reader because the labels in them are real
 * words rather than pixels. Every one of them stops moving for anybody who has
 * asked their device to reduce motion.
 */

.wide {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 20px;
}

.page.wide { padding-top: 40px; }

/* ------------------------------------------------------------- the opening */

.answer {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 0 0 26px;
}

.answer p { font-size: 17.5px; margin-bottom: 0; }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-family: Poppins, 'Segoe UI', system-ui, sans-serif;
  font-weight: 600;
  font-size: 15.5px;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--brand);
}

.cta:hover { background: #653f1d; }

.cta.quiet {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}

.cta.quiet:hover { border-color: var(--brand); color: var(--brand); }

.ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 8px;
}

.aside { font-size: 14px; color: var(--muted); margin: 10px 0 0; }

/* --------------------------------------------------------------- structure */

.section { margin-top: 52px; }
.section > h2 { margin-top: 0; font-size: 23px; }

.two {
  display: grid;
  gap: 26px;
  grid-template-columns: 1fr;
  align-items: center;
}

@media (min-width: 780px) {
  .two { grid-template-columns: 1fr 1fr; gap: 38px; }
  .two.flip > *:first-child { order: 2; }
}

.feature {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 0 0 14px;
}

.feature h3 { margin-top: 0; }
.feature p:last-child { margin-bottom: 0; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
  margin: 0 0 14px;
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

th {
  font-family: Poppins, 'Segoe UI', system-ui, sans-serif;
  font-weight: 600;
  background: var(--ground);
}

tbody tr:last-child td { border-bottom: none; }

.scroller { overflow-x: auto; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 46px;
  margin-bottom: 22px;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-family: Poppins, 'Segoe UI', system-ui, sans-serif;
  font-weight: 600;
  font-size: 14px;
}

.steps h3 { margin: 2px 0 4px; }
.steps p { margin-bottom: 0; }

details {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 10px;
}

summary {
  cursor: pointer;
  font-family: Poppins, 'Segoe UI', system-ui, sans-serif;
  font-weight: 600;
  font-size: 15.5px;
}

details p { margin: 10px 0 0; }

/* -------------------------------------------------------------- the demo */

/*
 * The booking page, working, on this page.
 *
 * It borrows the real widget's shapes on purpose: the same brand colour, the
 * same corner radius, the same two colours on the calendar. Somebody who tries
 * it here and then installs the app should recognise what they get.
 */
#demo {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 6px 0 10px;
}

@media (min-width: 620px) { #demo { padding: 24px 26px; } }

.d-note {
  background: #f6f2ec;
  border: 1px solid #e6dccd;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: #6b573c;
  margin-bottom: 16px;
}

.d-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.d-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  font-size: 13px;
  color: var(--muted);
}

.d-steps li { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.d-steps li.on { color: var(--ink); font-weight: 600; }

.d-steps span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  background: #eceff3;
  color: var(--muted);
}

.d-steps li.on span { background: var(--brand); color: #fff; }
.d-steps li.done span { background: #e6efe8; color: #2f6b4f; }

.d-h {
  font-family: Poppins, 'Segoe UI', system-ui, sans-serif;
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 14px;
  outline-offset: 4px;
}

.d-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }

.d-field {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
}

.d-field span { display: block; font-size: 12px; color: var(--muted); }
.d-field strong { font-weight: 500; font-size: 15px; }

/* ------------------------------------------------------------- the calendar */

.d-cal { border: 1px solid var(--line); border-radius: 6px; padding: 12px; }

.d-calhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.d-calhead strong { font-family: Poppins, 'Segoe UI', system-ui, sans-serif; font-size: 15px; }

.d-step-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.d-step-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.d-step-btn:disabled { opacity: 0.4; cursor: default; }

.d-week, .d-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }

.d-week {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.d-gap { display: block; }

.d-day {
  /*
   * Square, until square gets silly. On a wide screen each column is a
   * hundred pixels across, and a hundred pixel tall date cell makes a month
   * taller than the screen it is on.
   */
  aspect-ratio: 1;
  min-height: 34px;
  max-height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  padding: 0;
}

.d-free { background: #eef5ee; color: #245a41; }
.d-free:hover { border-color: #2f6b4f; }

.d-gone {
  background: #f8efef;
  color: #7e3427;
  text-decoration: line-through;
  cursor: not-allowed;
}

/*
 * A day that has been and gone. Plain and quiet, never the colour that means
 * sold: three weeks of red at the top of a month reads as a full hotel rather
 * than as the middle of August.
 */
.d-past {
  background: var(--paper);
  color: #9aa2ac;
  cursor: default;
}

/*
 * Free, but not a legal choice yet: a departure before the arrival, or one
 * that would have to sleep through a night that is gone. Muted rather than
 * faded, because faded text is text nobody can read.
 */
.d-out {
  background: var(--paper);
  color: var(--muted);
  text-decoration: none;
  cursor: not-allowed;
  border-color: transparent;
}

.d-picked { background: var(--brand); color: #fff; border-color: var(--brand); text-decoration: none; font-weight: 600; }
.d-between { background: #f3ece3; color: var(--ink); }

.d-key { display: flex; align-items: center; gap: 7px; margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.d-sw { width: 13px; height: 13px; border-radius: 3px; display: inline-block; }
.d-sw.d-free { background: #cfe3d5; }
.d-sw.d-gone { background: #eed6d1; margin-left: 12px; }

/* ---------------------------------------------------------------- the rooms */

.d-rooms-lede { margin: 22px 0 10px; font-size: 13px; color: var(--muted); }
.d-rooms { display: grid; gap: 10px; }

.d-room {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

@media (min-width: 620px) {
  .d-room { grid-template-columns: 130px 1fr 170px; align-items: stretch; }
}

.d-shot { min-height: 96px; }
.d-roominfo { padding: 12px 14px; }
.d-roominfo h4 { font-family: Poppins, 'Segoe UI', system-ui, sans-serif; font-size: 16px; margin: 0 0 4px; }
.d-roominfo p { font-size: 13.5px; color: var(--muted); margin: 0 0 8px; }

.d-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.d-chips span { font-size: 11.5px; padding: 2px 8px; border-radius: 4px; background: #eff2f5; color: #4a5462; }

.d-buy {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

@media (min-width: 620px) {
  .d-buy { border-top: none; border-left: 1px solid var(--line); text-align: right; align-items: flex-end; }
}

.d-buy strong { font-family: Poppins, 'Segoe UI', system-ui, sans-serif; font-size: 19px; }
.d-buy > span { font-size: 13px; color: var(--muted); }
.d-total { font-size: 12px; color: var(--muted); }
.d-none { font-size: 12.5px; color: #7e3427; }

/* ------------------------------------------------------------- the controls */

.d-go {
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  border-radius: 6px;
  font-family: Poppins, 'Segoe UI', system-ui, sans-serif;
  font-weight: 600;
  font-size: 14.5px;
  padding: 9px 18px;
  cursor: pointer;
  margin-top: 6px;
}

.d-go:hover { background: #653f1d; }
.d-wide { display: block; width: 100%; margin-top: 14px; }

.d-link {
  border: none;
  background: none;
  padding: 0;
  color: var(--brand);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}

.d-form { display: grid; gap: 12px; margin-bottom: 16px; }
.d-form label { display: block; font-size: 13px; color: var(--muted); }

.d-form input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}

.d-form input:focus { border-color: var(--brand); outline: 2px solid #d8c4ac; outline-offset: 1px; }

.d-summary { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; font-size: 14px; }
.d-summary div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.d-fee { color: #245a41; font-weight: 600; }
.d-tot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-weight: 700; font-size: 16px; }
.d-back { margin: 12px 0 0; }

.d-done { text-align: center; padding: 8px 0 4px; }

.d-tick {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e6efe8;
  color: #245a41;
  font-size: 22px;
}

.d-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 22px;
  letter-spacing: 0.1em;
  background: #f5f6f8;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: inline-block;
  padding: 8px 16px;
  margin: 12px 0;
}

.d-small { font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------ the drawings */

.demo {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 13px;
  line-height: 1.4;
}

.demo .bar-top {
  display: flex;
  gap: 5px;
  margin-bottom: 12px;
}

.demo .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #dfe4ea;
}

.demo .cap {
  display: block;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

/* The guest picking dates, choosing a room, and being confirmed. */
.flow { display: grid; gap: 8px; }

/*
 * The step that is lit is marked by its border and its background, never by
 * fading the others out. Dimming the text was the first way this was written,
 * and it dropped the waiting steps to a contrast of 1.6 against white, which
 * is a drawing that only works for people who do not need to read it.
 */
.flow .stage {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 6px;
  padding: 10px 12px;
  animation: lightUp 8s infinite;
}

.flow .stage:nth-child(1) { animation-delay: 0s; }
.flow .stage:nth-child(2) { animation-delay: 2s; }
.flow .stage:nth-child(3) { animation-delay: 4s; }
.flow .stage:nth-child(4) { animation-delay: 6s; }

@keyframes lightUp {
  0%, 2% { background: var(--paper); border-color: var(--line); }
  6%, 24% { background: #f3ece3; border-color: var(--brand); }
  28%, 100% { background: var(--paper); border-color: var(--line); }
}

.flow .stage b {
  font-family: Poppins, 'Segoe UI', system-ui, sans-serif;
  display: block;
}

.flow .stage span { color: var(--muted); }

/* A month, with the nights that are gone marked as a guest sees them. */
.month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.month i {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 5px;
  font-style: normal;
  font-size: 12px;
  background: #eef5ee;
  color: #2f6b4f;
}

.month i.gone {
  background: #f8efef;
  color: #8c3a2b;
  text-decoration: line-through;
  animation: fillUp 7s infinite;
}

.month i.gone:nth-of-type(2n) { animation-delay: 0.6s; }
.month i.gone:nth-of-type(3n) { animation-delay: 1.2s; }

@keyframes fillUp {
  0%, 14% { background: #eef5ee; color: #2f6b4f; text-decoration: none; }
  22%, 88% { background: #f8efef; color: #8c3a2b; text-decoration: line-through; }
  96%, 100% { background: #eef5ee; color: #2f6b4f; text-decoration: none; }
}

/* Rates changed by dragging across a week. */
.drag { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }

.drag i {
  font-style: normal;
  text-align: center;
  padding: 12px 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
  background: var(--paper);
}

.drag i.picked {
  animation: sweep 6s infinite;
}

.drag i.picked:nth-of-type(1) { animation-delay: 0s; }
.drag i.picked:nth-of-type(2) { animation-delay: 0.25s; }
.drag i.picked:nth-of-type(3) { animation-delay: 0.5s; }
.drag i.picked:nth-of-type(4) { animation-delay: 0.75s; }

@keyframes sweep {
  0%, 8% { background: var(--paper); border-color: var(--line); }
  16%, 72% { background: #f3ece3; border-color: var(--brand); }
  84%, 100% { background: var(--paper); border-color: var(--line); }
}

/* One night going off sale everywhere at once. */
.sync {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.sync .who {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
}

.sync .who em {
  font-style: normal;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 20px;
  background: #eef5ee;
  color: #2f6b4f;
  animation: takeOff 6s infinite;
}

.sync .who:nth-child(2) em { animation-delay: 1.1s; }
.sync .who:nth-child(3) em { animation-delay: 2.2s; }

@keyframes takeOff {
  0%, 10% { background: #eef5ee; color: #2f6b4f; }
  18%, 84% { background: #f8efef; color: #8c3a2b; }
  92%, 100% { background: #eef5ee; color: #2f6b4f; }
}

/* The morning screen. */
.morning { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.morning div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}

.morning b {
  font-family: Poppins, 'Segoe UI', system-ui, sans-serif;
  font-size: 22px;
  display: block;
  line-height: 1.1;
}

.morning span { color: var(--muted); font-size: 12px; }

.morning div:nth-child(1) b { animation: countIn 5s infinite; }
.morning div:nth-child(2) b { animation: countIn 5s infinite 0.4s; }
.morning div:nth-child(3) b { animation: countIn 5s infinite 0.8s; }

@keyframes countIn {
  0%, 6% { opacity: 0.25; transform: translateY(4px); }
  14%, 90% { opacity: 1; transform: none; }
  100% { opacity: 0.25; transform: translateY(4px); }
}

/*
 * Anybody who has asked for less motion gets the finished state of every
 * drawing and none of the movement. The drawings still say what they say.
 */
@media (prefers-reduced-motion: reduce) {
  /*
   * Marked important because the rules that start these animations are more
   * specific than the ones that stop them, and an accessibility override that
   * loses on specificity is an override that does nothing. The morning
   * counters kept moving until this was measured.
   */
  .flow .stage,
  .month i.gone,
  .drag i.picked,
  .sync .who em,
  .morning div b {
    animation: none !important;
  }

  .flow .stage { border-color: var(--line); }
  .drag i.picked { background: #f3ece3; border-color: var(--brand); }
  .sync .who em { background: #f8efef; color: #8c3a2b; }
  .morning div b { opacity: 1; transform: none; }
}
