/* The tour booking page (tour.html), laid out as scheduling pages such as
 * Calendly are: one white card on a grey desk, the daycare and the tour in a
 * column on the left, the calendar and times (tour-picker.css), the family's
 * details or the confirmation on the right. KiddoGrid's colours and type,
 * the daycare's own logo. On a narrower screen the left column goes on top;
 * on a phone the card fills the screen. A file rather than inline styles,
 * because the page's CSP allows styles from this site only. */

:root {
  --ink: #1B2545;           /* brand navy */
  --ink-soft: #5A6078;
  --accent: #6B4EE6;        /* the logo's purple */
  --accent-deep: #5A3FCC;
  --accent-soft: #EEEAFD;
  --accent-faint: #F6F4FE;
  --rule: #C9CCD8;
  --line: #E3E5EC;
  --desk: #EEF0F4;
  --paper: #FFFFFF;
  --error: #B25646;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.desk { padding: 30px 16px; }

/* ---- The card ---- */
.card {
  display: flex; max-width: 1060px; min-height: 560px; margin: 0 auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 2px 14px rgba(27, 37, 69, .08); overflow: hidden;
}
.left {
  position: relative; flex: 0 0 350px; display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
}
.logo-area {
  display: flex; align-items: center; justify-content: center;
  min-height: 138px; padding: 20px 64px; border-bottom: 1px solid var(--line);
}
/* The logo arrives trimmed and at three times this size, so it is only ever
   scaled down: up to 128 x 64 px, or 260 x 72 when it is wide (one that
   spells out the name, say). */
.center-logo { display: block; width: auto; height: auto; max-width: 128px; max-height: 64px; }
.logo-area.wide .center-logo { max-width: 222px; max-height: 72px; }
.back {
  position: absolute; left: 20px; top: 20px; z-index: 1;
  width: 38px; height: 38px; padding: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--paper); color: var(--accent); cursor: pointer;
}
.back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.back:hover { background: var(--accent-faint); }
.left.no-logo.has-back .info { padding-top: 72px; }

.info { flex: 1; display: flex; flex-direction: column; padding: 22px 28px 20px; }
.org { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink-soft); overflow-wrap: anywhere; }
.event { margin: 4px 0 12px; font-size: 27px; font-weight: 700; line-height: 1.2; }
.row {
  display: flex; align-items: flex-start; gap: 10px; margin: 8px 0;
  font-size: 15px; font-weight: 600; color: var(--ink-soft); line-height: 1.4; overflow-wrap: anywhere;
}
.row svg {
  width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.row.when { color: var(--ink); }
.desc { margin: 12px 0 0; font-size: 15px; line-height: 1.6; color: #3C4460; white-space: pre-line; overflow-wrap: anywhere; }
.powered { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.powered img { display: block; width: 80px; height: auto; }
.powered-side { margin-top: auto; padding-top: 22px; }
.powered-foot { display: none; }

/* "Powered by KiddoGrid" links to kiddogrid.com, in a new tab and with no
   referrer, so a family never loses the form and the link code in this
   page's address never leaves it. It keeps the foot's own colour. */
.powered-link { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; border-radius: 4px; }
.powered-link:hover { text-decoration: underline; }
.powered-link:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.right { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 28px 32px; }
.h { margin: 0 0 16px; font-size: 21px; line-height: 1.25; font-weight: 700; }

/* ---- Your details ---- */
.details { max-width: 600px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.field { min-width: 0; }
.field > label { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 600; }
.optional { color: var(--ink-soft); font-weight: 400; font-size: 13px; }
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--paper);
  width: 100%; min-width: 0; height: 42px; padding: 0 12px;
  border: 1px solid var(--rule); border-radius: 8px;
}
textarea { height: auto; min-height: 80px; padding: 10px 12px; line-height: 1.45; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(107, 78, 230, .18);
}
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hint { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-soft); }
.qlab { display: block; margin: 16px 0 8px; padding: 0; font-size: 14px; font-weight: 600; }

.children { display: flex; flex-direction: column; gap: 10px; }
.kid { padding: 12px 16px 14px; border: 1px solid var(--line); border-radius: 10px; background: #FAFAFD; }
.kid-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.kid-head h3 { margin: 0; font-size: 14px; color: var(--accent-deep); }
.kid-remove {
  border: none; background: none; padding: 4px 2px; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.add-child {
  margin-top: 10px; height: 38px; padding: 0 14px; border: 1px dashed var(--accent); border-radius: 8px;
  background: var(--paper); color: var(--accent-deep); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}

fieldset.choice { border: 0; padding: 0; margin: 20px 0 16px; min-width: 0; }
.choice .qlab { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; display: inline-flex; align-items: center; padding: 9px 13px;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); font-size: 14px; cursor: pointer;
}
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.chip:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: #3B2A8F; font-weight: 600; }

.send-row { display: flex; align-items: center; gap: 12px 16px; margin-top: 4px; }
.pill {
  flex: 0 0 auto; height: 46px; padding: 0 28px; border: none; border-radius: 23px;
  background: var(--accent); color: #FFFFFF; font: inherit; font-weight: 700; font-size: 15.5px; cursor: pointer;
}
.pill:hover:not(:disabled) { background: var(--accent-deep); }
.pill:disabled { opacity: .6; cursor: default; }
.fine { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); }
.fine a { color: var(--accent-deep); font-weight: 600; }

.error-summary { margin: 0 0 14px; padding: 12px 16px; border-radius: 8px; background: #F8E9E6; color: var(--error); }
.field-error { margin: 4px 0 0; font-size: 13px; color: var(--error); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--error); }
.has-error .chip { border-color: var(--error); }

/* ---- Booked ---- */
.done { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 26px 10px 10px; outline: none; }
.tick {
  width: 58px; height: 58px; border-radius: 50%; background: #E8F4EC; color: #1F5133;
  display: flex; align-items: center; justify-content: center;
}
.tick svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.done h2 { margin: 14px 0 0; font-size: 26px; line-height: 1.2; }
.sub { margin: 6px 0 0; font-size: 15px; color: var(--ink-soft); overflow-wrap: anywhere; }
.sum {
  width: 100%; max-width: 500px; margin-top: 20px; padding: 14px 20px;
  text-align: left; border: 1px solid var(--line); border-radius: 10px;
}
.note {
  margin: 10px 0 4px; padding: 10px 12px; border-radius: 8px; background: var(--accent-faint); border: 1px solid #E4DEFB;
  font-size: 14px; line-height: 1.5; color: #3C4460; white-space: pre-line; overflow-wrap: anywhere;
}
.btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.btns.start { justify-content: flex-start; }
.btn-o, .btn-d, .btn-danger {
  display: inline-flex; align-items: center; height: 42px; padding: 0 16px; border-radius: 8px;
  font: inherit; font-size: 14.5px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn-o { border: 1px solid var(--accent); background: var(--paper); color: var(--accent-deep); }
.btn-o:hover { background: var(--accent-faint); }
.btn-d { border: 1px solid #D2A096; background: var(--paper); color: var(--error); }
.btn-d:hover { background: #FBF1EE; }
.btn-danger { border: 1px solid var(--error); background: var(--error); color: #FFFFFF; }
.btn-danger:hover:not(:disabled) { background: #9A4637; }
.btn-o:disabled, .btn-danger:disabled { opacity: .6; cursor: default; }
.done .fine { margin-top: 16px; max-width: 500px; }

/* ---- A family's own tour (?t=) ---- */
.manage { padding: 4px 2px; outline: none; }
.manage .h { margin-bottom: 4px; }
.manage .sum { margin-top: 16px; max-width: 540px; }
.state {
  max-width: 540px; margin: 16px 0 0; padding: 12px 16px; border-radius: 10px;
  background: #F1F2F5; color: #3C4460; font-size: 15px; line-height: 1.5;
}
.state.ok { background: #E8F4EC; color: #1F5133; }
.manage .error-summary { max-width: 540px; margin: 16px 0 0; }
.panel {
  max-width: 540px; margin-top: 18px; padding: 16px 20px;
  border: 1px solid var(--line); border-radius: 10px; background: #FBFBFD;
}
.panel.move { max-width: none; margin-top: 26px; padding: 0; border: 0; border-radius: 0; background: none; }
.panel-title { margin: 0 0 10px; font-weight: 600; }
.panel .btns { margin-top: 12px; }
.link {
  margin-top: 16px; padding: 4px 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}

/* ---- When the page can't open (a dead link) ---- */
.status-card {
  max-width: 560px; margin: 40px auto; padding: 26px 28px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 14px rgba(27, 37, 69, .08);
}
.status-card p:first-child { margin: 0 0 18px; font-size: 16px; line-height: 1.55; }
.page-loading { padding: 80px 16px; text-align: center; color: var(--ink-soft); }
.page-loading .spinner {
  display: block; width: 28px; height: 28px; margin: 0 auto 14px;
  border: 3px solid var(--rule); border-top-color: var(--accent); border-radius: 50%;
  animation: kg-spin .9s linear infinite;
}
@keyframes kg-spin { to { transform: rotate(360deg); } }
.page-loading-slow { margin-top: 10px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .page-loading .spinner { animation-duration: 2.4s; } }

[hidden] { display: none !important; }
/* Honeypot: off-screen rather than display:none, which some bots detect. */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---- Narrower: the daycare on top ---- */
@media (max-width: 1000px) {
  .card { flex-direction: column; min-height: 0; max-width: 760px; }
  .left { flex: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .logo-area { min-height: 104px; padding: 16px 64px; }
  .info { padding: 18px 24px 18px; }
  .event { font-size: 25px; }
  .powered-side { display: none; }
  .powered-foot { display: flex; margin-top: 26px; }
  .right { padding: 22px 24px 20px; }
}

/* ---- Phones: the card is the screen ---- */
@media (max-width: 680px) {
  body { background: var(--paper); }
  .desk { padding: 0; }
  .card { border: 0; border-radius: 0; box-shadow: none; }
  .logo-area { min-height: 92px; padding: 14px 60px; }
  .center-logo { max-width: 104px; max-height: 52px; }
  .logo-area.wide .center-logo { max-width: 100%; max-height: 60px; }
  .info { padding: 14px 16px 16px; }
  .event { font-size: 23px; }
  .right { padding: 18px 16px 18px; }
  .grid3 { grid-template-columns: minmax(0, 1fr); }
  .kid { padding: 12px; }
  .send-row { flex-direction: column; align-items: stretch; }
  .pill { width: 100%; }
  .done { padding: 12px 0 0; }
  .btns { flex-direction: column; align-items: stretch; }
  .btn-o, .btn-d, .btn-danger { justify-content: center; }
  .status-card { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
}

/* ---- Printing the confirmation ---- */
@media print {
  body { background: #FFFFFF; }
  .desk { padding: 0; }
  .card { display: block; border: 0; box-shadow: none; max-width: none; }
  .left { border: 0; }
  .back, .btns, .powered, .link, .panel { display: none !important; }
  .done { padding: 0; }
}
