/* Stable captive access adapter.
   Visual contract copied from the locked Sep-22 wiGO captive payment flow. */
.legacy-wifi-backdrop {
  position: fixed;
  z-index: 210;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: center;
  background: #e9edf3;
}

.legacy-wifi-sheet {
  position: relative;
  width: min(100%, 680px);
  height: 96dvh;
  max-height: 96dvh;
  overflow: hidden;
  padding: 18px 24px max(24px, calc(env(safe-area-inset-bottom) + 24px));
  border-radius: 34px 34px 0 0;
  background: #1b1b1b;
  color: #fff;
  box-shadow: 0 -24px 70px rgba(0,0,0,.24);
}

.legacy-wifi-handle {
  display: block;
  width: 78px;
  height: 5px;
  margin: -2px auto 17px;
  border-radius: 999px;
  background: #444;
}

.legacy-wifi-top {
  position: absolute;
  inset: 16px 18px auto;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.legacy-wifi-back,
.legacy-wifi-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f1f0e8;
  font: inherit;
  line-height: 1;
  pointer-events: auto;
}

.legacy-wifi-back {
  border: 1px solid rgba(215,215,210,.58);
  background: #242424;
  font-size: 30px;
}

.legacy-wifi-close {
  border: 0;
  background: rgba(255,255,255,.08);
  font-size: 28px;
}

.legacy-wifi-selected {
  min-height: 172px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  margin: 62px 0 22px;
  padding: 18px;
  border: 4px solid #9e9e9e;
  border-radius: 34px;
  text-align: center;
}

.legacy-wifi-selected small {
  font-size: 17px;
  font-weight: 800;
}

.legacy-wifi-selected strong {
  display: block;
  max-width: 100%;
  font-size: clamp(42px, 13vw, 68px);
  line-height: .98;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}

.legacy-wifi-selected span {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
}

.legacy-wifi-online,
.legacy-wifi-token,
.legacy-wifi-recovery {
  margin: 0;
}

.legacy-wifi-online h2 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  text-align: center;
}

.legacy-wifi-networks {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.legacy-wifi-networks span {
  min-height: 58px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  padding: 6px 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.legacy-wifi-networks .airtel { background:#e1261c; }
.legacy-wifi-networks .mixx { background:#213f88; color:#f2d84b; }
.legacy-wifi-networks .mpesa { background:#df241e; }
.legacy-wifi-networks .halo { background:#d7673f; }

.legacy-phone-row {
  position: relative;
  display: block;
  width: 100%;
  min-height: 54px;
  margin: 12px 0 0;
  overflow: hidden;
  border: 3px solid #f1f0e8;
  border-radius: 28px;
  background: #242424;
}

.legacy-phone-row input {
  width: 100%;
  min-height: 50px;
  padding: 0 44px 0 14px;
  border: 0;
  outline: 0;
  background: #242424;
  color: #d8d8d4;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.legacy-phone-row span {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: #d1d5db;
  font-size: 22px;
  pointer-events: none;
}

.legacy-wifi-help {
  margin: 18px 4px 0;
  color: #f3f4f6;
  font-size: 15px;
  line-height: 1.48;
  text-align: center;
}

.legacy-wifi-terms {
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 12px 4px 8px;
  padding: 0;
  color: #d8d8d4;
  font-size: 12px;
}

.legacy-wifi-terms input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: #f1f0e8;
}

.legacy-wifi-primary {
  width: 100%;
  min-height: 54px;
  margin: 10px 0 0;
  padding: 0 18px;
  border: 0;
  border-radius: 26px;
  background: #f0a400;
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
}

.legacy-wifi-primary:disabled {
  opacity: .55;
}

.legacy-wifi-token-card {
  padding: 16px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  background: #111827;
}

.legacy-wifi-token-card > strong {
  display: block;
  margin-bottom: 7px;
  color: #fff;
  font-size: 19px;
}

.legacy-wifi-token-card > p {
  margin: 0 0 13px;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.5;
}

.legacy-wifi-token-card > input {
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 0 14px;
  border: 2px solid #f0a400;
  border-radius: 14px;
  outline: 0;
  background: #1f2937;
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

.legacy-wifi-message {
  min-height: 24px;
  margin: 12px 2px 0;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.legacy-wifi-message[data-tone="error"] {
  color: #fecaca;
}

.legacy-wifi-message[data-tone="success"] {
  color: #bbf7d0;
}

@media (max-height: 760px) {
  .legacy-wifi-sheet {
    height: 100dvh;
    max-height: 100dvh;
    padding: 12px 18px max(14px, calc(env(safe-area-inset-bottom) + 14px));
    border-radius: 26px 26px 0 0;
  }

  .legacy-wifi-handle {
    margin-bottom: 10px;
  }

  .legacy-wifi-selected {
    min-height: 126px;
    margin: 50px 0 12px;
    padding: 12px;
    border-width: 3px;
    border-radius: 26px;
  }

  .legacy-wifi-selected small { font-size: 14px; }
  .legacy-wifi-selected strong { font-size: clamp(36px, 10vw, 50px); }
  .legacy-wifi-selected span { font-size: 17px; }

  .legacy-wifi-online h2 {
    margin-bottom: 8px;
    font-size: 21px;
  }

  .legacy-wifi-networks {
    gap: 7px;
    margin-bottom: 7px;
  }

  .legacy-wifi-networks span {
    min-height: 48px;
    font-size: 11px;
  }

  .legacy-phone-row {
    min-height: 50px;
    margin-top: 7px;
  }

  .legacy-phone-row input {
    min-height: 46px;
    font-size: 14px;
  }

  .legacy-wifi-help {
    margin-top: 9px;
    font-size: 12px;
    line-height: 1.35;
  }

  .legacy-wifi-terms {
    margin: 7px 2px 5px;
    font-size: 11px;
  }

  .legacy-wifi-primary {
    min-height: 48px;
    margin-top: 6px;
  }

  .legacy-wifi-token-card {
    padding: 13px;
  }

  .legacy-wifi-message {
    margin-top: 7px;
  }
}

.legacy-wifi-support {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.12);
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.legacy-wifi-support strong {
  display: block;
  margin-bottom: 6px;
  color: #f8fafc;
  font-size: 12px;
}

.legacy-wifi-support a {
  display: inline-block;
  margin: 3px 6px;
  color: #f0a400;
  font-weight: 850;
  text-decoration: none;
}
