:root {
  --text: #2c3e50;
  --muted: rgba(0, 0, 0, 0.5);
  --border: #e6e6e6;
  --shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
  --hero: #747d87;
  --green: #50af47;
  --footer-height: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Avenir, "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--green);
  text-decoration: none;
}

a:hover {
  color: #377931;
  text-decoration: underline;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 36px;
  border: 1px solid var(--border);
  border-left: 0;
  border-right: 0;
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1.25rem;
  line-height: inherit;
  color: rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

.brand img {
  width: 18px;
  height: 18px;
}

.nav-links {
  margin-left: 16px;
  display: inline-flex;
  gap: 18px;
}

.nav-links a,
.login-link {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.2;
}

.login-link {
  margin-left: auto;
}

main {
  flex: 1;
  padding-bottom: calc(var(--footer-height) + 12px);
}

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: var(--footer-height);
  color: var(--muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

.footer a:hover,
.nav-links a:hover,
.login-link:hover {
  text-decoration: underline;
}

/* Landing page */
.hero {
  margin: 8px;
  background: var(--hero);
  text-align: center;
  padding: 10px 10px 9px;
}

.hero-logo {
  width: 74px;
  height: 74px;
  object-fit: contain;
}

.hero h1 {
  margin: 0;
  font-size: 2.5rem;
  line-height: 1.2;
  font-weight: 500;
}

.hero p {
  margin: 5px 0 0;
  color: #435b7b;
  font-size: 0.75rem;
}

.welcome-strip {
  margin: 0 8px;
  text-align: center;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 8px 10px 9px;
}

.welcome-strip h3 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 500;
}

.welcome-strip h4 {
  margin: 0.15rem 0 0;
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 500;
}

.service-grid {
  padding: 16px 10px 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

.service-card {
  display: block;
  width: 280px;
  max-width: 100%;
  min-height: 120px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
  padding: 14px 12px;
}

.service-card:hover {
  text-decoration: none;
}

.service-card svg {
  width: 54px;
  height: 54px;
  color: var(--green);
  fill: currentColor;
}

.service-card p {
  margin: 0.5rem 0 0.5rem;
  color: var(--green);
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 500;
}

/* Login page */
.login-shell {
  padding: 42px 10px 0;
  display: flex;
  justify-content: center;
}

.login-card {
  width: min(840px, 100%);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 10px 14px 14px;
  text-align: center;
}

.login-card h1 {
  margin: 0 0 9px;
  font-size: 2.5rem;
  line-height: 1.2;
  font-weight: 500;
}

.login-form input {
  width: 100%;
  border: 1px solid #ced4da;
  height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 8px;
  color: #4c5563;
}

.login-form input::placeholder {
  color: #7d7f86;
}

.login-form button {
  margin-top: 1px;
  width: min(360px, 75%);
  min-height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 0.75rem;
  border: 0;
  color: #fff;
  background: var(--green);
  cursor: default;
  font-size: 1rem;
  line-height: 1.5;
}

.forgot-link {
  margin: 7px 0 0;
  font-size: 1rem;
  color: var(--green);
}

/* Legal pages */
.legal-content {
  margin: 28px auto 0;
  width: min(980px, calc(100% - 28px));
  background: #fff;
  box-shadow: var(--shadow);
  padding: 24px 24px 18px;
}

.legal-content h1,
.legal-content h2,
.legal-content h3,
.legal-content h4,
.legal-content h5 {
  color: var(--text);
  margin: 0 0 10px;
  font-weight: 500;
}

.legal-content h1 {
  font-size: 2.5rem;
}

.legal-content h2 {
  font-size: 2rem;
}

.legal-content h3 {
  font-size: 1.75rem;
  margin-top: 16px;
}

.legal-content h4 {
  font-size: 1.5rem;
  margin-top: 15px;
}

.legal-content h5 {
  font-size: 1.25rem;
  margin-top: 13px;
}

.legal-content p,
.legal-content li,
.legal-content td {
  font-size: 1rem;
  line-height: 1.45;
}

.legal-content a {
  color: var(--green);
}

.legal-content ul {
  margin: 8px 0 10px 20px;
}

.legal-content table {
  border-collapse: collapse;
  margin: 10px 0;
}

.legal-content td {
  padding: 5px 12px 5px 0;
  vertical-align: top;
}

@media (max-width: 900px) {
  .brand {
    font-size: 18px;
  }

  .welcome-strip h3 {
    font-size: 1.6rem;
  }

  .welcome-strip h4,
  .service-card p {
    font-size: 1.35rem;
  }
}

@media (max-width: 640px) {
  .topbar {
    height: auto;
    flex-wrap: wrap;
    row-gap: 4px;
    padding: 8px 10px;
  }

  .nav-links {
    width: 100%;
    margin-left: 24px;
    gap: 12px;
    flex-wrap: wrap;
  }

  .login-link {
    margin-left: 0;
    margin-right: 2px;
  }

  .hero h1 {
    font-size: 2.1rem;
  }

  .welcome-strip h3 {
    font-size: 1.35rem;
  }

  .welcome-strip h4,
  .service-card p {
    font-size: 1.2rem;
  }

  .login-card h1 {
    font-size: 2.1rem;
  }

  .legal-content {
    padding: 18px 14px 12px;
  }

  .footer {
    font-size: 10px;
    gap: 10px;
  }
}
