@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@300;400;500&display=swap');

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

:root {
  --white: #ffffff;
  --off-white: #fafaf8;
  --ink: #1a1a18;
  --ink-light: #555550;
  --ink-muted: #999990;
  --border: #e4e4e0;
  --border-light: #f0f0ec;
  --accent: #2d5a3d;
  --accent-light: #f0f5f2;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.12);
  --radius: 14px;
  --radius-sm: 8px;
}

html, body { height: 100%; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--off-white);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── NAV ─────────────────────────────── */
nav {
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 48px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo { display: flex; align-items: center; text-decoration: none; }
.nav-logo-img { height: 36px; width: auto; object-fit: contain; }
.nav-links { display: flex; gap: 36px; list-style: none; }
.nav-links a { font-size: 14px; color: var(--ink-muted); text-decoration: none; transition: color 0.2s; }
.nav-links a:hover { color: var(--ink); }

/* ── PAGE WRAPPER ─────────────────────── */
.page-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  padding: 32px 24px 24px;
  overflow: visible;
  position: relative;
  z-index: 0;
}

/* ── HERO ─────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  animation: fadeUp 0.6s ease both;
}

.hero-logo-wrap { display: flex; justify-content: center; }
.hero-logo { height: 170px; width: auto; object-fit: contain; }

.hero-subtitle {
  font-size: 16px;
  color: var(--ink-light);
  line-height: 1.65;
  font-weight: 300;
  max-width: 440px;
}

/* ── DROPDOWN ─────────────────────────── */
.dropdown-wrap {
  position: relative;
  z-index: 500;
  width: 420px;
  animation: fadeUp 0.6s 0.1s ease both;
}

.dropdown-trigger {
  width: 100%;
  padding: 15px 20px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--ink-muted);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.dropdown-trigger:hover, .dropdown-trigger.open { border-color: var(--ink); box-shadow: var(--shadow-md); }
.dropdown-trigger.has-value { color: var(--ink); font-weight: 500; }
.dropdown-trigger .chevron { width: 16px; height: 16px; flex-shrink: 0; transition: transform 0.25s ease; color: var(--ink-muted); }
.dropdown-trigger.open .chevron { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px); left: 0; right: 0;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 99999;
  overflow: hidden;
  animation: dropIn 0.18s ease both;
}

.dropdown-search { padding: 12px 16px; border-bottom: 1px solid var(--border-light); }
.dropdown-search input { width: 100%; border: none; outline: none; font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--ink); background: transparent; }
.dropdown-search input::placeholder { color: var(--ink-muted); }

.dropdown-list { max-height: 220px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.dropdown-list::-webkit-scrollbar { width: 4px; }
.dropdown-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.dropdown-item { padding: 11px 16px; font-size: 14px; color: var(--ink-light); cursor: pointer; display: flex; align-items: center; justify-content: space-between; transition: background 0.12s, color 0.12s; }
.dropdown-item:hover { background: var(--off-white); color: var(--ink); }
.dropdown-item.selected { background: var(--accent-light); color: var(--ink); font-weight: 500; }
.check-icon { width: 14px; height: 14px; color: var(--accent); }
.dropdown-empty { padding: 20px 16px; font-size: 14px; color: var(--ink-muted); text-align: center; }

/* ── FEATURES ─────────────────────────── */
.features {
  width: 100%;
  max-width: 860px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  position: relative;
  z-index: 0;
  animation: fadeUp 0.6s 0.2s ease both;
}

.feature-card {
  background: var(--white);
  padding: 28px 24px;
  text-align: center;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
  position: relative;
  z-index: 0;
}
.feature-card:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.feature-card:last-child  { border-radius: 0 var(--radius) var(--radius) 0; }
.feature-card:hover { box-shadow: var(--shadow-md); }

.feature-icon { font-size: 26px; margin-bottom: 12px; }
.feature-title { font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 400; color: var(--ink); margin-bottom: 8px; }
.feature-desc { font-size: 13px; color: var(--ink-muted); line-height: 1.5; font-weight: 300; }

/* ── RESULT CARD ──────────────────────── */
.result-section { max-width: 680px; margin: 0 auto 40px; padding: 0 24px; }
.result-card { background: var(--white); border: 1px solid var(--border); border-radius: 20px; padding: 36px; box-shadow: var(--shadow-md); animation: fadeUp 0.35s ease both; }
.result-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border-light); }
.result-name { font-family: 'Playfair Display', serif; font-size: 38px; font-weight: 400; letter-spacing: -1px; color: var(--ink); margin-bottom: 4px; }
.result-region { font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--ink-muted); }
.result-badge { background: var(--accent-light); color: var(--accent); padding: 6px 14px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.result-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 20px; margin-bottom: 24px; }
.stat-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 4px; }
.stat-value { font-size: 17px; font-weight: 500; color: var(--ink); font-family: 'Playfair Display', serif; }
.result-fact { background: var(--off-white); border-left: 3px solid var(--accent); padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 14px; color: var(--ink-light); line-height: 1.6; font-style: italic; font-family: 'Playfair Display', serif; }

/* ── FOOTER ───────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 14px 48px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  background: var(--white); flex-shrink: 0;
}
.footer-text { font-size: 12px; color: var(--ink-muted); }
.footer-links { display: flex; gap: 20px; list-style: none; }
.footer-links a { font-size: 12px; color: var(--ink-muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--ink); }

/* ── ANIMATIONS ───────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* ── BONDS PAGE ───────────────────────── */
.bonds-header {
  margin-bottom: 28px;
  padding-top: 8px;
}

.bonds-header-top {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}
.back-btn svg { width: 15px; height: 15px; }
.back-btn:hover { border-color: var(--ink); color: var(--ink); box-shadow: var(--shadow-sm); }

.bonds-title-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bonds-title {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.bonds-state-badge {
  background: var(--accent-light);
  color: var(--accent);
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
}

.bonds-search-wrap {
  position: relative;
  margin-bottom: 12px;
}
.bonds-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--ink-muted);
  pointer-events: none;
}
.bonds-search-input {
  width: 100%;
  padding: 14px 20px 14px 44px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.bonds-search-input::placeholder { color: var(--ink-muted); }
.bonds-search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45,90,61,0.08); }

.bond-count {
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: 4px;
}

.bonds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.bond-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.15s;
}
.bond-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.bond-card:hover .bond-arrow { color: var(--accent); transform: translateX(3px); }

.bond-card-inner { flex: 1; min-width: 0; }
.bond-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}
.bond-amount {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  margin-top: 3px;
  font-family: 'DM Sans', sans-serif;
}

.bond-arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--ink-muted);
  transition: color 0.18s, transform 0.18s;
}

.bonds-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  font-size: 14px;
  color: var(--ink-muted);
}

/* ── BONDS PAGE RESPONSIVE ────────────── */
@media (max-width: 640px) {
  .bonds-grid { grid-template-columns: 1fr; }
  .bonds-title { font-size: 26px; }
}

/* ── SCROLLABLE BONDS PAGE ────────────── */
body.bonds-view { overflow: auto; }

@media (max-width: 640px) {
  nav { padding: 0 20px; }
  .dropdown-wrap { width: 100%; }
  .features { grid-template-columns: 1fr; }
  .feature-card:first-child { border-radius: var(--radius) var(--radius) 0 0; }
  .feature-card:last-child  { border-radius: 0 0 var(--radius) var(--radius); }
  footer { padding: 14px 20px; }
}
