/* Reset + Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  height: 100%;
}
body {
  font-family: 'Segoe UI', sans-serif;
  background: #f9f9fb;
  color: #1a1a1a;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

/* Page wrapper for sticky-footer layout */
.wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.container {
  flex: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
  padding-bottom: 6rem; /* space between content and footer */
}

/* Header bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.top-bar h1 {
  font-size: 2rem;
}
.how-btn {
  background: #0056d2;
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}
.how-btn:hover {
  background: #0045aa;
}

/* Services grid */
.services {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.2s;
}
.card:hover {
  transform: translateY(-5px);
}
.card img {
  width: 40px;
  height: 40px;
  margin-right: 0.75rem;
}
.card h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.card h2 img {
  margin: 0;
}
.card p {
  margin-bottom: 1rem;
}
.card a {
  color: #0056d2;
  text-decoration: none;
  font-weight: 500;
}
.card a:hover {
  text-decoration: underline;
}

/* Extras */
.extras {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.extra-icon {
  display: inline-block;
  position: relative;
}
.extra-icon img {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.2));
}
.extra-icon .dot {
  position: absolute;
  top: -4px;
  right: -4px;
}

/* Footer - not sticky anymore */
.footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  flex-wrap: nowrap;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
}

/* Toggle switch */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  border-radius: 34px;
  top: 0; left: 0; right: 0; bottom: 0;
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px; width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: .4s;
}
input:checked + .slider {
  background-color: #4da3ff;
}
input:checked + .slider:before {
  transform: translateX(22px);
}

/* Dot for status */
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: red;
  opacity: 0.4;
  transition: background 0.5s ease, opacity 0.5s ease;
}
.dot.up {
  background: #00c853;
  opacity: 1;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  body {
    background: #121212;
    color: #f0f0f0;
  }
  .card {
    background: #1e1e1e;
  }
  .card a,
  .footer-bar a {
    color: #4da3ff;
  }
  .how-btn {
    background: #4da3ff;
    color: black;
  }
  .how-btn:hover {
    background: #2196f3;
  }
  .footer-bar {
    background: rgba(18, 18, 18, 0.95);
  }
}

/* Mobile layout */
@media (max-width: 600px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding-bottom: 2.5rem;
  }

  .footer-bar .toggle-wrapper {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
  }

  .footer-bar .toggle-wrapper + img {
    margin-top: -1rem;
    margin-left: 1rem;
  }

  .footer-bar p {
    width: 100%;
    text-align: right;
    margin: 0;
    padding-top: 0.5rem;
  }

  .how-btn {
    width: 100%;
    text-align: center;
  }

  .card h2 {
    flex-direction: row;
  }

  .card h2 img {
    margin-bottom: 0;
    margin-right: 0.5rem;
  }

  .card img {
    margin-bottom: 0;
  }
}
