@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
  --ocj-font-body: "Poppins", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --ocj-font-body-weight: 500;
  --ocj-font-body-size: 18px;
  --ocj-font-display: "Poppins", "Georgia", sans-serif;
  --ocj-height: clamp(280px, 22vw, 380px);
  --ocj-rail-width: 100px;
  --ocj-border-radius: 28px;
  --ocj-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ocj-transition: 420ms var(--ocj-ease);
  --ocj-panel-padding: clamp(16px, 4.8vw, 26px);
}

/* Base accordion styles */
.ocj-hacc {
  --ocj-rail-width: 100px;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: var(--ocj-height);
  border-radius: var(--ocj-border-radius);
  overflow: hidden;
  color: #ffffff;
  background: #e31b23;
  isolation: isolate;
  font-family: var(--ocj-font-body);
  font-size: var(--ocj-font-body-size);
  font-weight: var(--ocj-font-body-weight);
}

.ocj-hacc--3 {
  --ocj-rail-width: 150px;
}

.ocj-hacc,
.ocj-hacc * {
  box-sizing: border-box;
}

/* Accordion items */
.ocj-hacc__item {
  position: relative;
  flex: 0 0 var(--ocj-rail-width);
  width: var(--ocj-rail-width);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  transition: width var(--ocj-transition), flex-basis var(--ocj-transition),
    filter var(--ocj-transition);
}

.ocj-hacc__item.is-active {
  flex: 1 1 60%;
  width: auto;
  filter: saturate(1);
}

.ocj-hacc[data-ocj-width-lock="true"] .ocj-hacc__item,
.ocj-hacc[data-ocj-width-lock="true"] .ocj-hacc__item.is-active {
  flex: 0 0 auto;
  width: auto;
}

.ocj-hacc__item:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: rgba(0, 0, 0, 0.15);
  z-index: 3;
}

.ocj-hacc__item::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ocj-transition);
  z-index: 2;
}

.ocj-hacc__item:not(.is-active)::after {
  opacity: 1;
}

/* Trigger button */
.ocj-hacc__trigger {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 4;
}

.ocj-hacc__item.is-active .ocj-hacc__trigger {
  pointer-events: none;
}

.ocj-hacc__trigger:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: -4px;
}

/* Surface panel */
.ocj-hacc__surface {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: clamp(12px, 2vw, 16px);
  width: 100%;
  min-height: var(--ocj-height);
  max-height: 380px;
  height: auto;
  padding: var(--ocj-panel-padding);
  background: var(--ocj-step-bg, #e31b23);
  color: inherit;
  transition: background var(--ocj-transition), padding var(--ocj-transition);
}

/* Head section */
.ocj-hacc__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 70%;
  gap: 8px;
  margin-bottom: 4px;
}

.ocj-hacc__head .ocj-hacc__title {
  margin: 0;
  font-family: var(--ocj-font-display);
  font-weight: 600;
  font-size: clamp(22px, 3vw, 32px);
  font-style: italic;
  line-height: 1.2;
  color: #ffffff !important;
  opacity: 0;
  transition: opacity 80ms ease;
}

.ocj-hacc__item.is-active .ocj-hacc__head .ocj-hacc__title {
  opacity: 1;
}

/* Meta rule */
.ocj-hacc__meta-rule {
  width: 100%;
  height: 3px;
  background: #ffffff;
  opacity: 0;
  transition: opacity 50ms ease;
}

.ocj-hacc__item.is-active .ocj-hacc__meta-rule {
  opacity: 1;
  transition: opacity var(--ocj-transition);
}

/* Body section */
.ocj-hacc__body {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.8vw, 16px);
  max-width: min(42rem, 75%);
  position: relative;
  opacity: 0;
  transform: translateY(28px);
  pointer-events: none;
  transition: opacity 50ms ease, transform 100ms ease;
}

.ocj-hacc__item.is-active .ocj-hacc__body {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 680ms var(--ocj-ease) 400ms,
    transform 420ms var(--ocj-ease) 140ms;
}

/* Copy text */
.ocj-hacc__copy {
  margin: 0;
  font-family: var(--ocj-font-body);
  font-size: var(--ocj-font-body-size);
  font-weight: var(--ocj-font-body-weight);
  line-height: 1.6;
  color: rgba(226, 231, 255, 0.92);
  max-width: min(38rem, 95%);
}

/* CTA button */
.ocj-hacc__cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px 0;
  color: #b7befe;
  font-family: var(--ocj-font-body);
  font-size: clamp(16px, 2vw, 18px);
  font-weight: var(--ocj-font-body-weight);
  letter-spacing: 0.02em;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  transition: color var(--ocj-transition), transform var(--ocj-transition);
}

.ocj-hacc__cta:hover {
  color: #d4d8ff;
  transform: translateX(3px);
}

.ocj-hacc__cta:active {
  color: #a8b1ff;
  transform: translateX(1px);
}

.ocj-hacc__cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Material Symbols Outlined";
  font-size: 1.15em;
  line-height: 1;
  margin-top: 2px;
  transition: transform var(--ocj-transition);
  letter-spacing: normal;
  text-transform: none;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.ocj-hacc__cta-label {
  display: inline-block;
  text-align: left;
}

/* Vertical rail title */
.ocj-hacc__rail-title {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  padding-bottom: var(--ocj-panel-padding);
  white-space: nowrap;
  font-family: var(--ocj-font-body);
  font-size: clamp(24px, 2.4vw, 36px);
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.05em;
  z-index: 5;
  pointer-events: none;
  opacity: 1;
  transition: opacity var(--ocj-transition);
  margin-right: 20px;
}

.ocj-hacc__item.is-active .ocj-hacc__rail-title {
  opacity: 0;
}

/* Dots navigation */
.ocj-hacc__dots {
  display: none;
}

.ocj-hacc__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.35);
  opacity: 0.6;
  transition: background var(--ocj-transition), transform var(--ocj-transition),
    opacity var(--ocj-transition);
}

.ocj-hacc__dot:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 4px;
}

.ocj-hacc__dot[aria-current="true"],
.ocj-hacc__dot.is-active {
  background: #ff592e;
  opacity: 1;
  transform: scale(1.2);
}

/* Screen reader only */
.ocj-hacc__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Step color palettes */
.ocj-hacc__item--step-1 {
  --ocj-step-bg: #e31b23;
}

.ocj-hacc__item--step-2 {
  --ocj-step-bg: #b5171d;
}

.ocj-hacc__item--step-3 {
  --ocj-step-bg: #8b1419;
}

/* Modal styles */
.ocj-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(32px, 7vw, 96px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ocj-transition);
  z-index: 10000;
}

.ocj-modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

body.ocj-modal--open {
  overflow: hidden;
}

.ocj-modal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 24, 0.82);
  backdrop-filter: blur(6px);
  z-index: 0;
}

.ocj-modal__panel {
  position: relative;
  z-index: 1;
  width: min(840px, 94vw);
  max-height: min(90vh, 820px);
  padding: clamp(28px, 4.6vw, 44px);
  background: transparent;
  overflow: auto;
}

.ocj-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(142, 154, 255, 0.45);
  background: rgba(234, 237, 255, 0.92);
  color: #3142ff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--ocj-transition), color var(--ocj-transition),
    transform var(--ocj-transition), border-color var(--ocj-transition);
}

.ocj-modal__close:hover {
  background: rgba(220, 225, 255, 0.98);
  color: #1f2cff;
  border-color: rgba(120, 134, 255, 0.55);
}

.ocj-modal__close:focus-visible {
  outline: 2px solid rgba(120, 134, 255, 0.75);
  outline-offset: 4px;
}

.ocj-modal__close:active {
  transform: scale(0.95);
}

.ocj-modal__matrix {
  width: 100%;
  min-width: min(720px, 100%);
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(196, 203, 255, 0.7);
}

.ocj-modal__matrix thead th {
  font-family: var(--ocj-font-body);
  font-size: clamp(15px, 2.1vw, 17px);
  font-weight: 600;
  color: #3142ff;
  text-align: left;
  padding: clamp(18px, 2.4vw, 22px);
  background: #f4f6ff;
  border-bottom: 1px solid rgba(196, 203, 255, 0.7);
}

.ocj-modal__matrix thead th:first-child {
  color: transparent;
}

.ocj-modal__matrix-col {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 1.8vw, 18px);
}

.ocj-modal__matrix-col span {
  flex: 1;
}

.ocj-modal__matrix tbody th {
  font-family: var(--ocj-font-display);
  font-size: clamp(18px, 2.6vw, 22px);
  font-weight: 500;
  color: #3142ff;
  background: #f8f9ff;
  padding: clamp(18px, 3vw, 24px);
  border-right: 1px solid rgba(196, 203, 255, 0.7);
  border-bottom: 1px solid rgba(212, 220, 255, 0.65);
}

.ocj-modal__matrix tbody tr:last-child th {
  border-bottom: 0;
}

.ocj-modal__matrix td {
  padding: clamp(18px, 3vw, 26px);
  border-bottom: 1px solid rgba(212, 220, 255, 0.65);
  border-right: 1px solid rgba(212, 220, 255, 0.65);
  vertical-align: top;
  background: #ffffff;
}

.ocj-modal__matrix td:last-child,
.ocj-modal__matrix thead th:last-child {
  border-right: 0;
}

.ocj-modal__matrix tr:last-child td {
  border-bottom: 0;
}

.ocj-modal__matrix-heading {
  display: block;
  font-family: var(--ocj-font-body);
  font-size: clamp(17px, 2.5vw, 20px);
  font-weight: 600;
  color: #11163f;
  margin-bottom: clamp(8px, 1.4vw, 12px);
}

.ocj-modal__matrix-copy {
  margin: 0;
  font-family: var(--ocj-font-body);
  font-size: clamp(15px, 2.2vw, 17px);
  line-height: 1.6;
  color: rgba(23, 32, 61, 0.76);
}

/* Media Queries */
@media (max-width: 1100px) {
  :root {
    --ocj-rail-width: 120px;
  }

  .ocj-hacc__item.is-active {
    flex: 1 1 55%;
  }
}

@media (max-width: 900px) {
  .ocj-hacc {
    flex-direction: column;
    min-height: auto;
  }

  .ocj-hacc__surface {
    min-height: 0;
    max-height: none;
    height: auto;
  }

  .ocj-hacc__item {
    flex: none;
    min-height: 0;
    width: 100%;
    overflow: visible;
  }

  .ocj-hacc__item:not(.is-active) .ocj-hacc__body {
    max-height: 0;
    opacity: 0;
    transform: none;
    overflow: hidden;
  }

  .ocj-hacc__item.is-active .ocj-hacc__body {
    max-height: none;
    opacity: 1;
  }

  .ocj-hacc__head {
    width: 100%;
  }

  .ocj-hacc__body {
    max-width: 100%;
    width: 100%;
    padding-inline: clamp(8px, 4vw, 16px);
    padding-bottom: clamp(18px, 6vw, 28px);
  }

  .ocj-hacc__copy {
    max-width: 100%;
  }

  .ocj-hacc--carousel {
    display: flex;
    flex-direction: row;
    gap: clamp(16px, 4vw, 24px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    margin-bottom: clamp(8px, 2vw, 16px);
  }

  .ocj-hacc--carousel::-webkit-scrollbar {
    display: none;
  }

  .ocj-hacc--carousel .ocj-hacc__item {
    flex: 0 0 100%;
    min-width: 100%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }

  .ocj-hacc--carousel .ocj-hacc__trigger {
    display: none;
  }

  .ocj-hacc--carousel .ocj-hacc__body {
    max-height: none !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }

  .ocj-hacc--carousel + .ocj-hacc__dots {
    display: flex;
    justify-content: center;
    gap: clamp(10px, 3vw, 16px);
    margin: 30px auto clamp(12px, 4vw, 18px);
  }

  .ocj-hacc--carousel + .ocj-hacc__dots .ocj-hacc__dot {
    background: #c2bab8;
  }

  .ocj-hacc--carousel + .ocj-hacc__dots .ocj-hacc__dot[aria-current="true"],
  .ocj-hacc--carousel + .ocj-hacc__dots .ocj-hacc__dot.is-active {
    background: #ff592e;
  }
}

@media (max-width: 720px) {
  .ocj-modal {
    padding: clamp(16px, 4vw, 32px);
  }

  .ocj-modal__panel {
    overflow-x: hidden;
    padding: clamp(22px, 6vw, 32px);
    max-height: 90vh;
  }

  .ocj-modal__matrix thead th,
  .ocj-modal__matrix tbody th,
  .ocj-modal__matrix td {
    font-size: 15px;
    padding: clamp(14px, 4.4vw, 20px);
  }

  .ocj-modal__matrix-col {
    gap: clamp(10px, 3vw, 16px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ocj-hacc__item,
  .ocj-hacc__surface,
  .ocj-hacc__body,
  .ocj-hacc__item::after,
  .ocj-modal,
  .ocj-modal__panel,
  .ocj-modal__overlay,
  .ocj-modal__close {
    transition: none !important;
  }
}
