/* KYP Outreach Advice Bookings
   Same layout as the original booking pages (soft gradient background, rounded white cards,
   grey slot rows with pill buttons), rebranded in KYP green with Plus Jakarta Sans.
   Booking happens on its own page rather than a pop-up, so it works with the browser zoomed in. */

:root {
  --bg-page: radial-gradient(circle at top left, #DFF3E7 0, #F7FAF8 45%, #E6EBE8 100%);
  --card-bg: rgba(255, 255, 255, 0.98);
  --green: #009E49;            /* KYP brand green */
  --green-dark: #007A38;       /* buttons with white text */
  --green-deep: #0B3D24;       /* dark pill buttons (the original used near-black) */
  --green-soft: #E6F5EE;
  --green-line: rgba(0, 158, 73, 0.32);
  --text: #0F1A14;
  --muted: #5C6B63;
  --border: #E2E8E4;
  --slot-grey: #F2F5F3;
  --booked-bg: #FFF7E6;
  --booked-border: #F2C46B;
  --booked-text: #7A4D00;
  --break-bg: #F4F1EA;
  --break-border: #D9D2C1;
  --danger: #B42318;
  --danger-dark: #8F1B12;
  --focus: #FFBF47;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
html[data-size="2"] { font-size: 125%; }
html[data-size="3"] { font-size: 143.75%; }
* { box-sizing: border-box; font-family: var(--font); }
body { margin: 0; background: var(--bg-page); background-attachment: fixed; min-height: 100vh; color: var(--text); line-height: 1.5; display: flex; flex-direction: column; }
main { flex: 1; outline: none; }
main:focus, main:focus-visible { outline: none; box-shadow: none; }
a { color: var(--green-dark); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.2; }
p { margin: 0 0 1rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px var(--text); border-radius: 6px; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--focus); color: var(--text); padding: .6rem 1rem; z-index: 100; font-weight: 700; }
.skip-link:focus { left: 1rem; top: 1rem; }
.page-wrapper { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.loading { padding: 4rem 0; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }

/* ---------- KYP top bar ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--border); box-shadow: 0 2px 14px rgba(11, 61, 36, .06); }
.topbar::before { content: ""; display: block; height: 5px; background: var(--green); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: .7rem; padding-bottom: .7rem; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); }
.brand-logo { height: 48px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; font-weight: 800; font-size: 1.05rem; line-height: 1.15; padding-left: 14px; border-left: 1px solid var(--border); }
.brand-text span { font-weight: 500; font-size: .8rem; color: var(--muted); }
.topbar-tools { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.text-size { display: flex; align-items: center; gap: .3rem; }
.text-size-label { font-size: .8rem; color: var(--muted); margin-right: .2rem; }
.text-size button { font-weight: 800; border: 1px solid #CBD5CF; background: #F9FBFA; color: var(--text); border-radius: 999px; min-width: 2.3rem; height: 2.3rem; cursor: pointer; line-height: 1; }
.text-size button[data-size="1"] { font-size: .8rem; }
.text-size button[data-size="2"] { font-size: 1rem; }
.text-size button[data-size="3"] { font-size: 1.22rem; }
.text-size button[aria-pressed="true"] { background: var(--green-deep); color: #fff; border-color: var(--green-deep); }
.who { display: flex; align-items: center; gap: .7rem; font-size: .88rem; color: var(--muted); }
.who:empty { display: none; }
.who strong { color: var(--text); }

/* ---------- Buttons (pill shapes, as the original) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: .65rem 1.25rem; min-height: 2.9rem; border-radius: 999px; border: 1px solid transparent; font-size: .95rem; font-weight: 700; cursor: pointer; text-decoration: none; line-height: 1.2; transition: background .15s, box-shadow .15s, transform .05s, border-color .15s; }
.btn:active { transform: translateY(1px); box-shadow: none !important; }
.btn-dark { background: var(--green-deep); color: #F7FAF8; }
.btn-dark:hover { background: #072B19; color: #fff; box-shadow: 0 8px 18px rgba(11, 61, 36, .3); }
.btn-primary { background: var(--green-dark); color: #fff; }
.btn-primary:hover { background: #00652E; color: #fff; box-shadow: 0 8px 18px rgba(0, 122, 56, .3); }
.btn-secondary { background: #F9FBFA; color: var(--text); border-color: #CBD5CF; }
.btn-secondary:hover { background: var(--green-soft); border-color: var(--green); box-shadow: 0 8px 18px rgba(0, 158, 73, .18); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-dark); color: #fff; box-shadow: 0 8px 16px rgba(180, 35, 24, .3); }
.btn-sm { min-height: 2.5rem; padding: .45rem 1.05rem; font-size: .88rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin: 1.4rem 0 0; font-weight: 700; color: var(--green-dark); background: none; border: 0; padding: .3rem 0; cursor: pointer; font-size: .95rem; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Page header (h1 + subtitle + tags) ---------- */
.page-head { margin-top: 1.8rem; }
.page-head h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.04em; }
.subtitle { font-size: .95rem; color: var(--muted); margin-top: .3rem; }
.header-tags { margin-top: .7rem; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 6px 11px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); border: 1px solid var(--green-line); }
.tag-outline { background: #F3F5F4; color: var(--text); border-color: var(--border); }

/* ---------- Cards ---------- */
.card { margin-top: 1.6rem; padding: 1.4rem 1.4rem 1.5rem; background: var(--card-bg); border-radius: 24px; border: 1px solid var(--border); box-shadow: 0 24px 55px rgba(11, 61, 36, .13); }
.card h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: .2rem; }
.card-header-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.card-header-row p { margin: 0; font-size: .9rem; color: var(--muted); }
.session-count { font-size: .82rem; color: var(--muted); font-weight: 600; }

/* ---------- Home: venues ---------- */
.home-card { margin-top: 2rem; padding: 1.7rem 1.6rem 1.8rem; border-radius: 26px; }
.home-card h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; }
.home-card .subtitle { max-width: 36rem; }
.venues { margin-top: 1.2rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 14px; list-style: none; padding: 0; }
.venue-card { border-radius: 18px; border: 1px solid var(--border); padding: 1.1rem 1rem 1rem; background: #F7FAF8; display: flex; flex-direction: column; gap: 4px; height: 100%; border-top: 4px solid var(--green); }
.venue-name { font-size: 1.05rem; font-weight: 800; }
.venue-area { font-size: .82rem; color: var(--muted); font-weight: 600; }
.venue-meta { font-size: .86rem; color: var(--muted); margin-top: .2rem; }
.venue-next { font-size: .84rem; margin-top: .1rem; }
.venue-next b { color: var(--green-dark); }
.venue-card .btn { margin-top: auto; align-self: flex-start; }
.venue-card .btn-spacer { flex: 1; min-height: .7rem; }

/* ---------- Sign in ---------- */
.signin { max-width: 32rem; margin: 0 auto; }
.signin .card { margin-top: 1rem; }

/* ---------- Session navigation (Previous / date / Next) ---------- */
.session-header { margin-top: 1.5rem; padding: 1rem 1.4rem; background: var(--card-bg); border-radius: 22px; box-shadow: 0 18px 45px rgba(11, 61, 36, .14); border: 1px solid var(--border); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; }
.session-center { text-align: center; }
.session-date { font-size: 1.15rem; font-weight: 800; }
.session-meta { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.session-meta b { color: var(--green-dark); }
.session-meta .is-closed { color: var(--booked-text); }
.today-tag { display: inline-block; margin-left: .4rem; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; background: var(--green); color: #fff; padding: .1rem .45rem; border-radius: 999px; vertical-align: 3px; }
.session-jump { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }

/* ---------- Slots ---------- */
.slots-list { margin-top: 1.1rem; display: flex; flex-direction: column; gap: 8px; list-style: none; padding: 0; }
.slot-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .8rem; padding: .8rem 1.1rem; background: var(--slot-grey); border-radius: 14px; border: 1px solid var(--border); }
.slot-time { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.slot-main { font-weight: 800; font-size: 1rem; }
.slot-sub { font-size: .82rem; color: var(--muted); font-weight: 600; }
.slot-sub.free { color: var(--green-dark); }
.slot-row.booked { background: var(--booked-bg); border-color: var(--booked-border); }
.slot-row.booked .slot-sub { color: var(--booked-text); }
.slot-name { font-weight: 800; font-size: 1rem; color: var(--text); }
.slot-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.mini { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #fff; color: var(--booked-text); border: 1px solid var(--booked-border); }
.slot-row.break { background: var(--break-bg); border-color: var(--break-border); }
.slot-row.break .slot-sub { color: #6B5A2E; }
.slot-row.past { opacity: .6; }
.slot-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.slot-details { grid-column: 1 / -1; background: #fff; border: 1px solid var(--booked-border); border-radius: 14px; padding: 1rem 1.1rem; }
.details-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .35rem 1.2rem; margin: 0 0 1rem; font-size: .93rem; }
.details-list dt { font-weight: 700; }
.details-list dd { margin: 0; overflow-wrap: anywhere; }
.confirm-box { border: 2px solid var(--danger); background: #FDECEA; border-radius: 14px; padding: .9rem 1rem; margin-top: .4rem; }
.confirm-box p { font-weight: 700; color: #7A1610; }
.closed-box { margin-top: 1.1rem; padding: 2rem 1rem; text-align: center; background: var(--break-bg); border: 1px dashed var(--break-border); border-radius: 14px; }
.closed-box h3 { font-size: 1.15rem; margin-bottom: .3rem; }

/* ---------- Booking page (styled like the original booking pop-up) ---------- */
.booking-card { max-width: 46rem; margin: 1rem auto 0; padding: 0; overflow: hidden; }
.booking-head { padding: 1.2rem 1.5rem 1rem; border-bottom: 1px solid var(--border); }
.booking-head h1 { font-size: 1.35rem; font-weight: 800; }
.booking-head p { margin: .3rem 0 0; font-size: .9rem; color: var(--muted); }
.booking-body { padding: 1.2rem 1.5rem .5rem; }
.pill { font-size: .95rem; padding: .7rem .9rem; border-radius: 12px; background: var(--green-soft); color: #0B4D2A; border: 1px solid var(--green-line); margin-bottom: 1.3rem; }
.section-title { font-size: 1.05rem; font-weight: 800; margin: .4rem 0 .7rem; }
.duration-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 14px; margin-bottom: 1.4rem; }
.duration-card { position: relative; cursor: pointer; display: block; }
.duration-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.duration-body { display: flex; flex-direction: column; height: 100%; padding: 1rem 1.1rem; border-radius: 16px; border: 1px solid var(--border); background: #F7FAF8; }
.duration-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.duration-main { font-size: 1.4rem; font-weight: 800; margin-top: 2px; }
.duration-note { font-size: .86rem; color: var(--muted); margin-top: .35rem; }
.duration-pick { margin-top: .8rem; align-self: flex-start; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: .45rem .9rem; border-radius: 999px; background: var(--green-deep); color: #fff; }
.duration-card input:checked + .duration-body { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 2px var(--green-line); }
.duration-card input:checked + .duration-body .duration-pick { background: var(--green); }
.duration-card input:checked + .duration-body .duration-pick::before { content: "✓ "; }
.duration-card input:focus-visible + .duration-body { outline: 3px solid var(--focus); outline-offset: 2px; }
.duration-card input:disabled + .duration-body { opacity: .55; cursor: not-allowed; }
.duration-card input:disabled + .duration-body .duration-pick { background: #9AA59F; }
.warning-text { font-size: .82rem; color: var(--danger); margin: -.6rem 0 1.3rem; }
.form-grid { display: grid; gap: 1rem; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1rem; }
.form-row { display: flex; flex-direction: column; gap: 4px; }
.form-row > label, .form-row > .label { font-weight: 700; font-size: .95rem; }
.hint { color: var(--muted); font-size: .84rem; }
.input, .textarea { width: 100%; border-radius: 10px; border: 1.5px solid #9AA59F; padding: .65rem .8rem; font-size: 1rem; background: #F9FBFA; color: var(--text); min-height: 2.9rem; }
.input:focus, .textarea:focus { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--text); background: #fff; }
.textarea { min-height: 5.5rem; resize: vertical; }
.input-error { border-color: var(--danger); }
.field-error { color: var(--danger); font-weight: 700; font-size: .9rem; }
.form-row.has-error { border-left: 4px solid var(--danger); padding-left: .8rem; }
.check { display: flex; align-items: flex-start; gap: .6rem; cursor: pointer; font-size: .92rem; padding: .2rem 0; }
.check input { width: 1.4rem; height: 1.4rem; margin: 0; accent-color: var(--green); flex-shrink: 0; cursor: pointer; }
.check small { display: block; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-flex; align-items: center; min-height: 2.5rem; padding: .4rem .95rem; border-radius: 999px; border: 1px solid #CBD5CF; background: #F9FBFA; font-size: .9rem; font-weight: 600; }
.chip input:checked + span { background: var(--green-soft); border-color: var(--green); color: #0B4D2A; box-shadow: 0 0 0 1px var(--green); }
.chip input:checked + span::before { content: "✓"; margin-right: .4rem; color: var(--green-dark); font-weight: 800; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.dob { display: flex; gap: .7rem; }
.dob label { font-size: .82rem; font-weight: 600; display: block; margin-bottom: .2rem; }
.dob .input { width: 4.2rem; text-align: center; }
.dob .dob-year .input { width: 5.8rem; }
.password-wrap { display: flex; gap: .5rem; }
.password-wrap .input { flex: 1; min-width: 0; }
.booking-foot { padding: .9rem 1.5rem 1.3rem; border-top: 1px solid var(--border); margin-top: 1.2rem; display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
.notice { border-radius: 14px; padding: .85rem 1rem; margin: 0 0 1.1rem; border: 1px solid; font-size: .93rem; }
.notice p:last-child { margin: 0; }
.notice-info { background: var(--green-soft); border-color: var(--green-line); color: #0B4D2A; }
.notice-warn { background: var(--booked-bg); border-color: var(--booked-border); color: var(--booked-text); }
.notice-error { background: #FDECEA; border-color: #F3B8B2; color: #7A1610; }
.error-summary { border: 2px solid var(--danger); border-radius: 14px; padding: .9rem 1.1rem; margin-bottom: 1.2rem; background: #fff; }
.error-summary h2 { font-size: 1.05rem; color: var(--danger); margin-bottom: .35rem; }
.error-summary ul { margin: 0; padding-left: 1.2rem; }
.error-summary a { color: var(--danger); font-weight: 700; }

/* ---------- Booked confirmation ---------- */
.done-card { max-width: 40rem; margin: 2rem auto 0; text-align: center; }
.done-tick { width: 3.6rem; height: 3.6rem; border-radius: 50%; margin: 0 auto .8rem; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 60% no-repeat; }
.done-card h1 { font-size: 1.6rem; font-weight: 800; }
.done-card .pill { text-align: left; margin: 1.1rem 0; }
.done-card ul { text-align: left; margin: 0 0 1.3rem; padding-left: 1.2rem; font-size: .93rem; color: var(--muted); }
.done-card .btn-row { justify-content: center; }

/* ---------- Footer / toast ---------- */
.footer { margin-top: 2.5rem; padding-bottom: 2.5rem; font-size: .82rem; color: var(--muted); }
.footer p { margin: 0; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--green-deep); color: #F7FAF8; padding: .6rem 1.1rem; border-radius: 999px; font-size: .92rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; box-shadow: 0 10px 25px rgba(11, 61, 36, .4); max-width: calc(100% - 2rem); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Narrow screens / heavy zoom ---------- */
@media (max-width: 760px) {
  .page-head h1 { font-size: 1.6rem; }
  .brand-logo { height: 38px; }
  .brand-text span, .text-size-label { display: none; }
  .topbar-tools { width: 100%; justify-content: space-between; gap: .5rem; }
  .who > span { display: none; }
  .session-header { grid-template-columns: 1fr 1fr; }
  .session-center { grid-column: 1 / -1; grid-row: 1; }
  .session-header .next { justify-self: end; }
  .slot-row { grid-template-columns: 1fr; }
  .slot-actions { justify-content: flex-start; }
  .details-list { grid-template-columns: 1fr; gap: 0; }
  .details-list dd { margin-bottom: .5rem; }
  .booking-head, .booking-body, .booking-foot { padding-left: 1rem; padding-right: 1rem; }
  .card { padding: 1.1rem; border-radius: 20px; }
}

/* ---------- Printing ---------- */
.print-area { display: none; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 11pt; }
  .topbar, .footer, main, .toast, .skip-link { display: none !important; }
  .print-area { display: block !important; }
  .print-area h1 { font-size: 18pt; margin: 0 0 4pt; }
  .print-area .p-sub { color: #444; margin-bottom: 12pt; }
  .print-area table { width: 100%; border-collapse: collapse; }
  .print-area th, .print-area td { border: 1px solid #888; padding: 5pt 6pt; text-align: left; vertical-align: top; font-size: 10pt; }
  .print-area th { background: #E6F5EE !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-area .p-logo { height: 44px; margin-bottom: 10pt; }
  .slip { border: 2px solid #009E49; border-radius: 12px; padding: 16pt 18pt; max-width: 150mm; }
  .slip h1 { color: #007A38; }
  .slip .big { font-size: 16pt; font-weight: 800; margin: 6pt 0; }
  .slip ul { margin: 4pt 0 10pt; padding-left: 14pt; }
}
