* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #142c5a;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(16px, 4vw, 24px);
  position: relative;
}

.container {
  width: 100%;
  max-width: min(400px, 90vw);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(16px, 4vh, 24px);
}

.main-card {
  background-color: #ffffff;
  border-radius: clamp(10px, 2.5vw, 16px);
  padding: clamp(24px, 6vw, 36px) clamp(24px, 6vw, 36px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 4vh, 18px);
  height: 80%;
  min-height: 80%;
}

.logo-section {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: clamp(24px, 4vh, 30px);
  margin-top: clamp(12px, 2vh, 20px);
}

.nj-transit-logo {
  width: 100%;
  max-width: min(280px, 70vw);
  height: auto;
  object-fit: contain;
}

.welcome-message-container {
  margin-top: clamp(20px, 1vh, 30px);
  width: 65%;
  margin-left: auto;
  margin-right: auto;
}

.welcome-title {
  font-family: "Inter", sans-serif;
  font-size: clamp(20px, 3vw, 24px);
  font-weight: 600;
  color: #000000;
  text-align: center;
  line-height: 100%;
  letter-spacing: 0%;
  width: 100%;
  margin: 0;
}

.wifi-info-container {
  width: 80%;
  margin-left: auto;
  margin-right: auto;
  margin: 0;
}
.wifi-info {
  font-family: "Inter", sans-serif;
  font-size: clamp(12px, 3.5vw, 16px);
  font-weight: 400;
  color: #000000;
  text-align: center;
  line-height: 100%;
  letter-spacing: 0%;
  width: 100%;
}

.terms-section {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: clamp(16px, 2vh, 24px);
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: clamp(12px, 3vw, 14px);
  color: #000000;
  gap: 8px;
}

.checkbox-input {
  width: clamp(16px, 4vw, 18px);
  height: clamp(16px, 4vw, 18px);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-text {
  line-height: 1.5;
}

.terms-link {
  color: #0066cc;
  text-decoration: underline;
  cursor: pointer;
}

.terms-link:hover {
  color: #0052a3;
}

/* Connect Button — grey default; visual state driven by .is-active (set by
   main.js), NOT :disabled. appearance:none on the BASE rule is required or
   iOS Safari overrides background-color on enabled buttons. */
.connect-button {
  width: 100%;
  max-width: 100%;
  background-color: #cccccc;             /* grey default */
  color: #ffffff;
  font-family: "Inter", sans-serif;
  font-size: clamp(16px, 4vw, 18px);
  font-weight: 700;
  padding: clamp(14px, 3.5vw, 16px) clamp(20px, 5vw, 24px);
  border: none;
  border-radius: clamp(10px, 2.5vw, 12px);
  cursor: not-allowed;
  transition: background-color 0.2s ease;
  line-height: 100%;
  letter-spacing: 0%;
  margin-top: clamp(2px, 1vh, 8px);
  -webkit-appearance: none;              /* prevent iOS button defaults */
  appearance: none;
  opacity: 1;
}

.connect-button.is-active {
  background-color: #ff5200;
  cursor: pointer;
}
.connect-button.is-active:hover {
  background-color: #e55a00;
}
.connect-button.is-active:active {
  transform: scale(0.98);
}

/* Online affordance — shown via .state-online class toggle (not innerHTML)
   for old WebKit (iPad Pro WKWebView) repaint reliability; idle UI hidden. */
.online-message {
  display: none;
  text-align: center;
  width: 100%;
  margin: 0;
}
body.state-online .online-message {
  display: block;
}
body.state-online .terms-section,
body.state-online .connect-button,
body.state-online .wifi-info-container {
  display: none;
}

.online-title {
  font-family: "Inter", sans-serif;
  font-size: clamp(15px, 4vw, 18px);
  font-weight: 700;
  color: #0a8a3a;
  line-height: 1.3;
  margin: 0 0 8px 0;
}

.online-body {
  font-family: "Inter", sans-serif;
  font-size: clamp(13px, 3.4vw, 15px);
  font-weight: 400;
  color: #142c5a;
  line-height: 1.45;
  margin: 0;
}

.online-body strong {
  color: #142c5a;
  font-weight: 700;
}

.copyright {
  font-size: clamp(10px, 2.5vw, 12px);
  color: #888888;
  text-align: center;
  width: 100%;
  margin-top: clamp(30px, 2vh, 44px);
}

.powered-by-section {
  text-align: center;
  color: #ffffff;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(4px, 1vh, 8px);
}

.powered-by-text {
  font-size: clamp(12px, 3vw, 14px);
  color: #b0c4de;
  margin: 0;
}

.buspas-logo-container {
  display: inline-block;
  border-radius: 8px;
  padding: clamp(4px, 1vw, 8px) clamp(12px, 3vw, 16px);
  background-color: transparent;
  margin: 0;
  margin-top: -15px;
}

.buspas-logo {
  max-width: clamp(100px, 25vw, 120px);
  height: auto;
  display: block;
}

@media (max-width: 768px) {
  .container {
    height: 100vh;
    min-height: 100vh;
  }

  .main-card {
    height: 64%;
    min-height: 64%;
  }

  .copyright {
    margin-top: auto;
  }
}

@media (min-width: 769px) {
  .container {
    max-width: 90%;
  }

  .main-card {
    padding: clamp(32px, 4vw, 48px) clamp(32px, 4vw, 40px);
    border-radius: 16px;
    gap: clamp(20px, 3vh, 32px);
  }

  .main-card > * {
    max-width: 80%;
  }

  .logo-section {
    margin-bottom: clamp(16px, 2vh, 24px);
  }

  .nj-transit-logo {
    max-width: 300px;
  }

  .welcome-title {
    font-size: 28px;
  }

  .wifi-info {
    font-size: 14px;
  }

  .connect-button {
    font-size: 14px;
    padding: 14px 14px;
    width: 30%;
    margin-left: auto;
    margin-right: auto;
  }

  .copyright {
    font-size: 14px;
  }

  .powered-by-text {
    font-size: 16px;
  }

  .buspas-logo {
    max-width: 150px;
  }
}

@media (min-width: 1024px) {
  body {
    padding: 40px;
  }

  .container {
    max-width: 90%;
  }

  .main-card {
    padding: 40px 40px;
    border-radius: 20px;
  }

  .main-card > * {
    max-width: 75%;
  }

  .logo-section {
    margin-bottom: 30px;
  }

  .nj-transit-logo {
    max-width: 280px;
  }

  .welcome-title {
    font-size: 28px;
  }

  .wifi-info {
    font-size: 15px;
  }

  .connect-button {
    font-family: "Inter", sans-serif;
    font-size: 16px;
    font-weight: 500;
    padding: 12px 12px;
    width: 28%;
  }

  .copyright {
    font-size: 14px;
  }

  .powered-by-text {
    font-size: 18px;
  }

  .buspas-logo {
    max-width: 180px;
  }
}

@media (min-height: 800px) and (max-width: 768px) {
  .container {
    gap: clamp(14px, 2vh, 22px);
  }

  .main-card {
    gap: clamp(12px, 2vh, 20px);
  }

  .logo-section {
    margin-bottom: clamp(25px, 2vh, 35px);
    margin-top: clamp(25px, 1vh, 35px);
  }

  .welcome-title {
    font-size: clamp(25px, 2vh, 30px);
  }

  .welcome-message-container {
    margin-top: clamp(25px, 1vh, 35px);
    font-size: clamp(25px, 2vh, 30px);
    width: 80%;
    margin-left: auto;
    margin-right: auto;
  }

  .wifi-info-container {
    width: 80%;
    margin-left: auto;
    margin-right: auto;
  }

  .terms-section {
    margin-top: clamp(20px, 1.5vh, 26px);
  }

  .connect-button {
    margin-top: clamp(16px, 1.5vh, 24px);
  }
  .copyright {
    margin-top: auto;
    margin-bottom: clamp(14px, 1.5vh, 20px);
  }
}
