@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");


body {
  overflow-x: hidden;
}

.page {
  overflow-x: hidden;
}

html, body {
  overscroll-behavior-y: contain;
}

body {
  -webkit-overflow-scrolling: touch;
}

.site-header {
  will-change: transform;
  transform: translateZ(0);
}


/* ---------- CSS VARIABLES ---------- */

:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: rgba(0, 0, 0, 0.06);
}

.dark {
  --bg: #0b0f14;
  --card: #12161c;
  --text: #f5f7fa;
  --muted: #9ca3af;
  --border: #1f2933;
  --shadow: rgba(0, 0, 0, 0.6);
}

/* ---------- GLOBAL ---------- */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
}



/* ---------- HEADER ---------- */


.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 14px 20px;

  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(2px) saturate(160%);
  -webkit-backdrop-filter: blur(2px) saturate(160%);

  border-bottom: 1px solid rgba(0, 0, 0, 0.06);

  color: #111;
}

body.dark .site-header {
  background: rgba(10, 10, 10, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
  align-items: right;
  margin-left: -7px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.sun-icon {
  stroke: #111827; /* black in light mode */
  fill: none;
  transition: stroke 0.2s ease, transform 0.15s ease;
}

.sun-icon circle {
  fill: #111827;
}


/* DARK MODE */

.dark .sun-icon {
  stroke: #f5f7fa; /* white in dark mode */
}

.dark .sun-icon circle {
  fill: #f5f7fa;
}


/* ---------- PAGE LAYOUT ---------- */

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ---------- APP CARD ---------- */

.container {
  width: 100%;
  max-width: 420px;
  padding: 28px;
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px var(--shadow);
}

/* ---------- TYPOGRAPHY ---------- */

h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 22px 0;
  text-align: center;
}

/* ---------- INPUTS ---------- */

input {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 16px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder {
  color: var(--muted);
}

input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}
.inputs-wrapper {
    margin-left: 20px;
    min-width: 360px;
}

/* ---------- BUTTON ---------- */

/* LIGHT MODE BUTTON */
/* =========================
   BUTTON — LIGHT MODE
   ========================= */

button {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: #111827;

  /* Base ombre */
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    #f5f6f8 100%
  );

  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

/* LIGHT MODE HOVER */
button:hover {
  background: linear-gradient(
    180deg,
    #f9fafb 0%,
    #e5e7eb 100%
  );

  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);

  transform: translateY(-1px);
}

/* =========================
   BUTTON — DARK MODE
   ========================= */

.dark button {
  color: #f9fafb;

  background: linear-gradient(
    180deg,
    #30353c 0%,
    #1f2329 100%
  );

  border: 1px solid #2a2f36;

  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* DARK MODE HOVER */
.dark button:hover {
  background: linear-gradient(
    180deg,
    #3a3f46 0%,
    #262a30 100%
  );

  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);

  transform: translateY(-1px);
}



/* ---------- RESULT ---------- */

.result {
  margin-top: 22px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.03);
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  display: none; /* 👈 key fix */
}

.dark .result {
  background: rgba(255, 255, 255, 0.04);
}


/* ---------- TWO-COLUMN LAYOUT ---------- */

.layout {
  display: flex;
  gap: 18px;
  align-items: center;
}

/* RIGHT SIDE GRAPH */

#growthChart {
  display: block;
  width: 100%;
  height: 400px;
  min-height: 320px;
  margin-top: -30px;
}
.chart {
  position: relative;
  margin-left: 50px;
}


/* ---------- RESPONSIVE ---------- */

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
    align-items: center;
.inputs-wrapper {
    margin-left: 0px;
    margin-bottom: 30px;
}
  }

  .page {
    padding: 16px;
  }

  .chart-container {
    width: 100%;
    overflow-x: hidden;
  }

  body {
    padding-bottom: 16px;
  }


  .inputs-wrapper {
    margin-left: 20px;
    min-width: 320px;
}
}




.chart-total {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.dark .chart-total {
  color: #f5f7fa;
}


.input-label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
  margin-top: 14px;
}


.result-prefix {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.result-amount {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
}

.chart-total {
  line-height: 1.2;
}

.result-amount {
  letter-spacing: -0.6px;
}

.input-label,
.result-prefix {
  letter-spacing: 0.2px;
}

.toggle-row {
  display: flex;
  gap: 16px;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--muted);
}

.toggle-row input {
  margin-right: 6px;
}

.select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
}

.select:focus {
  border-color: var(--accent);
}


.inline-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: var(--muted);
  margin-top: 14px;
  margin-bottom: 6px;
}

.inline-select {
  font: inherit;
  color: var(--text);
  background: none;
  border: none;
  padding: 0 16px 0 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
}

.inline-select:focus {
  outline: none;
}

.inline-select {
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'>\
<path d='M1 1l4 4 4-4' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/>\
</svg>");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 10px 6px;
}
.dark .inline-select {
  background-size: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 8l5 5 5-5' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}


.money-inline {
  position: relative;
}

.money-inline input {
  width: 100%;
  padding: 11px 12px 11px 28px; /* tuned */
  font-size: 16px;
  line-height: 1.4;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

.money-inline input:focus {
  outline: none;
  border-color: var(--accent);
}

.money-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-102%); /* 👈 key fix */
  font-size: 14px;
  line-height: 1;
  color: #9ca3af; /* light grey */
  pointer-events: none;
}

.result-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  display: block;
}

.result-main {
  margin-bottom: 6px;
}

.result-prefix {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 2px;
}

.result-amount {
  font-size: 28px;
  font-weight: 500;
  color: var(--text);
}

.result-breakdown {
  padding-top: 7px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

input:focus {
  transition: box-shadow 0.15s ease;
}

.chart-menu {
  position: absolute;
  top: 16px;
  right: 45px;
  z-index: 10;
}

.chart-menu button {
  background: rgba(0,0,0,0.05);
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
}

.dark .chart-menu button {
  background: rgba(255,255,255,0.08);
  color: white;
}

.chart-menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  margin-top: 6px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  overflow: hidden;
}

.dark .chart-menu-dropdown {
  background: #0f172a;
}

.chart-menu-dropdown button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  background: none;
  border: none;
  font-size: 14px;
}

.chart-menu-dropdown button:hover {
  background: rgba(0,0,0,0.06);
}

.dark .chart-menu-dropdown button:hover {
  background: rgba(255,255,255,0.08);
}

.chart-menu-dropdown hr {
  border: none;
  border-top: 1px solid rgba(0,0,0,0.1);
}

canvas {
  touch-action: pan-y;
  display: block;
  max-width: 100%;
}

.menu-btn {
  background: none;
  border: none;
  padding: 0px;
  cursor: pointer;
  border-radius: 0px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-icon {
  color: #111;
}


/* Dark mode */
body.dark .menu-icon {
  color: #f5f7fa;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.theme-toggle:active {
  opacity: 0.55;
}

.chart-menu:active {
    opacity: 0.55;

}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 28px;

}

.app-menu {
  position: absolute;
  top: 56px;               /* just below header */
  left: 16px;              /* aligns under menu icon */
  width: 220px;

  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);

  border-radius: 14px;
  box-shadow:
    0 20px 40px rgba(0,0,0,0.12),
    0 1px 2px rgba(0,0,0,0.08);

  padding: 8px;
  display: none;
  z-index: 2000;
}

body.dark .app-menu {
  background: #10161f;
}

.app-menu.open {
  display: block;
}

.app-item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  color: inherit;
}

.app-item:hover {
  background: rgba(0,0,0,0.06);
}

.app-item:active {
    opacity: 0.55;
}

body.dark .app-item:hover {
  background: rgba(255,255,255,0.08);
}

.app-menu {
  transform: translateY(-4px);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.app-menu.open {
  opacity: 3;
  transform: translateY(0);
}

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.auth-overlay.hidden {
  display: none;
}

.auth-modal {
  width: 100%;
  max-width: 380px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.25s ease;
  position: relative;
}

body.dark .auth-modal {
  background: #12161b;
}

.auth-modal h2 {
  margin: 0 0 8px;
}

.auth-modal p {
  font-size: 14px;
  opacity: 0.75;
  margin-bottom: 16px;
}

.auth-modal input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.1);
  margin-bottom: 12px;
}

.auth-modal button {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

#magic-link-btn {
  background: #111827;
  color: white;
}

body.dark #magic-link-btn {
  background: white;
  color: black;
}

.auth-close {
  position: absolute;
  top: 8px;
  right: 22px;
  background: none;
  font-size: 28px;
  opacity: 0.6;
  cursor: pointer;
  pointer-events: auto;
}


@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}



.login-btn {
  appearance: none;
  font-family: "Manrope";
  font-size: 15px;
  font-weight: 500;
  color: #111827;
  cursor: pointer;
  transition: 
    background 0.2s ease,
    border-color 0.2s ease,
    opacity 0.2s ease;
}

/* Hover */
.login-btn:hover {
opacity: .55;
}

/* Active (press) */
.login-btn:active {
  opacity: 0.7;
}

/* Dark mode */
.dark .login-btn {
  color: #f5f7fa;
}


.scenario-label strong {
  color: var(--text-primary);
  font-weight: 600;
}

.scenario-total {
  margin-left: 4px;
  color: var(--text-muted);
}

.scenario-arrow {
  all: unset;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.scenario-arrow:hover {
  background: rgba(0,0,0,0.04);
}

.dark .scenario-arrow:hover {
  background: rgba(255,255,255,0.06);
}


.scenario-add:hover {
  background: rgba(0,0,0,0.04);
}

.dark .scenario-add:hover {
  background: rgba(255,255,255,0.06);
}


.scenario-arrow.disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

.scenario-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-text, #6b7280);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.scenario-indicator.visible {
  opacity: 1;
  transform: translateY(0);
}

.scenario-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #111;
}


.ad-slot {
  max-width: 900px;
  width: 100%;
  margin: 32px auto;
  padding: 0 12px;
  box-sizing: border-box;
}

.ad-mock {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 16px;
  padding: 18px 20px;
  position: relative;
}

body.dark .ad-mock {
  background: rgba(255, 255, 255, 0.05);
}

.ad-label {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 11px;
  color: #9ca3af;
}

.ad-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.ad-text {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 10px;
}

body.dark .ad-text {
  color: #9ca3af;
}

.ad-cta {
  font-size: 14px;
  font-weight: 500;
  color: #2563eb;
  cursor: pointer;
}

.ad-cta:hover {
  text-decoration: underline;
}

.chart-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.ad-slot {
  width: 100%;
  max-width: 720px;
  margin: 40px auto 0;
  padding: 0 16px;
  box-sizing: border-box;
}

.chart {
  width: 100%;
  max-width: 720px;
  min-height: 420px; /* 🔥 REQUIRED */
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: -30px;
}

.chart-column {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.chart canvas {
  width: 100%;
  height: 100%;
}

.scenario-add {
  background: none;
  border: none;
  padding: 0;
  margin-left: auto;

  font-size: 13px;
  font-weight: 500;
  color: #6b7280;

  cursor: pointer;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.scenario-add:hover {
  color: #111827;
}

.dark .scenario-add {
  color: #9ca3af;
}

.dark .scenario-add:hover {
  color: #f5f7fa;
}


.scenario-arrow {
  font-size: 18px;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  user-select: none;

  transition: color 0.15s ease, opacity 0.15s ease;
}

.scenario-arrow:hover {
  color: #111827;
}

.dark .scenario-arrow {
  color: #6b7280;
}

.dark .scenario-arrow:hover {
  color: #f5f7fa;
}

.scenario-arrow.hidden {
  opacity: 0;
  pointer-events: none;
}







.scenario-row {
  display: flex;
  align-items: center;
  justify-content: center; /* Add this */
  margin-top: 18px;
  margin-bottom: -30px;
}

.scenario-switcher {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: inset 0 0 0 1px var(--border-subtle);
}

.scenario-label {
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 0.2px;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.scenario-add-row {
  display: flex;
  justify-content: center;
  margin-top: -20px;
  margin-bottom: 2px;
}