:root {
  --primary: #059669;
  --primary-light: #10b981;
  --accent: #f59e0b;
  --text: #064e3b;
  --text-soft: #047857;
  --surface: #ffffff;
  --border: #bbf7d0;
  --bg: #ecfdf5;
  --footer-bg: #064e3b;
  --footer-text: #ecfdf5;
  --container: 720px;
  --radius: 16px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.35;
}

body.modal-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 12px;
}

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

.site-header {
  padding: 16px 0;
  background: var(--surface);
  border-bottom: 3px solid var(--primary-light);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-logo img {
  width: 132px;
  height: auto;
}

.site-header__badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 13px;
  font-weight: 600;
}

.offers-section {
  flex: 1;
  padding: 20px 0 28px;
}

.offers-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.offer-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 calc(50% - 5px);
  max-width: calc(50% - 5px);
  padding: 14px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.08);
}

.offer-card__label {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
}

.offer-card__label--top {
  background: var(--primary);
}

.offer-card__label--low {
  background: var(--accent);
}

.offer-card__logo-link {
  display: grid;
  place-items: center;
  min-height: 72px;
}

.offer-card__logo {
  max-height: 64px;
  width: auto;
  object-fit: contain;
}

.offer-card__rating {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f0fdf4;
  font-size: 13px;
}

.offer-card__rating strong {
  color: var(--primary);
  font-size: 18px;
}

.offer-card__stats {
  margin: 0;
  display: grid;
  gap: 6px;
}

.offer-card__stats div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}

.offer-card__stats dt {
  color: var(--text-soft);
  font-weight: 500;
}

.offer-card__stats dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.offer-card__details {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.button--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--text-soft);
  background: var(--surface);
  border-radius: var(--radius);
}

.site-footer {
  padding: 20px 0;
  background: var(--footer-bg);
  color: var(--footer-text);
}

.site-footer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer__logo img {
  width: 110px;
  height: auto;
  filter: brightness(0) invert(1);
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
}

.site-footer__nav a:hover {
  color: #fde68a;
}

.site-footer__legal {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.9;
}

.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 12px;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 78, 59, 0.55);
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 20px 16px;
  border-radius: 18px;
  background: var(--surface);
}

.modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.modal-logo {
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

.modal-logo img {
  max-height: 56px;
  object-fit: contain;
}

.modal-stats,
.modal-apr {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.modal-stats li,
.modal-apr li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.modal-stats span,
.modal-apr span {
  font-weight: 700;
}

.modal-heading {
  margin: 0 0 8px;
  font-size: 14px;
}

.modal-links {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.modal-links a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f0fdf4;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.modal-cta {
  margin-top: 4px;
}

.policy-page {
  padding: 20px 0 32px;
}

.policy-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.policy-card + .policy-card {
  margin-top: 12px;
}

.policy-card h1,
.policy-card .section-title {
  margin: 0 0 12px;
  font-size: 22px;
}

.policy-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.policy-back {
  margin-left: auto;
}

.policy-back {
  width: auto;
  min-width: auto;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .offer-card {
    padding: 12px 8px;
  }

  .offer-card__logo {
    max-height: 52px;
  }

  .button {
    font-size: 13px;
    min-height: 38px;
  }
}
