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

:root {
  --bg: #f4f8ff;
  --card-bg: #ffffff;
  --accent: #0b8df5;
  --accent-soft: #e0f0ff;
  --accent-2: #a66bff;
  --accent-3: #ff70b8;
  --text-main: #111827;
  --text-soft: #4b5563;
  --border-subtle: #e5e7eb;
  --radius-xl: 18px;
  --shadow-soft: 0 14px 40px rgba(15, 23, 42, 0.12);
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  color: var(--text-main);
  background: var(--bg);
}

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

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244, 248, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.logo-title {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.88rem;
}

.nav-links a {
  color: #374151;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-cta {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.7);
  background: rgba(59, 130, 246, 0.06);
  font-weight: 600;
}

/* Hero */

.hero {
  padding: 32px 0 8px;
}

.hero-inner {
  display: flex;
}

.hero-content {
  background: linear-gradient(145deg, #f4f8ff 0%, #ffffff 50%, #fdf2ff 100%);
  border-radius: 26px;
  padding: 28px 24px 26px;
  box-shadow: var(--shadow-soft);
}

.hero-title {
  margin: 0 0 8px;
}

.hero-gradient {
  background: linear-gradient(120deg, #3b82f6, #a855f7, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 2.4rem;
  line-height: 1.05;
  letter-spacing: 0.01em;
}

.hero-sub {
  font-size: 0.98rem;
  color: var(--text-soft);
  margin-bottom: 16px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: var(--accent-2);
  color: #fff;
  box-shadow: 0 10px 30px rgba(166, 107, 255, 0.3);
}

.btn-ghost {
  background: #fff;
  border-color: rgba(148, 163, 184, 0.5);
  color: #111827;
}

/* Sections */

.section {
  padding: 20px 0;
}

.soft-bg {
  background: #ecf3ff;
}

.section-title {
  font-size: 1.4rem;
  margin: 0 0 14px;
}

.section-note {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 12px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.cards-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.info-card,
.card-offer {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 16px 16px 18px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Collapsible card styles */
.collapsible-card {
  cursor: pointer;
}

.collapsible-card summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.collapsible-card summary::-webkit-details-marker {
  display: none;
}

.collapsible-card summary::after {
  content: '▼';
  position: absolute;
  right: 0;
  top: 0;
  font-size: 0.85rem;
  color: var(--text-soft);
  transition: transform 0.2s ease;
}

.collapsible-card[open] summary::after {
  transform: rotate(180deg);
}

.collapsible-card summary h3 {
  display: inline-block;
  margin-right: 24px;
}

.collapsible-card summary:hover h3 {
  color: var(--accent);
}

.collapsible-card p {
  margin-top: 12px;
  margin-bottom: 14px;
  line-height: 1.7;
}

.collapsible-card p:last-child {
  margin-bottom: 0;
}


.info-card h3,
.card-offer h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.info-card p,
.card-offer p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.tag-icon {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.pill,
.pill-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pill-green {
  background: #dcfce7;
  color: #166534;
}

.pill-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.pill-teal {
  background: #ccfbf1;
  color: #0f766e;
}

.pill-outline {
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #fff;
  color: #111827;
}

.offer-issuer {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 2px;
}

.offer-meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.offer-detail {
  font-size: 0.82rem;
  color: #4b5563;
}

/* Stores */

.store-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.store-row {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr auto;
  align-items: center;
  padding: 10px 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 0.88rem;
}

.store-name {
  font-weight: 600;
}

.store-type {
  color: #6b7280;
}

.store-rate {
  color: #16a34a;
}

.store-cta {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-weight: 600;
  font-size: 0.8rem;
}

/* FAQ */

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.faq-item {
  background: var(--card-bg);
  padding: 16px 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.faq-item h3 {
  margin-top: 0;
  margin-bottom: 5px;
}

/* Footer */

.site-footer {
  margin-top: 24px;
  background: #ffffff;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  padding: 18px 16px 10px;
  font-size: 0.88rem;
}

.footer-bottom {
  text-align: center;
  padding: 10px 16px 14px;
  font-size: 0.8rem;
  color: #6b7280;
}

/* Chat page */

.chat-body {
  background: radial-gradient(circle at top left, #e0f2fe 0, #fdf2ff 40%, #f9fafb 100%);
}

.chat-main {
  padding: 18px 0 40px;
}

.chat-container {
  display: grid;
  gap: 18px;
}

.chat-intro {
  background: #ffffffdd;
  border-radius: 22px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-soft);
}

.chat-intro h1 {
  margin-top: 0;
  margin-bottom: 6px;
}

.chat-disclaimer {
  font-size: 0.85rem;
  color: #6b7280;
}

.chat-panel {
  background: #ffffffdd;
  border-radius: 22px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.chat-log {
  height: 340px;
  overflow-y: auto;
  border-radius: 18px;
  padding: 10px 10px 12px;
  background: #f3f4ff;
  border: 1px solid rgba(148, 163, 184, 0.5);
  margin-bottom: 10px;
}

.chat-message {
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.chat-message.user {
  text-align: right;
}

.chat-bubble {
  display: inline-block;
  padding: 8px 11px;
  border-radius: 14px;
  max-width: 80%;
}

.chat-message.user .chat-bubble {
  background: #2563eb;
  color: #fff;
  margin-left: 20%;
}

.chat-message.assistant .chat-bubble {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.chat-form {
  display: flex;
  gap: 10px;
}

.chat-form input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 10px 14px;
  font-size: 0.95rem;
}

/* Responsive */

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    height: auto;
    padding: 8px 0 10px;
  }
  .nav-links {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .hero-content {
    padding: 22px 18px 20px;
  }
  .hero-gradient {
    font-size: 2rem;
  }
  .hero-buttons > div {
    width: 100%;
  }
  .hero-buttons > div > span {
    font-size: 0.75rem;
    max-width: 100%;
  }

  /* Mobile chat fixes to prevent keyboard overlap */
  .chat-main {
    min-height: 100dvh;
    height: auto;
  }

  .chat-log {
    max-height: calc(100dvh - 280px);
    overflow-y: auto;
    padding-bottom: 96px;
  }

  .chat-form {
    position: sticky;
    bottom: 0;
  }

  .chat-footer {
    position: static;
  }
}
