/* ============================================================
   Applied Intelligence — Training Courses
   Listing + detail/booking page styles (extends common.css)
   ============================================================ */

/* ——— Page intro ——— */
.courses-intro { max-width: 70ch; color: var(--ink-soft); margin-bottom: 8px; }

/* ——— Listing: course cards ——— */
.course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 48px;
}
.course-card {
  background: var(--bg-white);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  transition: border-color .15s, box-shadow .15s;
}
.course-card:hover {
  border-color: var(--ember);
  box-shadow: 0 6px 24px rgba(26,26,24,0.06);
}
.course-card-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ember);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.course-card-title {
  margin-top: 10px;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  transition: color .15s;
}
.course-card-title:hover { color: var(--ember); }
.course-card p.course-desc {
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.65;
  flex: 1;
}
.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.course-price-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
.course-price-from {
  font-size: 11px;
  color: var(--ink-mute);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 2px;
}
.course-price { font-size: 22px; font-weight: 600; }
.course-price.has-discount { display: flex; align-items: baseline; gap: 8px; }
.course-card-cta {
  color: var(--ember);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
}
.course-card-cta:hover { color: var(--ember-h); }

/* ——— Price with discount (shared: card + booking panel) ——— */
.price-was {
  font-size: 0.6em;
  font-weight: 400;
  color: var(--ink-mute);
  text-decoration: line-through;
}
.price-now { color: var(--ember); }
.price-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 9px;
  border-radius: 5px;
  background: var(--ember-lt);
  color: var(--ember-h);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

@media (max-width: 980px) {
  .course-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .course-grid { grid-template-columns: 1fr; }
}

/* ——— Detail view ——— */
#detail[hidden], #listing[hidden] { display: none; }

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-mute);
  cursor: pointer;
  transition: color .15s;
  margin-bottom: 28px;
}
.detail-back:hover { color: var(--ember); }
#detail .detail-back { grid-column: 1 / -1; }

.detail-label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ember);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}
.detail-head h1 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.01em;
  max-width: 26ch;
}
.detail-sub {
  margin-top: 18px;
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 68ch;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: clamp(40px, 6vw, 64px);
  margin-top: 0;
  align-items: start;
}

.detail-body h3 {
  font-size: 13px;
  font-family: var(--mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-mute);
  margin-top: 36px;
  margin-bottom: 16px;
}
.detail-body > h3:first-child { margin-top: 0; }
.detail-body > .detail-copy {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.75;
}
.detail-copy p + p { margin-top: 14px; }

.detail-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.detail-list li {
  position: relative;
  padding-left: 24px;
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.detail-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 9px;
  height: 9px;
  background: var(--ember);
  border-radius: 2px;
}

.detail-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  margin-top: 8px;
}
.detail-facts .fl {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.detail-facts .fv { font-size: 15px; margin-top: 3px; }

/* ——— Booking panel (sticky sidebar) ——— */
.booking-panel {
  background: var(--bg-white);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 28px;
  position: sticky;
  top: 88px;
}
.bp-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.bp-price { font-size: 30px; font-weight: 600; }
.bp-price.has-discount { display: flex; align-items: baseline; gap: 10px; }
.bp-price-note {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bp-note {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-mute);
}
.bp-divider { border-top: 1px solid var(--rule); margin: 22px 0; }

.bp-step-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}

.date-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.date-opt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bg);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.date-opt:hover { border-color: var(--ember); }
.date-opt.selected {
  border-color: var(--ember);
  background: var(--ember-lt);
}
/* Now a div with role="button" rather than a real <button>, so the browser's
   default focus ring no longer applies automatically — this replaces it. */
.date-opt[role="button"]:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}
.date-opt .do-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.date-opt .do-date { font-weight: 500; }
.date-opt .do-venue { font-size: 11.5px; color: var(--ink-mute); }
.date-opt .do-spaces { font-size: 11px; color: var(--ink-mute); font-family: var(--mono); text-transform: uppercase; white-space: nowrap; }
/* Status line on a full date — ember rather than red: it's information, not an error,
   and on a "check tomorrow" date it's close to good news. */
.date-opt .do-note {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--ember);
  margin-top: 3px;
}
.date-opt .do-waitlist {
  align-self: flex-start;
  margin-top: 5px;
  padding: 0;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--ember);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.date-opt .do-waitlist:hover { color: var(--ember-h); }
/* Shares the waitlist link's shape deliberately — both are secondary actions
   living inside the card rather than the card's own click target. */
.date-opt .do-directions {
  align-self: flex-start;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--ember);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.date-opt .do-directions:hover { color: var(--ember-h); }
/* A full date stays visible — seeing that a course sells out is useful information,
   and it's what the waiting-list prompt hangs off. It just isn't selectable. Kept at
   full opacity rather than dimmed, because the "join waiting list" button inside it
   is a live control and must not look disabled. */
.date-opt.full {
  background: var(--bg-soft);
  /* Not itself clickable — no role="button" was set for a sold-out card — but its
     children (directions link, waitlist button) are, so the card can't blanket
     the whole area with cursor:default without visually fighting them. */
  cursor: default;
}
.date-opt.full .do-directions,
.date-opt.full .do-waitlist { cursor: pointer; }
.date-opt.full .do-date,
.date-opt.full .do-venue { color: var(--ink-mute); }

.bp-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.bp-form input, .bp-form select {
  font: inherit;
  font-size: 14px;
  padding: 11px 13px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--bg);
  outline: none;
  transition: border-color .15s, background .15s;
  width: 100%;
}
.bp-form input:focus, .bp-form select:focus {
  border-color: var(--ember);
  background: #fff;
}
.bp-form label {
  display: flex;
  flex-direction: column;
  font-size: 12.5px;
  font-weight: 500;
  gap: 5px;
}

.bp-submit {
  margin-top: 6px;
  width: 100%;
  background: var(--ember);
  color: #fff;
  padding: 13px 20px;
  border-radius: 7px;
  font-weight: 500;
  font-size: 15px;
  text-align: center;
  transition: background .15s;
}
.bp-submit:hover { background: var(--ember-h); }
.bp-submit:disabled { background: var(--ink-mute); cursor: default; }

.bp-fine {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--ink-mute);
  line-height: 1.5;
}

/* Payment step */
.pay-card-row { display: grid; grid-template-columns: 1fr 90px 90px; gap: 10px; }

.pay-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--ink-mute);
  font-size: 12px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pay-divider::before, .pay-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.pp-btn {
  width: 100%;
  background: #ffc439;
  color: #003087;
  padding: 13px 20px;
  border-radius: 24px;
  font-weight: 700;
  font-style: italic;
  font-size: 16px;
  text-align: center;
  transition: background .15s;
}
.pp-btn:hover { background: #f2b52e; }
.pp-btn .pp-pal { color: #009cde; }
.pay-success {
  text-align: center;
  padding: 20px 4px 6px;
}
.pay-success .success-mark {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ember-lt);
  color: var(--ember);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.pay-success h4 { font-size: 16px; font-weight: 500; margin-top: 14px; }
.pay-success p { font-size: 13px; color: var(--ink-soft); margin-top: 6px; line-height: 1.5; }

/* ——— Stripe Elements ——— */
#card-element {
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fff;
  margin-top: 10px;
  margin-bottom: 4px;
}
#card-element.StripeElement--focus {
  border-color: var(--ember);
  box-shadow: 0 0 0 2px rgba(212,105,26,0.12);
}
#card-element.StripeElement--invalid {
  border-color: #c00;
}
/* Net / VAT / total, shown above the card field. The advertised price is ex VAT,
   so the total has to be visible before any card details are entered. */
.pay-breakdown {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--bg-alt);
}
.pb-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  color: var(--ink-soft);
  padding: 3px 0;
}
.pb-row.pb-total {
  margin-top: 6px;
  padding-top: 9px;
  border-top: 1px solid var(--rule);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}

.success-ref {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ember-h);
}

.card-error {
  font-size: 12.5px;
  color: #c00;
  margin-bottom: 12px;
  min-height: 18px;
}

/* ——— Inline field validation ———
   The message sits under the field it refers to and the field itself is marked,
   so it's obvious what to fix without dismissing anything first. */
.field-error {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #c00;
}
.bp-form input.is-invalid,
.ai-field input.is-invalid,
.ai-field select.is-invalid {
  border-color: #c00;
  background: #fff8f7;
}
.bp-form input.is-invalid:focus,
.ai-field input.is-invalid:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.12);
}

/* ——— Dialog ——— */
.ai-dialog {
  border: 0;
  padding: 0;
  border-radius: 12px;
  background: transparent;
  max-width: 460px;
  width: calc(100% - 32px);
}
.ai-dialog::backdrop { background: rgba(26, 26, 24, 0.45); }
.ai-dialog-inner {
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 18px 48px rgba(26, 26, 24, 0.18);
}
.ai-dialog-title { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.ai-dialog-sub {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-mute);
  margin-bottom: 18px;
}
.ai-dialog-body { display: flex; flex-direction: column; gap: 13px; }
.ai-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.ai-field-label { color: var(--ink-soft); font-weight: 500; }
.ai-field-opt { color: var(--ink-mute); font-weight: 400; }
.ai-field input,
.ai-field select {
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--bg-white);
  color: var(--ink);
  width: 100%;
}
.ai-field input:focus,
.ai-field select:focus {
  outline: none;
  border-color: var(--ember);
  box-shadow: 0 0 0 2px rgba(196, 81, 10, 0.12);
}
.ai-dialog-success {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border-radius: 7px;
  padding: 10px 12px;
}
.ai-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}
.ai-dialog-note {
  font-size: 11.5px;
  color: var(--ink-mute);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-dialog-actions { display: flex; gap: 10px; flex-shrink: 0; }
.ai-btn,
.ai-btn-ghost {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 7px;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.ai-btn { background: var(--ember); color: #fff; }
.ai-btn:hover { background: var(--ember-h); }
.ai-btn:disabled { background: var(--ink-mute); cursor: default; }
.ai-btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--rule); }
.ai-btn-ghost:hover { border-color: var(--ink-mute); background: var(--bg-soft); }

@media (max-width: 460px) {
  .ai-dialog-foot { flex-direction: column; align-items: stretch; }
  .ai-dialog-actions { justify-content: flex-end; }
}
/* Reassurance after a declined card — deliberately not red: the payment failed
   but the place is still there, and that shouldn't read as a second error. */
.card-hold-note {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border-radius: 7px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .booking-panel { position: static; }
}
