/* Theme: black, greyish white, orangey yellow */
:root {
  --bg: #0f1114;
  --card: #1a1d21;
  --text: #f1f3f5;
  --muted: #c9ced6;
  --accent: #ffb74d; /* orangey yellow */
  --accent-strong: #ff9800;
  --border: #2a2f36;
  --shadow: rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: linear-gradient(180deg, #0c0e10, var(--bg));
  color: var(--text);
}

.page { max-width: 980px; margin: 0 auto; padding: 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; }
.logo { margin: 0; font-size: 22px; letter-spacing: 0.5px; color: var(--text); }
.actions { display: flex; gap: 12px; }

.hero { margin-top: 32px; padding: 32px; border: 1px solid var(--border); border-radius: 16px; background: radial-gradient(80% 80% at 50% 0%, #15181c, var(--card)); box-shadow: 0 10px 30px var(--shadow); }
.hero-title { margin: 0 0 6px; font-weight: 600; }
.hero-sub { margin: 0; color: var(--muted); }

.btn { appearance: none; border: 1px solid transparent; border-radius: 10px; padding: 10px 14px; font-weight: 600; cursor: pointer; transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border 160ms ease; }
.btn.primary { background: var(--accent-strong); color: #141414; border-color: #ffb65a; }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255,152,0,0.35); }
.btn.accent { background: var(--accent); color: #141414; border-color: #ffcd85; }
.btn.accent:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255,183,77,0.35); }
.btn.dark-orange { background: #ff8c00; color: #141414; border-color: #ff9800; }
.btn.dark-orange:hover { background: #ffa726; box-shadow: 0 6px 18px rgba(255,167,38,0.35); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { border-color: #3a4048; background: #121519; }
.btn.muted { background: #272b31; color: var(--muted); border-color: #333941; }
.btn.muted:hover { background: #2b3037; }

/* Purple–Pink–Yellow gradient button */
.btn.gradient {
  background: linear-gradient(90deg, #7c4dff 0%, #ff4081 50%, #ffd54f 100%);
  background-size: 200% 100%;
  color: #ffffff;
  border-color: transparent;
}
.btn.gradient:hover {
  background-position: right center;
  box-shadow: 0 8px 22px rgba(124,77,255,0.35), 0 6px 16px rgba(255,64,129,0.25);
  transform: translateY(-1px);
}

.row { display: flex; gap: 12px; margin-top: 16px; }
.row.soft { justify-content: flex-end; }

/* Modal base */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 50; }
.modal[aria-hidden="false"] { display: flex; }
.overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(2px); }

.modal-card { position: relative; width: min(680px, 92vw); border-radius: 16px; border: 1px solid var(--border); background: linear-gradient(180deg, #171a1f, var(--card)); box-shadow: 0 18px 50px var(--shadow); padding: 22px; overflow: hidden; }
.form-popup { width: min(520px, 92vw); }
.instruction-card { width: min(720px, 94vw); }
.close-x { position: absolute; top: 8px; right: 12px; font-size: 28px; line-height: 1; border: none; background: transparent; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.close-x:hover { color: var(--text); }

/* Inputs */
.form-container label, .input-group label { display: block; margin: 14px 0 8px; color: var(--muted); font-weight: 600; }
.form-container input, .input-group input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid #2f343b; background: #121519; color: var(--text); }
.form-container input::placeholder, .input-group input::placeholder { color: #808792; }
.hint { display: block; margin-top: 6px; color: #98a1ad; font-size: 12px; }

/* Wizard */
.wizard { position: relative; min-height: 320px; }
.step { animation: fadeSlideIn 320ms ease both; }
.step.leaving { animation: fadeSlideOut 280ms ease both; }
.disclaimer { margin: 8px 0 16px; padding-left: 18px; color: var(--muted); }
.disclaimer li { margin: 6px 0; }
.disclaimer-note { margin: 8px 0 16px; color: #98a1ad; font-size: 13px; }
.result-text { margin: 8px 0 2px; padding: 14px; border: 1px dashed #3a4048; border-radius: 12px; background: #121519; color: var(--text); }

/* Chart rendering */
.chart-container { margin-top: 14px; }
.chart-heading { margin: 8px 0; font-weight: 700; letter-spacing: 0.6px; }
.chart-image { 
  width: 100%;
  max-width: 520px;        /* keep image from stretching too wide */
  max-height: 300px;       /* limit vertical size inside popup */
  height: auto;
  object-fit: contain;
  margin: 8px auto;        /* center and add breathing space */
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px var(--shadow);
  display: block;
}
.chart-title { margin: 8px 0; color: var(--muted); font-weight: 600; }
.chart-table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.chart-table thead th { background: #20252b; color: var(--muted); font-weight: 700; padding: 10px; border-bottom: 1px solid var(--border); }
.chart-table tbody td { padding: 10px; border-bottom: 1px solid #2a2f36; }
.chart-table tbody tr:nth-child(even) { background: #171b20; }
.chart-table .recommended { background: rgba(255, 183, 77, 0.12); box-shadow: inset 0 0 0 999px rgba(255, 183, 77, 0.08); }
.chart-note { margin-top: 8px; color: #8e97a3; font-size: 12px; }

/* Small inline disclaimer near actions */
.inline-disclaimer { margin: 4px 0 6px; color: #d8a24d; font-size: 12px; text-align: right; }

/* Slide-in for modal card */
.slide-in { animation: dropIn 420ms cubic-bezier(.21,1,.21,1) both; }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-16px); }
}