:root {
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #d1fae5;
  --accent: #f59e0b;
  --surface: #ffffff;
  --bg: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(5, 150, 105, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(5, 150, 105, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
}

.top-bar-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.15s;
}

.back-link:hover {
  color: var(--primary);
}

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  flex: 1;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background-color: var(--primary-light);
  color: var(--primary-hover);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.title {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 650px;
  margin: 0 auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.input-with-symbol {
  position: relative;
  display: flex;
  align-items: center;
}

.input-symbol-prefix {
  position: absolute;
  left: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
}

.input-symbol-suffix {
  position: absolute;
  right: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-main);
  background-color: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input.has-suffix {
  padding-right: 2rem;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.form-select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-main);
  background-color: #fff;
  cursor: pointer;
}

/* Term quick chips */
.term-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.term-chip {
  background: #f1f5f9;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s;
}

.term-chip:hover {
  background: #e2e8f0;
}

.term-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary-hover);
}

/* Result Hero Box */
.result-hero {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  text-align: center;
  margin-bottom: 1.75rem;
  box-shadow: 0 10px 25px -5px rgba(5, 150, 105, 0.35);
}

.hero-pill {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.2);
  margin-bottom: 0.75rem;
}

.hero-interest-title {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}

.hero-interest-amount {
  font-size: 3.2rem;
  font-weight: 900;
  font-family: var(--font-mono);
  line-height: 1.1;
  margin-bottom: 0.3rem;
  letter-spacing: -1px;
}

.hero-ending-balance {
  font-size: 1.15rem;
  font-weight: 700;
  opacity: 0.95;
  background: rgba(0, 0, 0, 0.18);
  display: inline-block;
  padding: 0.4rem 1.25rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
}

.hero-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  text-align: left;
}

.meta-box {
  background: rgba(255, 255, 255, 0.14);
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.meta-box .label {
  opacity: 0.85;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 0.2rem;
}

.meta-box .value {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

/* Comparison Terms Table */
.benchmark-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.benchmark-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.benchmark-table th:first-child, .benchmark-table td:first-child {
  text-align: left;
}

.benchmark-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
}

.benchmark-table tr.highlighted {
  background: var(--primary-light);
  font-weight: 700;
}

/* FAQ Accordion */
.faq-section {
  margin-top: 2rem;
}

.faq-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.6rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1rem 1.25rem;
  text-align: left;
  background: none;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-answer {
  padding: 0 1.25rem 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

.faq-icon {
  transition: transform 0.2s ease;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Cross sell */
.cross-sell {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.cross-sell h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.cross-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.cross-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.cross-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.cross-icon {
  font-size: 1.5rem;
}

.cross-info strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text-main);
}

.cross-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.footer a {
  color: var(--primary);
  text-decoration: none;
}
