:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --bg-softer: #020617;
  --accent: #f97316;
  --accent-soft: rgba(249, 115, 22, 0.12);
  --accent-strong: #ea580c;
  --text-main: #f9fafb;
  --text-soft: #9ca3af;
  --border-subtle: #1f2933;
  --danger: #ef4444;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.55);
  --shadow-subtle: 0 8px 24px rgba(15, 23, 42, 0.9);
  --transition-fast: 0.18s ease-out;
  --transition-med: 0.25s ease-out;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
}

/* Layout base */

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: radial-gradient(circle at top, #1f2937 0, #020617 55%, #000 100%);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Hero */

.hero {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), #020617);
  border-radius: var(--radius-lg);
  padding: 12px 12px 10px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(18px);
}

.hero-main {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.hero-text {
  flex: 1.1;
}

.hero-text h1 {
  font-size: 1.2rem;
  margin: 0 0 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e5e7eb;
}

.hero-text p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.hero-highlight {
  flex: 1;
  background: radial-gradient(circle at top left, #0f172a, #020617);
  border-radius: 16px;
  padding: 8px 9px;
  border: 1px solid rgba(249, 115, 22, 0.28);
  box-shadow: var(--shadow-subtle);
}

.hero-highlight-label {
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fed7aa;
  margin: 0 0 2px;
}

.hero-highlight-main {
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0 4px;
}

.hero-highlight-list {
  margin: 0;
  padding-left: 14px;
  list-style: none;
}

.hero-highlight-list li {
  position: relative;
  padding-left: 10px;
  font-size: 0.68rem;
  color: var(--text-soft);
  line-height: 1.3;
}

.hero-highlight-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
}

/* Tabs */

.tabs {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  background: rgba(15, 23, 42, 0.9);
  padding: 4px;
  border-radius: var(--radius-pill);
}

.tab {
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.7rem;
  padding: 5px 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast);
}

.tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #111827;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(249, 115, 22, 0.4);
}

.tab:active {
  transform: scale(0.97);
}

/* Panels */

.panel-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, #020617, #000);
  border: 1px solid rgba(31, 41, 55, 0.8);
  box-shadow: var(--shadow-soft);
  padding: 12px;
}

.panel {
  position: static;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
}

.panel + .panel {
  margin-top: 16px;
}

.panel-scroll {
  padding: 0;
  overflow: visible;
}

/* Scrollbar (mobile-safe but subtle) */

.panel-scroll::-webkit-scrollbar {
  width: 4px;
}

.panel-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.panel-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
}

/* Common text blocks */

.intro-text {
  margin: 0 0 10px;
  font-size: 0.74rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.tool-text,
.helper-text {
  margin: 4px 0 6px;
  font-size: 0.7rem;
  color: var(--text-soft);
  line-height: 1.4;
}

.step-list {
  margin: 0;
  margin-top: 4px;
  padding-left: 14px;
  font-size: 0.7rem;
  color: var(--text-soft);
  list-style: disc;
}

/* Steps */

h2 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.step {
  padding: 8px 9px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #020617, #020617);
  border: 1px solid rgba(31, 41, 55, 0.9);
}

.step--active {
  background: radial-gradient(circle at top left, rgba(249, 115, 22, 0.1), #020617);
  border-color: rgba(249, 115, 22, 0.6);
}

.step h3 {
  margin: 0 0 3px;
  font-size: 0.8rem;
}

.step p {
  margin: 0 0 4px;
  font-size: 0.72rem;
  color: var(--text-soft);
}

/* Cards */

.cards-grid {
  display: grid;
  gap: 8px;
}

.card {
  background: linear-gradient(145deg, #020617, #020617);
  border-radius: var(--radius-md);
  padding: 9px 9px 8px;
  border: 1px solid rgba(31, 41, 55, 0.9);
}

.card h3 {
  margin: 0 0 4px;
  font-size: 0.82rem;
}

.card p {
  margin: 0;
  font-size: 0.7rem;
  color: var(--text-soft);
}

.card-meta {
  margin-top: 5px;
  font-size: 0.68rem;
  color: #e5e7eb;
}

/* Tools */

.tool {
  margin-top: 10px;
  padding: 9px 9px 8px;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at top left, #020617, #020617);
  border: 1px solid rgba(31, 41, 55, 0.9);
}

.tool:first-of-type {
  margin-top: 0;
}

.tool h3 {
  margin: 0 0 4px;
  font-size: 0.82rem;
}

.tool-form {
  display: grid;
  gap: 6px;
  margin-bottom: 6px;
}

.field {
  display: grid;
  gap: 3px;
}

.field label {
  font-size: 0.68rem;
  color: var(--text-soft);
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #020617;
  border-radius: 999px;
  border: 1px solid rgba(31, 41, 55, 0.9);
  padding: 3px 8px;
}

.field-prefix,
.field-suffix {
  font-size: 0.72rem;
  color: var(--text-soft);
}

input,
select {
  border: none;
  background: transparent;
  color: var(--text-main);
  font: inherit;
  font-size: 0.78rem;
  outline: none;
  width: 100%;
}

select {
  border-radius: 999px;
  border: 1px solid rgba(31, 41, 55, 0.9);
  padding: 4px 8px;
  background: #020617;
}

/* Textarea for contacto */

textarea {
  border-radius: 12px;
  border: 1px solid rgba(31, 41, 55, 0.9);
  padding: 6px 8px;
  background: #020617;
  color: var(--text-main);
  font: inherit;
  font-size: 0.78rem;
  resize: vertical;
  min-height: 80px;
}

/* Buttons */

.btn-primary,
.btn-secondary {
  border-radius: var(--radius-pill);
  border: none;
  font-size: 0.74rem;
  padding: 5px 10px;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast);
  align-self: flex-start;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #111827;
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.96);
}

/* Summary */

.summary {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 4px;
  padding: 6px 8px;
  border-radius: 999px;
  background: #020617;
  border: 1px solid rgba(31, 41, 55, 0.9);
}

.summary-item {
  display: grid;
  gap: 2px;
}

.summary-item span {
  font-size: 0.64rem;
  color: var(--text-soft);
}

.summary-item strong {
  font-size: 0.8rem;
}

/* Gastos list */

.gastos-list {
  list-style: none;
  margin: 0;
  margin-top: 4px;
  padding: 0;
  display: grid;
  gap: 3px;
  max-height: 110px;
  overflow-y: auto;
}

.gastos-list::-webkit-scrollbar {
  width: 3px;
}

.gastos-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: 999px;
}

.gasto-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.7rem;
  padding: 4px 6px;
  border-radius: 999px;
  background: #020617;
  border: 1px solid rgba(31, 41, 55, 0.9);
}

.gasto-left {
  display: flex;
  gap: 6px;
  align-items: center;
}

.gasto-tag {
  font-size: 0.64rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-soft);
}

.gasto-monto {
  font-weight: 600;
}

/* Meta de ahorro */

.meta-result {
  margin: 4px 0 0;
  font-size: 0.7rem;
  color: var(--text-soft);
}

/* Blog */

.snippet {
  padding: 7px 8px 7px;
  border-radius: var(--radius-md);
  background: #020617;
  border: 1px solid rgba(31, 41, 55, 0.9);
}

.snippet + .snippet {
  margin-top: 6px;
}

.snippet h3 {
  margin: 0 0 4px;
  font-size: 0.8rem;
}

.snippet p {
  margin: 0 0 4px;
  font-size: 0.7rem;
  color: var(--text-soft);
}

/* Contacto */

.contact-block {
  display: grid;
  gap: 10px;
}

.contact-card {
  padding: 9px 9px 8px;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at top left, #020617, #020617);
  border: 1px solid rgba(31, 41, 55, 0.9);
}

.contact-text {
  margin: 4px 0 6px;
  font-size: 0.7rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
  display: grid;
  gap: 4px;
}

.contact-list li {
  font-size: 0.7rem;
  color: var(--text-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.contact-label {
  font-weight: 600;
  color: #e5e7eb;
}

.contact-list a {
  color: var(--accent);
  text-decoration: none;
}

.contact-list a:hover {
  text-decoration: underline;
}

/* Responsivo pequeño */

@media (max-width: 370px) {
  .hero-main {
    flex-direction: column;
  }

  .hero-highlight {
    order: -1;
  }
}