/* ==========================================================================
   Nairaloop — How it works Modal
   ========================================================================== */

:root {
  --primary: #2417d6;
  --secondary: #2196ff;
  --text: #1d1d3f;
  --muted: #64687f;
  --bg: #f7f8fc;
  --modal-bg: #ffffff;
  --card-bg: #ffffff;
  --card-border: #f1f1f1;
  --modal-shadow: 0 30px 80px rgba(0, 0, 0, 0.12);
  --timeline-line: #d8dbe8;
  --modal-close-bg: #f0f1f5;
}

/* --------------------------------------------------------------------------
   Modal shell
   -------------------------------------------------------------------------- */
#howItWorksModal.fade {
  --bs-modal-fade-transform: translateY(12px);
}

#howItWorksModal .modal.fade .modal-dialog {
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.nl-modal-dialog {
  max-width: 1200px;
  width: 95%;
  margin: 1.5rem auto;
}

.nl-modal {
  position: relative;
  border: none;
  border-radius: 32px;
  background: var(--modal-bg, #ffffff);
  box-shadow: var(--modal-shadow, 0 30px 80px rgba(0, 0, 0, 0.12));
  overflow: hidden;
  font-family: 'Poppins', var(--nl-font);
}

.nl-modal .modal-header,
.nl-modal .modal-body {
  position: relative;
  z-index: 2;
}

/* Background glow */
.nl-modal__glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(180px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 1;
}

.nl-modal__glow--left {
  top: 10%;
  left: -80px;
  background: var(--primary);
}

.nl-modal__glow--right {
  bottom: 10%;
  right: -80px;
  background: var(--secondary);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.nl-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 40px 48px 0;
  gap: 24px;
}

.nl-modal__title {
  font-size: 42px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 8px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.nl-modal__subtitle {
  font-size: 18px;
  font-weight: 400;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.nl-modal__close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--modal-close-bg);
  color: var(--muted);
  font-size: 18px;
  padding: 0;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nl-modal__close:hover {
  background: rgba(36, 23, 214, 0.1);
  color: var(--primary);
  box-shadow: 0 0 0 4px rgba(36, 23, 214, 0.08);
}

.nl-modal__close:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Body & split layout
   -------------------------------------------------------------------------- */
.nl-modal__body {
  padding: 36px 48px 48px;
}

.nl-modal__split {
  display: grid;
  /* grid-template-columns: 45% 55%; */
  grid-template-rows: auto auto;
  gap: 40px 70px;
  align-items: start;
}

.nl-modal__left {
  grid-column: 1;
  grid-row: 1;
}

.nl-modal__download {
  grid-column: 1;
  grid-row: 2;
}

.nl-modal__right {
  grid-column: 2;
  grid-row: 1 / 3;
}

/* --------------------------------------------------------------------------
   Timeline (left panel)
   -------------------------------------------------------------------------- */
.nl-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 8px;
}

.nl-timeline::before {
  content: '';
  position: absolute;
  left: 23px;
  top: 48px;
  bottom: 48px;
  width: 0;
  border-left: 2px dotted var(--timeline-line);
  z-index: 0;
}

.nl-timeline__step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 28px;
  align-items: start;
  padding-bottom: 44px;
}

.nl-timeline__step--last {
  padding-bottom: 0;
}

.nl-timeline__marker {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.nl-timeline__circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nl-timeline__step:hover .nl-timeline__circle {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(36, 23, 214, 0.35);
}

.nl-timeline__heading {
  font-size: 34px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 10px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.nl-timeline__text {
  font-size: 18px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
  /* max-width: 420px; */
}

/* App download (bottom of left panel) */
.nl-modal__download {
  margin-top: 0;
  padding: 24px;
  background: var(--bg);
  border-radius: 16px;
}

.nl-modal__download .nl-download {
  gap: 18px;
}

/* --------------------------------------------------------------------------
   Feature cards (right panel)
   -------------------------------------------------------------------------- */
.nl-modal__right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.nl-feature-card {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 140px;
  padding: 30px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06);
  opacity: 0;
  transform: translateY(20px);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.nl-feature-card--visible {
  animation: nlCardFadeUp 0.5s ease forwards;
}

@keyframes nlCardFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nl-feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
  border-color: rgba(36, 23, 214, 0.12);
}

.nl-feature-card--visible:hover {
  transform: translateY(-6px);
}

.nl-feature-card__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  font-size: 26px;
  color: #ffffff;
}

.nl-feature-card__icon--search {
  background: linear-gradient(135deg, #2417d6 0%, #4b3cf0 100%);
}

.nl-feature-card__icon--grid {
  background: linear-gradient(135deg, #2196ff 0%, #5eb8ff 100%);
}

.nl-feature-card__icon--payment {
  background: linear-gradient(135deg, #2417d6 0%, #2196ff 100%);
}

.nl-feature-card__icon--confirm {
  background: linear-gradient(135deg, #1a9e6e 0%, #34d399 100%);
}

.nl-feature-card__icon--rocket {
  background: linear-gradient(135deg, #7c3aed 0%, #2196ff 100%);
}

.nl-feature-card__body {
  min-width: 0;
}

.nl-feature-card__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.3;
}

.nl-feature-card__desc {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

/* Badge glow on hover */
.nl-modal__download .nl-badge {
  transition: opacity 0.2s ease, filter 0.2s ease, transform 0.2s ease;
}

.nl-modal__download .nl-badge:hover {
  opacity: 1;
  filter: drop-shadow(0 4px 12px rgba(36, 23, 214, 0.25));
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Responsive — Tablet
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .nl-modal__split {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .nl-modal__right {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .nl-modal__header {
    padding: 32px 32px 0;
  }

  .nl-modal__body {
    padding: 28px 32px 36px;
  }

  .nl-modal__title {
    font-size: 34px;
  }

  .nl-timeline__heading {
    font-size: 28px;
  }

  .nl-timeline__text {
    font-size: 16px;
  }

  .nl-feature-card {
    height: auto;
    min-height: 120px;
    padding: 24px;
    gap: 18px;
  }

  .nl-feature-card__icon {
    width: 56px;
    height: 56px;
    font-size: 22px;
  }
}

/* --------------------------------------------------------------------------
   Responsive — Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .nl-modal-dialog {
    width: 95%;
    margin: 0.75rem auto;
  }

  .nl-modal {
    border-radius: 24px;
    max-height: 92vh;
    overflow-y: auto;
  }

  .nl-modal__header {
    padding: 24px 24px 0;
    flex-direction: row;
    align-items: flex-start;
  }

  .nl-modal__title {
    font-size: 28px;
  }

  .nl-modal__subtitle {
    font-size: 15px;
  }

  .nl-modal__body {
    padding: 24px;
  }

  .nl-modal__split {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 36px;
  }

  .nl-modal__left {
    grid-column: 1;
    grid-row: 1;
  }

  .nl-modal__right {
    grid-column: 1;
    grid-row: 2;
  }

  .nl-modal__download {
    grid-column: 1;
    grid-row: 3;
    margin-top: 0;
  }

  .nl-timeline__step {
    grid-template-columns: 40px 1fr;
    gap: 20px;
    /* padding-bottom: 36px; */
  }

  .nl-timeline::before {
    left: 19px;
    top: 40px;
    bottom: 40px;
  }

  .nl-timeline__circle {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .nl-timeline__heading {
    font-size: 24px;
  }

  .nl-timeline__text {
    font-size: 15px;
    max-width: none;
  }

  .nl-feature-card {
    height: auto;
    min-height: 110px;
    padding: 20px;
    border-radius: 20px;
    gap: 16px;
  }

  .nl-feature-card__icon {
    width: 48px;
    height: 48px;
    font-size: 20px;
    border-radius: 14px;
  }

  .nl-feature-card__title {
    font-size: 17px;
  }

  .nl-feature-card__desc {
    font-size: 14px;
  }

  .nl-modal__close {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}
