/**
 * Exact app CSS from Onboarding Demo.html (DED-3746), plus fluid scaling
 * so the shell fills the viewport instead of pinning content to the left.
 */

.programme-onboarding,
.programme-onboarding * {
  box-sizing: border-box;
}

/* Fill the SPA mount — avoid left-corner strip on wide viewports */
html:has(.programme-onboarding),
html:has(.programme-onboarding-shell),
body:has(.programme-onboarding),
body:has(.programme-onboarding-shell),
#spa-root:has(.programme-onboarding),
#spa-root:has(.programme-onboarding-shell) {
  margin: 0;
  width: 100%;
  min-height: 100%;
  height: 100%;
}

/* Shell: main column + RH help/Harold push panel (DED-3746) */
.programme-onboarding-shell {
  --po-nav-height: 38px;
  --po-bar-height: 52px;
  --po-side-title-padding-top: 15px;
  --po-side-title-padding-bottom: 11px;
  --po-side-title-text-size: 10.5px;
  --po-side-title-line-height: 1.2;
  --po-side-title-height: calc(
    var(--po-side-title-padding-top) + var(--po-side-title-padding-bottom) +
      var(--po-side-title-text-size) * var(--po-side-title-line-height)
  );
  /* Main po-header height; po-help-head matches this row (tabs sit below) */
  --po-header-height: calc(var(--po-nav-height) * 2);
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

.programme-onboarding-shell__main {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

.programme-onboarding-shell__main > .programme-onboarding {
  flex: 1;
  width: 100%;
  min-width: 0;
}

/* When Harold/help panel is open, tighten the in-flow side rail */
html[data-help-sidebar-open] .programme-onboarding .step-side {
  flex-basis: clamp(220px, 24vw, 320px);
  width: clamp(220px, 24vw, 320px);
  max-width: 32%;
}

html[data-help-sidebar-open] .programme-onboarding .step-side--welcome,
html[data-help-sidebar-open] .programme-onboarding .step-side--trial {
  flex-basis: clamp(240px, 26vw, 340px);
  width: clamp(240px, 26vw, 340px);
  max-width: 34%;
}

/* Programme help sidebar — compact chrome matching step-side (DED-3746) */
html[data-help-sidebar-open]:has(.programme-onboarding-shell) {
  --help-sidebar-push-width: clamp(280px, 30vw, 360px);
  --po-nav-height: 38px;
  --po-bar-height: 52px;
  --po-side-title-padding-top: 15px;
  --po-side-title-padding-bottom: 11px;
  --po-side-title-text-size: 10.5px;
  --po-side-title-line-height: 1.2;
  --po-side-title-height: calc(
    var(--po-side-title-padding-top) + var(--po-side-title-padding-bottom) +
      var(--po-side-title-text-size) * var(--po-side-title-line-height)
  );
  --po-header-height: calc(var(--po-nav-height) * 2);
}

html:has(.programme-onboarding-shell) {
  --po-nav-height: 38px;
  --po-bar-height: 52px;
  --po-side-title-padding-top: 15px;
  --po-side-title-padding-bottom: 11px;
  --po-side-title-text-size: 10.5px;
  --po-side-title-line-height: 1.2;
  --po-side-title-height: calc(
    var(--po-side-title-padding-top) + var(--po-side-title-padding-bottom) +
      var(--po-side-title-text-size) * var(--po-side-title-line-height)
  );
  --po-header-height: calc(var(--po-nav-height) * 2);
}

.programme-onboarding-shell .help-sidebar-content--programme {
  background: #faf3e9;
  color: #3a2e22;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.programme-onboarding-shell .po-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--po-header-height);
  min-height: var(--po-header-height);
  max-height: var(--po-header-height);
  padding: 0 13px;
  border-bottom: 1px solid #f0e4d4;
  background: #fffdfa;
  flex: none;
  box-sizing: border-box;
}

.programme-onboarding-shell .po-help-head__title {
  font: 600 10.5px 'Inter', sans-serif;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #a8967f;
}

.programme-onboarding-shell .po-help-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #a8967f;
  cursor: pointer;
}

.programme-onboarding-shell .po-help-close:hover {
  background: #f0e4d4;
  color: #3a2e22;
}

.programme-onboarding-shell .po-help-top {
  display: flex;
  flex-direction: column;
  flex: none;
  box-sizing: border-box;
}

.programme-onboarding-shell .po-help-tabs {
  display: flex;
  gap: 0;
  align-items: center;
  height: var(--po-side-title-height);
  min-height: var(--po-side-title-height);
  max-height: var(--po-side-title-height);
  border-bottom: 1px solid #f0e4d4;
  background: #faf3e9;
  padding: 0 10px;
  flex: none;
  box-sizing: border-box;
}

.programme-onboarding-shell .po-help-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 11px 'Inter', sans-serif;
  color: #a8967f;
  padding: 0 6px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  box-sizing: border-box;
}

.programme-onboarding-shell .po-help-tab:hover {
  color: #6a5a48;
}

.programme-onboarding-shell .po-help-tab--active {
  color: #b06a12;
  border-bottom-color: #f6961d;
}

.programme-onboarding-shell .po-help-body {
  padding: 12px 13px;
}

.programme-onboarding-shell .po-help-note {
  background: #fff;
  border: 1px solid #f0e4d4;
  border-radius: 10px;
  padding: 10px 11px;
}

.programme-onboarding-shell .po-help-note__text {
  font: 500 11.5px/1.45 'Inter', sans-serif;
  color: #7a6f63;
}

.programme-onboarding-shell .po-help-tips {
  background: #fff8ef;
  border: 1px solid #fbd9ac;
  border-radius: 10px;
  padding: 10px 11px;
}

.programme-onboarding-shell .po-help-tips__title {
  font: 600 10.5px 'Inter', sans-serif;
  color: #b06a12;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.programme-onboarding-shell .po-help-tips__item {
  font: 500 11px/1.4 'Inter', sans-serif;
  color: #7a6f63;
}

.programme-onboarding-shell .po-help-accordion [data-slot='accordion-item'] {
  border-color: #f0e4d4;
}

.programme-onboarding-shell .po-help-accordion__trigger {
  font: 600 12px 'Inter', sans-serif !important;
  color: #3a2e22 !important;
  padding-top: 10px;
  padding-bottom: 10px;
}

.programme-onboarding-shell .po-help-accordion__answer {
  font: 500 11.5px/1.45 'Inter', sans-serif;
  color: #7a6f63;
  white-space: pre-line;
}

.programme-onboarding-shell .po-help-video__frame {
  border-radius: 10px;
  border: 1px solid #f0e4d4;
  background: #fff;
}

.programme-onboarding-shell .po-help-video__title {
  font: 600 12px 'Inter', sans-serif;
  color: #2a2018;
  margin-bottom: 4px;
}

.programme-onboarding-shell .help-sidebar-chat--programme {
  background: #faf3e9;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.programme-onboarding-shell .help-sidebar-chat--programme .bg-primary {
  background-color: #f6961d !important;
}

.programme-onboarding-shell .help-sidebar-chat--programme .bg-muted {
  background-color: #fff !important;
  border-color: #f0e4d4 !important;
}

.programme-onboarding-shell .help-sidebar-chat--programme .text-primary-foreground {
  color: #fff !important;
}

.programme-onboarding-shell .help-sidebar-chat--programme .harold-help-md,
.programme-onboarding-shell .help-sidebar-chat--programme .text-foreground {
  color: #3a2e22;
  font-size: 12px;
}

.programme-onboarding-shell .help-sidebar-chat--programme button[class*='h-8'] {
  height: 1.75rem;
  width: 1.75rem;
}

.programme-onboarding-shell .help-sidebar-chat--programme [data-slot='scroll-area-viewport'] {
  background: #faf3e9;
}

/* Chat compose — same height as main po-footer */
.programme-onboarding-shell .po-chat-compose {
  display: flex;
  align-items: center;
  height: var(--po-bar-height);
  min-height: var(--po-bar-height);
  padding: 0 13px;
  border-top: 1px solid #f0e4d4;
  background: #fffdfa;
  flex: none;
  box-sizing: border-box;
}

.programme-onboarding-shell .po-chat-compose__row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.programme-onboarding-shell .po-chat-compose__input,
.programme-onboarding-shell .po-chat-compose__input[data-slot='input'] {
  flex: 1;
  min-width: 0;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 11px !important;
  border-radius: 8px !important;
  border: 1px solid #e8d9c4 !important;
  background: #fff !important;
  box-shadow: none !important;
  font: 500 12px 'Inter', sans-serif !important;
  color: #2a2018 !important;
}

.programme-onboarding-shell .po-chat-compose__input::-moz-placeholder {
  color: #b0a090;
}

.programme-onboarding-shell .po-chat-compose__input::placeholder {
  color: #b0a090;
}

.programme-onboarding-shell .po-chat-compose__input:focus {
  outline: none;
  border-color: #f6961d;
  box-shadow: 0 0 0 2px rgba(246, 150, 29, 0.15);
}

.programme-onboarding-shell .po-chat-compose__send,
.programme-onboarding-shell .po-chat-compose__send[data-slot='button'] {
  flex: none;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 8px !important;
  background: #f6961d !important;
  color: #fff !important;
  cursor: pointer;
}

.programme-onboarding-shell .po-chat-compose__send:hover:not(:disabled) {
  background: #e8870f;
}

.programme-onboarding-shell .po-chat-compose__send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.programme-onboarding-shell .po-chat-compose__utility {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid #e8d9c4;
  border-radius: 8px;
  background: #fff;
  color: #a8967f;
  cursor: pointer;
}

.programme-onboarding-shell .po-chat-compose__utility:hover:not(:disabled) {
  border-color: #f6961d;
  color: #b06a12;
}

.programme-onboarding-shell .po-chat-compose__utility:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Trainer toggle uses draggable PiP chrome — programme palette lives in harold-trainer-toggle.css */

.programme-onboarding {
  margin: 0;
  background: #fdf7ef;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.programme-onboarding a {
  color: #f6961d;
  text-decoration: none;
}
.programme-onboarding a:hover {
  color: #ffab3d;
}

@keyframes programme-fadeup {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes programme-pop {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes programme-blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}
@keyframes programme-micglow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(246, 150, 29, 0.5);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(246, 150, 29, 0);
  }
}
@keyframes programme-barfill {
  from {
    width: 0;
  }
}

.programme-onboarding .k-typing span {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  margin: 0 1.5px;
  animation: programme-blink 1.3s infinite;
}
.programme-onboarding .k-typing span:nth-child(2) {
  animation-delay: 0.2s;
}
.programme-onboarding .k-typing span:nth-child(3) {
  animation-delay: 0.4s;
}
.programme-onboarding .k-mat {
  animation: programme-fadeup 0.5s ease both;
}

/* ── Shell chrome ─────────────────────────────────────────────────── */
.programme-onboarding {
  --po-nav-height: 38px;
  --po-bar-height: 52px;
  --po-side-title-padding-top: 15px;
  --po-side-title-padding-bottom: 11px;
  --po-side-title-text-size: 10.5px;
  --po-side-title-line-height: 1.2;
  --po-side-title-height: calc(
    var(--po-side-title-padding-top) + var(--po-side-title-padding-bottom) +
      var(--po-side-title-text-size) * var(--po-side-title-line-height)
  );
  --po-header-height: calc(var(--po-nav-height) * 2);
}

.programme-onboarding .po-header,
.programme-onboarding .po-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(14px, 2.2vw, 28px);
  border-color: #f0e4d4;
  background: #fffdfa;
  flex: none;
  box-sizing: border-box;
}
.programme-onboarding .po-header {
  height: var(--po-header-height);
  min-height: var(--po-header-height);
  max-height: var(--po-header-height);
  border-bottom: 1px solid #f0e4d4;
}
.programme-onboarding .po-footer {
  height: var(--po-bar-height);
  min-height: var(--po-bar-height);
  max-height: var(--po-bar-height);
  border-top: 1px solid #f0e4d4;
  gap: 10px;
}

.programme-onboarding .stepbody {
  flex: 1;
  display: flex;
  min-height: 0;
  width: 100%;
  animation: programme-fadeup 0.35s ease both;
  overflow: hidden;
}

/* Main column — fills remaining width; content stretches fluidly */
.programme-onboarding .step-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.6vh, 18px);
  padding: clamp(16px, 2.4vh, 28px) clamp(18px, 2.8vw, 40px);
  overflow: auto;
}

.programme-onboarding .step-main--center {
  justify-content: center;
}

/* Form / content stack fills the main column (no left-pinned 460px strip) */
.programme-onboarding .step-stack {
  display: flex;
  flex-direction: column;
  gap: 13px;
  width: 100%;
  max-width: 100%;
}

.programme-onboarding .step-stack--wide {
  max-width: 100%;
}

.programme-onboarding .step-copy {
  width: 100%;
  max-width: min(52rem, 100%);
}

.programme-onboarding .step-main > .step-stack,
.programme-onboarding .step-main > .po-grid-2,
.programme-onboarding .step-main > .po-grid-3 {
  width: 100%;
}

/* Side / Harold column — proportional width, not a dead fixed strip */
.programme-onboarding .step-side {
  flex: 0 0 clamp(280px, 30vw, 400px);
  width: clamp(280px, 30vw, 400px);
  max-width: 42%;
  border-left: 1px solid #f0e4d4;
  background: #faf3e9;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.programme-onboarding .step-side--welcome {
  flex-basis: clamp(300px, 32vw, 420px);
  width: clamp(300px, 32vw, 420px);
  padding: clamp(20px, 2.6vh, 28px) clamp(18px, 2vw, 26px);
}

.programme-onboarding .step-side--trial {
  flex-basis: clamp(320px, 36vw, 440px);
  width: clamp(320px, 36vw, 440px);
  padding: clamp(16px, 2.2vh, 22px) clamp(16px, 2vw, 22px);
  gap: 13px;
  overflow-y: auto;
  max-height: 100%;
}

.programme-onboarding .po-trial-billing {
  min-height: 0;
}

/* Programme trial billing — unified field styling (matches poFormStyles.ts) */
.programme-onboarding .po-trial-billing .po-stripe-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.programme-onboarding .po-trial-billing .po-stripe-address {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.programme-onboarding .po-trial-billing .po-stripe-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 380px) {
  .programme-onboarding .po-trial-billing .po-stripe-grid-2 {
    grid-template-columns: 1fr;
  }
}

.programme-onboarding .po-trial-billing .po-card-element-wrap {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid #e8d9c4;
  background: #fff;
  box-sizing: border-box;
}

/* Stripe injects a wrapper div — must span full width or the iframe collapses */
.programme-onboarding .po-trial-billing .po-card-element-wrap > div {
  width: 100%;
}

.programme-onboarding .po-trial-billing .po-stripe-input,
.programme-onboarding .po-trial-billing [data-slot='input'].po-stripe-input,
.programme-onboarding .po-trial-billing [data-slot='select-trigger'].po-stripe-input {
  height: 40px !important;
  min-height: 40px !important;
  border-radius: 8px !important;
  border: 1px solid #e8d9c4 !important;
  background: #fff !important;
  box-shadow: none !important;
  font: 500 13px 'Inter', sans-serif !important;
  color: #2a2018 !important;
  padding: 0 12px !important;
}

.programme-onboarding .po-trial-billing [data-slot='select-trigger'].po-stripe-input {
  width: 100% !important;
}

.programme-onboarding .po-trial-billing .po-stripe-input::-moz-placeholder, .programme-onboarding .po-trial-billing [data-slot='input'].po-stripe-input::-moz-placeholder {
  color: #b0a090;
}

.programme-onboarding .po-trial-billing .po-stripe-input::placeholder,
.programme-onboarding .po-trial-billing [data-slot='input'].po-stripe-input::placeholder {
  color: #b0a090;
}

.programme-onboarding .po-trial-billing .po-stripe-form .space-y-6 > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0;
}

.programme-onboarding .po-trial-billing .space-y-6 > :not([hidden]) ~ :not([hidden]) {
  margin-top: 1rem;
}

.programme-onboarding .side-body {
  flex: 1;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.programme-onboarding .side-title {
  padding: var(--po-side-title-padding-top) 16px var(--po-side-title-padding-bottom);
  height: var(--po-side-title-height);
  min-height: var(--po-side-title-height);
  max-height: var(--po-side-title-height);
  border-bottom: 1px solid #f0e4d4;
  font: 600 var(--po-side-title-text-size) / var(--po-side-title-line-height) 'Inter', sans-serif;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #a8967f;
  box-sizing: border-box;
}

/* Responsive grids used across steps */
.programme-onboarding .po-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
.programme-onboarding .po-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
.programme-onboarding .po-row-2 {
  display: flex;
  gap: 12px;
  width: 100%;
}
.programme-onboarding .po-row-2 > * {
  flex: 1;
  min-width: 0;
}

.programme-onboarding .navbtn {
  font: 700 12.5px 'Inter', sans-serif;
  color: #fff;
  background: #f6961d;
  border: none;
  border-radius: 10px;
  padding: 7px 16px;
  height: 32px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(246, 150, 29, 0.9);
  transition: transform 0.12s, filter 0.12s;
}
.programme-onboarding .navbtn:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.programme-onboarding .navbtn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.programme-onboarding .backbtn {
  font: 600 12.5px 'Inter', sans-serif;
  color: #6a5a48;
  background: transparent;
  border: none;
  cursor: pointer;
}
.programme-onboarding .backbtn:hover {
  color: #2a2018;
}
.programme-onboarding .chip {
  cursor: pointer;
  transition: transform 0.12s;
}
.programme-onboarding .chip:hover {
  transform: translateY(-1px);
}
.programme-onboarding .fwcard {
  cursor: pointer;
  transition: transform 0.12s;
}
.programme-onboarding .fwcard:hover {
  transform: translateY(-1px);
}
.programme-onboarding .micglow {
  animation: programme-micglow 2.6s ease-in-out infinite;
}
.programme-onboarding .barfill {
  animation: programme-barfill 1.6s ease both;
}
.programme-onboarding .fadeup {
  animation: programme-fadeup 0.3s ease both;
}
.programme-onboarding .pop {
  animation: programme-pop 0.4s ease both;
}

/* Real inputs that look like the demo's static field chips */
.programme-onboarding .demo-field {
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #ecdcc8;
  border-radius: 11px;
  padding: 12px 14px;
  font: 500 14px 'Inter', sans-serif;
  color: #2a2018;
  outline: none;
}
.programme-onboarding .demo-field:focus {
  border-color: #f6961d;
}
.programme-onboarding .demo-textarea {
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #ecdcc8;
  border-radius: 11px;
  padding: 11px 14px;
  font: 400 12.5px/1.55 'Inter', sans-serif;
  color: #2a2018;
  outline: none;
  min-height: 64px;
  resize: vertical;
}
.programme-onboarding .demo-textarea:focus {
  border-color: #f6961d;
}

/* Tablet: slightly tighter side rail */
@media (max-width: 1100px) {
  .programme-onboarding .step-side,
  .programme-onboarding .step-side--welcome,
  .programme-onboarding .step-side--trial {
    flex-basis: clamp(240px, 34vw, 320px);
    width: clamp(240px, 34vw, 320px);
    max-width: 38%;
  }
  .programme-onboarding .po-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Narrow / mobile: stack side panel under main content */
@media (max-width: 860px) {
  .programme-onboarding .stepbody {
    flex-direction: column;
    overflow: auto;
  }
  .programme-onboarding .step-main {
    flex: 1 1 auto;
    overflow: visible;
  }
  .programme-onboarding .step-side,
  .programme-onboarding .step-side--welcome,
  .programme-onboarding .step-side--trial {
    flex: none;
    width: 100%;
    max-width: none;
    border-left: none;
    border-top: 1px solid #f0e4d4;
  }
  .programme-onboarding .po-grid-3,
  .programme-onboarding .po-grid-2 {
    grid-template-columns: 1fr;
  }
  .programme-onboarding .po-row-2 {
    flex-direction: column;
  }
  .programme-onboarding .po-header,
  .programme-onboarding .po-footer {
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 520px) {
  .programme-onboarding .step-main {
    padding: 16px 14px;
  }
  .programme-onboarding .po-header .po-progress-meta {
    display: none;
  }
}
