:root {
  --p27-ink: #111827;
  --p27-muted: #5b6473;
  --p27-panel: rgba(255, 255, 255, .92);
  --p27-soft: #f6f8fb;
  --p27-line: rgba(17, 24, 39, .12);
  --p27-teal: #0f766e;
  --p27-teal-strong: #0b5f59;
  --p27-amber: #b45309;
  --p27-green: #15803d;
  --p27-red: #b91c1c;
  --p27-shadow: 0 18px 45px rgba(15, 23, 42, .10);
  --p27-radius: 8px;
}

[data-theme="dark"] {
  --p27-ink: #e5edf8;
  --p27-muted: #a8b3c4;
  --p27-panel: rgba(15, 23, 42, .88);
  --p27-soft: #111827;
  --p27-line: rgba(226, 232, 240, .14);
  --p27-teal: #2dd4bf;
  --p27-teal-strong: #5eead4;
  --p27-amber: #fbbf24;
  --p27-green: #4ade80;
  --p27-red: #f87171;
  --p27-shadow: 0 18px 45px rgba(0, 0, 0, .30);
}

body.page-programme-2027 #content.container {
  max-width: 1460px;
  padding-inline: 1.25rem;
}

.p27-page {
  padding: 1rem 0 3rem;
  color: var(--p27-ink);
}

.p27-shell {
  width: 100%;
}

.p27-hero {
  position: relative;
  display: grid;
  min-height: 440px;
  overflow: hidden;
  border: 1px solid var(--p27-line);
  border-radius: var(--p27-radius);
  box-shadow: var(--p27-shadow);
  background: #101827;
}

.p27-hero__media {
  position: absolute;
  inset: 0;
}

.p27-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p27-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(5, 12, 24, .88), rgba(5, 12, 24, .54) 52%, rgba(5, 12, 24, .18));
}

.p27-hero__content {
  position: relative;
  z-index: 1;
  align-self: end;
  max-width: 820px;
  padding: 2.5rem;
  color: #fff;
}

.p27-kicker,
.p27-section-kicker,
.p27-sidebar__eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: .45rem .65rem;
  border-radius: 999px;
  background: rgba(20, 184, 166, .14);
  color: #ccfbf1;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.p27-section-kicker,
.p27-sidebar__eyebrow {
  color: var(--p27-teal);
  background: rgba(20, 184, 166, .10);
}

.p27-hero h1 {
  margin: .8rem 0 .7rem;
  font-size: 3rem;
  line-height: 1.04;
  letter-spacing: 0;
}

.p27-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, .84);
  font-size: 1.08rem;
  line-height: 1.75;
}

.p27-hero__actions,
.p27-success__actions,
.p27-submit {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  align-items: center;
  margin-top: 1.3rem;
}

.p27-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .82rem 1.05rem;
  border: 1px solid transparent;
  border-radius: var(--p27-radius);
  background: var(--p27-teal);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.p27-btn:hover {
  transform: translateY(-1px);
  background: var(--p27-teal-strong);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(15, 118, 110, .25);
}

.p27-btn:disabled {
  opacity: .68;
  cursor: wait;
  transform: none;
}

.p27-btn--secondary {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .34);
  color: #fff;
}

.p27-btn--secondary:hover {
  background: rgba(255, 255, 255, .18);
}

.p27-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  max-width: 760px;
  margin-top: 1.5rem;
}

.p27-stats div {
  padding: .9rem;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--p27-radius);
  background: rgba(255, 255, 255, .10);
}

.p27-stats strong {
  display: block;
  font-size: 1.6rem;
  line-height: 1;
}

.p27-stats span {
  display: block;
  margin-top: .25rem;
  color: rgba(255, 255, 255, .76);
  font-size: .9rem;
}

.p27-form {
  margin-top: 1.1rem;
}

.p27-layout {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.p27-sidebar {
  position: sticky;
  top: calc(var(--nav-height, 64px) + 1rem);
}

.p27-sidebar__inner,
.p27-panel,
.p27-success {
  border: 1px solid var(--p27-line);
  border-radius: var(--p27-radius);
  background: var(--p27-panel);
  box-shadow: var(--p27-shadow);
}

.p27-sidebar__inner {
  padding: 1rem;
}

.p27-sidebar__count {
  display: block;
  margin-top: .9rem;
  font-size: 1.6rem;
}

.p27-sidebar p {
  color: var(--p27-muted);
  line-height: 1.6;
}

.p27-levels {
  display: grid;
  gap: .45rem;
  margin-top: 1rem;
}

.p27-levels span {
  display: block;
  padding: .55rem .65rem;
  border: 1px solid var(--p27-line);
  border-left: 4px solid var(--p27-teal);
  border-radius: var(--p27-radius);
  color: var(--p27-muted);
  font-size: .9rem;
  font-weight: 700;
}

.p27-main {
  display: grid;
  gap: 1rem;
}

.p27-panel {
  padding: 1.15rem;
}

.p27-section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.p27-section-head h2 {
  margin: .45rem 0 0;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.p27-live-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: .45rem .7rem;
  border-radius: 999px;
  background: rgba(180, 83, 9, .11);
  color: var(--p27-amber);
  font-size: .86rem;
  font-weight: 800;
}

.p27-formgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
}

.p27-formgrid--address {
  margin-top: .9rem;
}

.p27-field,
.p27-card__details label {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.p27-field--wide {
  grid-column: span 2;
}

.p27-field label,
.p27-card__details span,
.p27-address summary {
  color: var(--p27-ink);
  font-weight: 800;
}

.p27-input {
  width: 100%;
  min-height: 46px;
  padding: .78rem .85rem;
  border: 1px solid var(--p27-line);
  border-radius: var(--p27-radius);
  background: rgba(255, 255, 255, .88);
  color: var(--p27-ink);
  font: inherit;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

[data-theme="dark"] .p27-input {
  background: rgba(17, 24, 39, .78);
}

.p27-textarea {
  min-height: 130px;
  resize: vertical;
}

.p27-input:focus {
  border-color: rgba(15, 118, 110, .55);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .13);
}

.p27-address {
  margin-top: 1rem;
  border-top: 1px solid var(--p27-line);
  padding-top: .9rem;
}

.p27-address summary {
  cursor: pointer;
}

.p27-selection-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: .85rem;
  border: 1px solid var(--p27-line);
  border-radius: var(--p27-radius);
  background: var(--p27-soft);
  margin-bottom: .95rem;
}

.p27-selection-bar span,
.p27-selection-bar p {
  color: var(--p27-muted);
}

.p27-selection-bar strong {
  display: block;
  margin-top: .2rem;
  font-size: 1.2rem;
}

.p27-selection-bar p {
  margin: 0;
}

.p27-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
}

.p27-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .8rem;
  padding: .95rem;
  border: 1px solid var(--p27-line);
  border-radius: var(--p27-radius);
  background: rgba(255, 255, 255, .72);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

[data-theme="dark"] .p27-card {
  background: rgba(17, 24, 39, .70);
}

.p27-card.is-selected {
  border-color: rgba(15, 118, 110, .58);
  box-shadow: 0 12px 34px rgba(15, 118, 110, .14);
}

.p27-card__check {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  width: fit-content;
  cursor: pointer;
  color: var(--p27-ink);
}

.p27-card__check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.p27-card__check span {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(15, 118, 110, .50);
  border-radius: 6px;
  background: #fff;
  box-shadow: inset 0 0 0 3px #fff;
}

.p27-card__check input:checked + span {
  background: var(--p27-teal);
}

.p27-card__top {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.p27-month,
.p27-duration,
.p27-ref-link {
  display: inline-flex;
  width: fit-content;
  padding: .35rem .55rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 800;
}

.p27-month {
  background: rgba(15, 118, 110, .11);
  color: var(--p27-teal);
}

.p27-duration {
  background: rgba(180, 83, 9, .10);
  color: var(--p27-amber);
}

.p27-card h3 {
  margin: .7rem 0 .25rem;
  font-size: 1.18rem;
  line-height: 1.25;
}

.p27-card p {
  margin: 0;
  color: var(--p27-muted);
  line-height: 1.55;
}

.p27-ref-link {
  margin-top: .75rem;
  background: rgba(21, 128, 61, .10);
  color: var(--p27-green);
  text-decoration: none;
}

.p27-card__details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  padding-top: .8rem;
  border-top: 1px solid var(--p27-line);
}

.p27-card__precision {
  grid-column: 1 / -1;
}

.p27-consents {
  display: grid;
  gap: .75rem;
  margin-top: 1rem;
}

.p27-consent {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  padding: .85rem;
  border: 1px solid var(--p27-line);
  border-radius: var(--p27-radius);
  background: var(--p27-soft);
  font-weight: 700;
  line-height: 1.5;
}

.p27-consent input {
  margin-top: .22rem;
}

.p27-submit p {
  margin: 0;
  color: var(--p27-muted);
  line-height: 1.55;
}

.p27-field-error,
.p27-error {
  color: var(--p27-red);
  font-size: .92rem;
  font-weight: 800;
}

.p27-field-error--block,
.p27-errors {
  margin-bottom: .9rem;
}

.p27-success {
  max-width: 820px;
  margin: 2rem auto;
  padding: 2rem;
}

.p27-success .p27-kicker {
  color: var(--p27-teal);
}

.p27-success h1 {
  margin: .8rem 0 .6rem;
  font-size: 2rem;
}

.p27-success p {
  color: var(--p27-muted);
  line-height: 1.75;
}

.p27-success .p27-btn--secondary {
  border-color: var(--p27-line);
  background: transparent;
  color: var(--p27-ink);
}

@media (max-width: 1100px) {
  .p27-layout {
    grid-template-columns: 1fr;
  }

  .p27-sidebar {
    position: static;
  }

  .p27-formgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  body.page-programme-2027 #content.container {
    padding-inline: .85rem;
  }

  .p27-hero {
    min-height: 520px;
  }

  .p27-hero__media::after {
    background: linear-gradient(180deg, rgba(5, 12, 24, .38), rgba(5, 12, 24, .90));
  }

  .p27-hero__content {
    padding: 1.2rem;
  }

  .p27-hero h1 {
    font-size: 2.15rem;
  }

  .p27-stats,
  .p27-cards,
  .p27-card__details {
    grid-template-columns: 1fr;
  }

  .p27-formgrid {
    grid-template-columns: 1fr;
  }

  .p27-field--wide {
    grid-column: auto;
  }

  .p27-section-head,
  .p27-selection-bar {
    flex-direction: column;
    align-items: stretch;
  }
}
