/* ═══════════════════════════════════════════════
   InmoCalc – styles.css
   Fintech · Minimal · Professional
═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800&family=DM+Mono:wght@400;500;600&display=swap');

/* ── VARIABLES ── */
:root {
  --navy:        #0F2354;
  --blue:        #1E3A8A;
  --blue-mid:    #2554C7;
  --blue-light:  #3B82F6;
  --blue-pale:   #EFF6FF;
  --blue-glow:   rgba(59,130,246,0.12);
  --green:       #10B981;
  --green-light: #D1FAE5;
  --green-dark:  #059669;
  --green-glow:  rgba(16,185,129,0.12);
  --gold:        #F59E0B;
  --gold-light:  #FEF3C7;
  --gold-dark:   #B45309;
  --white:       #FFFFFF;
  --surface:     #F8FAFF;
  --surface2:    #EEF2FF;
  --border:      #E2E8F0;
  --border-dark: #CBD5E1;
  --text:        #0F172A;
  --text1:       #0F172A;
  --text2:       #475569;
  --text3:       #94A3B8;
  --surface1:    #FFFFFF;
  --red:         #EF4444;
  --red-light:   #FEE2E2;

  --radius:    16px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow:    0 4px 24px rgba(15,35,84,0.09);
  --shadow-lg: 0 8px 40px rgba(15,35,84,0.15);

  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;

  --header-h: 64px;
  --nav-h:    64px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--text);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}
button { font-family: var(--font-body); cursor: pointer; border: none; background: none; }
input { font-family: var(--font-body); }
a { text-decoration: none; color: inherit; }

/* ── APP SHELL ── */
#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: var(--surface);
}

/* ── SCREENS ── */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.screen.active { display: flex; }

/* ── SCREEN HEADER ── */
.screen-header {
  background: linear-gradient(160deg, var(--navy) 0%, var(--blue) 100%);
  padding: 52px 20px 20px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.screen-header::before {
  content: '';
  position: absolute; top: -50px; right: -50px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.screen-header::after {
  content: '';
  position: absolute; bottom: -30px; left: 20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  pointer-events: none;
}
.header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  position: relative; z-index: 1;
}
.back-btn {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.13);
  border-radius: 9px;
  color: white;
  font-size: 20px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.18);
  transition: background 0.15s;
}
.back-btn:hover { background: rgba(255,255,255,0.22); }
.header-badge {
  font-size: 10px; font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.2);
  letter-spacing: 0.05em;
}
.header-title {
  font-size: 19px; font-weight: 800;
  color: white;
  position: relative; z-index: 1;
  letter-spacing: -0.4px;
  margin-bottom: 3px;
}
.header-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  position: relative; z-index: 1;
}

/* ── SCROLL BODY ── */
.screen-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: calc(var(--nav-h) + 16px);
}
.screen-body::-webkit-scrollbar { display: none; }
.screen-content {
  padding: 18px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

/* ── HOME SCREEN ── */
#home .screen-header {
  background: linear-gradient(160deg, #071535 0%, var(--navy) 50%, #163380 100%);
  padding: 56px 20px 28px;
}
.home-logo-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
  position: relative; z-index: 1;
}
.app-icon-wrap {
  width: 46px; height: 46px;
  background: rgba(255,255,255,0.13);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  border: 1px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}
.app-name-block .name { font-size: 20px; font-weight: 800; color: white; letter-spacing: -0.5px; }
.app-name-block .tagline { font-size: 10px; color: rgba(255,255,255,0.55); margin-top: 1px; }
.home-greeting {
  position: relative; z-index: 1;
  font-size: 13px; color: rgba(255,255,255,0.7);
}
.home-greeting strong { color: white; }
.home-date {
  position: relative; z-index: 1;
  font-size: 10px; color: rgba(255,255,255,0.4);
  font-family: var(--font-mono);
  margin-top: 3px;
}

/* ── CALC CARDS (home) ── */
.calc-card {
  background: white;
  border-radius: var(--radius);
  padding: 15px 44px 15px 15px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  display: flex; align-items: center; gap: 13px;
  box-shadow: 0 2px 8px rgba(15,35,84,0.05);
  position: relative;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.calc-card::after {
  content: '›';
  position: absolute; right: 16px;
  font-size: 22px; color: var(--text3);
  font-weight: 300; top: 50%; transform: translateY(-50%);
}
.calc-card:active { transform: scale(0.98); box-shadow: 0 1px 4px rgba(15,35,84,0.08); }
.card-icon {
  width: 48px; height: 48px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 23px; flex-shrink: 0;
}
.card-icon.ir      { background: #EFF6FF; }
.card-icon.alc     { background: #F0FDF4; }
.card-icon.hip     { background: #FFF7ED; }
.card-title        { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.card-desc         { font-size: 11px; color: var(--text2); line-height: 1.4; }

/* ── VERSION SECTION (home) ── */
.version-box {
  background: white;
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1.5px solid var(--border);
}
.version-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.version-label { font-size: 12px; color: var(--text2); font-weight: 500; }
.badge {
  font-size: 9px; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px;
}
.badge-basic { background: var(--surface2); color: var(--blue); }
.badge-pro   { background: var(--green-light); color: var(--green-dark); }
.badge-plus  { background: var(--gold-light); color: var(--gold-dark); }
.upgrade-row { display: flex; gap: 8px; }
.upgrade-btn {
  flex: 1; padding: 9px 6px;
  border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 700;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-pro  { background: var(--green-light); color: var(--green-dark); border: 1.5px solid #A7F3D0; }
.btn-plus { background: var(--gold-light);  color: var(--gold-dark);  border: 1.5px solid #FCD34D; }
.upgrade-btn:active { transform: scale(0.97); }

/* ── SECTION LABEL ── */
.section-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.10em;
  color: var(--text3); padding: 0 2px;
}

/* ── INFO BANNER ── */
.info-banner {
  background: var(--blue-glow);
  border: 1.5px solid rgba(59,130,246,0.22);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  display: flex; gap: 10px; align-items: flex-start;
}
.info-icon { font-size: 15px; flex-shrink: 0; padding-top: 1px; }
.info-text { font-size: 11px; color: #1D4ED8; line-height: 1.55; }
.info-text strong { display: block; font-size: 12px; font-weight: 700; margin-bottom: 3px; color: var(--blue); }

/* ── FORM ELEMENTS ── */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text2);
}
.form-label .opt { font-weight: 400; color: var(--text3); text-transform: none; letter-spacing: 0; }
.input-wrap { position: relative; display: flex; align-items: center; }
.prefix {
  position: absolute; left: 12px; z-index: 1;
  font-size: 13px; font-weight: 600;
  color: var(--text3); font-family: var(--font-mono);
  pointer-events: none;
}
.suffix {
  position: absolute; right: 12px; z-index: 1;
  font-size: 13px; font-weight: 600;
  color: var(--text3); font-family: var(--font-mono);
  pointer-events: none;
}
.form-input {
  width: 100%; height: 46px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px 0 38px;
  font-size: 15px; font-weight: 600;
  color: var(--text);
  font-family: var(--font-mono);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  -webkit-appearance: none; appearance: none;
}
.form-input.no-pre  { padding-left: 12px; }
.form-input.has-suf { padding-right: 36px; }
.form-input:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.form-input::placeholder { color: var(--text3); font-weight: 400; font-size: 13px; }
.form-hint { font-size: 10px; color: var(--text3); font-style: italic; padding: 0 2px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); }

/* ── CALC BUTTON ── */
.calc-btn {
  width: 100%; height: 52px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 15px; font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 18px rgba(30,58,138,0.32);
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  -webkit-tap-highlight-color: transparent;
}
.calc-btn:active { transform: scale(0.98); box-shadow: 0 2px 8px rgba(30,58,138,0.2); }
.calc-btn:disabled { opacity: 0.5; pointer-events: none; }

/* ── RESULT CARD ── */
.result-card {
  background: linear-gradient(145deg, var(--navy) 0%, #163370 100%);
  border-radius: var(--radius);
  padding: 18px 16px;
  color: white;
  position: relative; overflow: hidden;
  display: none;
}
.result-card.visible { display: block; }
.result-card::before {
  content: '';
  position: absolute; top: -30px; right: -30px;
  width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255,255,255,0.05); pointer-events: none;
}
.result-card::after {
  content: '';
  position: absolute; bottom: -20px; left: 10px;
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,0.03); pointer-events: none;
}
.result-main-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.10em;
  color: rgba(255,255,255,0.55); margin-bottom: 5px;
}
.result-main-value {
  font-size: 30px; font-weight: 800;
  font-family: var(--font-mono);
  color: white; letter-spacing: -1px;
  margin-bottom: 14px;
}
.result-main-value .currency { font-size: 16px; font-weight: 600; color: rgba(255,255,255,0.65); margin-right: 4px; }
.result-rows { display: flex; flex-direction: column; gap: 0; position: relative; z-index: 1; }
.result-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.09);
}
.result-row:last-child { border-bottom: none; }
.rr-label { font-size: 11px; color: rgba(255,255,255,0.58); }
.rr-val   { font-size: 12px; font-weight: 700; color: white; font-family: var(--font-mono); }
.rr-val.accent { color: #34D399; }
.result-note { font-size: 9px; color: rgba(255,255,255,0.38); margin-top: 10px; font-style: italic; }

/* ── SAVE BUTTON ── */
.save-btn {
  width: 100%; height: 46px;
  background: var(--green-light);
  border: 1.5px solid #A7F3D0;
  border-radius: var(--radius-sm);
  color: var(--green-dark);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: transform 0.18s, box-shadow 0.18s;
  -webkit-tap-highlight-color: transparent;
  display: none;
}
.save-btn.visible { display: flex; }
.save-btn:active { transform: scale(0.98); }

/* ── ERROR MESSAGE ── */
.error-msg {
  background: var(--red-light);
  border: 1.5px solid #FECACA;
  border-radius: var(--radius-xs);
  padding: 10px 13px;
  font-size: 12px; color: var(--red);
  font-weight: 600;
  display: none;
}
.error-msg.visible { display: block; }

/* ── FORM SECTION BLOCK ── */
.form-section {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 13px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-section-title {
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.10em;
  color: var(--blue);
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--surface2);
  display: flex; align-items: center; gap: 6px;
}

/* ── BUTTON ROW ── */
.btn-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}
.btn-row .calc-btn { border-radius: var(--radius-sm); }

/* ── CLEAR BUTTON ── */
.clear-btn {
  height: 52px;
  padding: 0 16px;
  background: white;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.clear-btn:hover  { background: var(--red-light); border-color: #FECACA; color: var(--red); }
.clear-btn:active { transform: scale(0.97); }

/* ── SLIDER ── */
.slider-wrap {
  display: flex; flex-direction: column; gap: 6px;
}
.slider-header {
  display: flex; justify-content: space-between; align-items: center;
}
.slider-pct {
  font-size: 20px; font-weight: 800;
  color: var(--blue); font-family: var(--font-mono);
}
.slider-monto {
  font-size: 11px; color: var(--text3);
  font-family: var(--font-mono); font-weight: 500;
}
input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px;
  background: var(--surface2);
  border-radius: 10px; outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--blue);
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(30,58,138,0.35);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
input[type=range]:active::-webkit-slider-thumb {
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(30,58,138,0.45);
}
input[type=range]::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--blue);
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(30,58,138,0.35);
  cursor: pointer;
}
.slider-ticks {
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--text3);
  font-family: var(--font-mono); padding: 0 2px;
}

/* ── CREDIT DISPLAY ── */
.credito-display {
  background: var(--blue-glow);
  border: 1.5px solid rgba(59,130,246,0.22);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  display: flex; justify-content: space-between; align-items: center;
}
.credito-label { font-size: 11px; color: var(--blue); font-weight: 600; }
.credito-valor { font-size: 16px; font-weight: 800; color: var(--blue); font-family: var(--font-mono); }

/* ── TOGGLE MONEDA ── */
.moneda-toggle {
  display: flex; gap: 0;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 3px;
  width: 100%;
}
.moneda-opt {
  flex: 1; height: 38px;
  border-radius: 8px;
  font-size: 13px; font-weight: 700;
  color: var(--text3);
  transition: all 0.18s;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.moneda-opt.active {
  background: white;
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(15,35,84,0.10);
}
.moneda-opt:active { transform: scale(0.97); }

/* ── PLANS SCREEN ── */
.plan-card {
  border-radius: var(--radius);
  padding: 17px 16px;
  border: 2px solid transparent;
  position: relative; overflow: hidden;
}
.plan-card.basic { background: white; border-color: var(--border); }
.plan-card.pro   { background: linear-gradient(145deg, #ECFDF5, #D1FAE5); border-color: #A7F3D0; }
.plan-card.pro.plan-active {
  background: linear-gradient(145deg, #0F2354, #163370);
  border-color: #10B981;
  border-width: 2px;
  box-shadow: 0 8px 32px rgba(16,185,129,0.25);
}
.plan-card.pro.plan-active .plan-name  { color: #ffffff; }
.plan-card.pro.plan-active .plan-desc  { color: rgba(255,255,255,0.7); }
.plan-card.pro.plan-active .feat-text  { color: rgba(255,255,255,0.85); }
.plan-card.pro.plan-active .feat-icon  { filter: none; }
.plan-card.plus  { background: linear-gradient(145deg, #FFFBEB, #FEF3C7); border-color: #FCD34D; }
.plan-tag {
  position: absolute; top: 13px; right: 13px;
  font-size: 9px; font-weight: 800;
  padding: 3px 9px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.tag-active  { background: var(--blue); color: white; }
.tag-soon    { background: #374151; color: white; }
.tag-pro-on  { background: #10B981; color: white; }
.tag-upgrade { background: #ECFDF5; color: var(--green-dark); border: 1px solid #A7F3D0; font-weight: 700; }
.plan-name  { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 5px; }
.plan-desc  { font-size: 11px; color: var(--text2); margin-bottom: 13px; line-height: 1.45; }
.plan-features { display: flex; flex-direction: column; gap: 7px; }
.feat-row { display: flex; align-items: flex-start; gap: 8px; }
.feat-icon { font-size: 13px; flex-shrink: 0; }
.feat-text { font-size: 11px; line-height: 1.4; color: var(--text2); }
.feat-text.locked { color: var(--text3); }
.plans-cta--pro {
  background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(16,185,129,0.04));
  border-color: rgba(16,185,129,0.3);
}
.plans-cta--pro p { color: var(--text2); }
.plans-cta--pro strong { color: var(--green-dark); }

.plans-cta {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}
.plans-cta p { font-size: 12px; color: var(--text2); line-height: 1.5; }
.plans-cta strong { color: var(--text); }

.btn-comprar-pro {
  display: block;
  width: 100%;
  margin: 12px 0 6px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(16,185,129,0.35);
  transition: opacity 0.2s, transform 0.1s;
}
.btn-comprar-pro:active   { transform: scale(0.98); opacity: 0.9; }
.btn-comprar-pro:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.plans-cta-note {
  font-size: 10px !important;
  color: var(--text3) !important;
  margin-top: 4px;
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 430px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}
.nav-item:active { opacity: 0.7; }
.nav-icon  { font-size: 20px; line-height: 1; }
.nav-label { font-size: 9px; font-weight: 600; color: var(--text3); letter-spacing: 0.04em; }
.nav-item.active .nav-label { color: var(--blue); }

/* ── TOAST ── */
#toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: white;
  font-size: 13px; font-weight: 600;
  padding: 11px 20px;
  border-radius: 30px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  z-index: 200;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
#toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ── LOADING OVERLAY ── */
#loading {
  position: fixed; inset: 0;
  background: var(--navy);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  z-index: 999;
  transition: opacity 0.4s;
}
#loading.hidden { opacity: 0; pointer-events: none; }
.loading-icon { font-size: 52px; animation: pulse 1.5s ease-in-out infinite; }
.loading-name { font-size: 22px; font-weight: 800; color: white; letter-spacing: -0.5px; }
.loading-sub  { font-size: 12px; color: rgba(255,255,255,0.45); }
@keyframes pulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.06);opacity:.8} }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screen.active .screen-content > * {
  animation: fadeUp 0.3s ease both;
}
.screen.active .screen-content > *:nth-child(1) { animation-delay: 0.04s; }
.screen.active .screen-content > *:nth-child(2) { animation-delay: 0.08s; }
.screen.active .screen-content > *:nth-child(3) { animation-delay: 0.12s; }
.screen.active .screen-content > *:nth-child(4) { animation-delay: 0.16s; }
.screen.active .screen-content > *:nth-child(5) { animation-delay: 0.20s; }
.screen.active .screen-content > *:nth-child(6) { animation-delay: 0.24s; }
.screen.active .screen-content > *:nth-child(7) { animation-delay: 0.28s; }

/* ── SAFE AREA ── */
.screen-header { padding-top: max(52px, calc(env(safe-area-inset-top) + 16px)); }

/* ═══════════════════════════════════════════════
   SISTEMA DE TIERS – tier styles
   Complementa styles.css sin sobreescribir nada.
═══════════════════════════════════════════════ */

/* ── Badge dinámico de tier ── */
/* #tier-badge ya usa .badge .badge-basic/.badge-pro/.badge-plus definidos arriba */

/* ── Elementos bloqueados (data-feature) ── */
[data-feature] { position: relative; }

.tier-locked {
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}
/* El wrapper recupera eventos para abrir el modal */
.tier-locked-trigger {
  pointer-events: all !important;
  cursor: pointer;
  position: relative;
}

/* Candado sobre el elemento */
.tier-locked::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(248,250,255,0.7)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E")
    center / 22px no-repeat;
  border-radius: inherit;
  z-index: 2;
  pointer-events: none;
}

/* Etiqueta PRO / PRO+ en esquina */
.tier-needs-pro::before,
.tier-needs-plus::before {
  position: absolute; top: 7px; right: 7px;
  font-size: 8px; font-weight: 800;
  padding: 2px 7px; border-radius: 20px;
  z-index: 3; pointer-events: none;
  letter-spacing: 0.07em; text-transform: uppercase;
}
.tier-needs-pro::before {
  content: 'PRO';
  background: var(--green-light); color: var(--green-dark);
  border: 1px solid #A7F3D0;
}
.tier-needs-plus::before {
  content: 'PRO+';
  background: var(--gold-light); color: var(--gold-dark);
  border: 1px solid #FCD34D;
}

/* ── Tarjeta de función bloqueada (uso futuro) ── */
.tier-feature-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 15px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: box-shadow 0.18s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.tier-feature-card:active { transform: scale(0.98); }
.tier-feature-card.tier-locked { background: #FAFBFF; }

/* ── Modal de upgrade ── */
.tier-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,35,84,0.55);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 9999;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.tier-modal-overlay.tier-modal--visible,
.tier-modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.tier-modal-box {
  background: white;
  border-radius: 24px 24px 0 0;
  padding: 28px 20px 36px;
  width: 100%; max-width: 430px;
  text-align: center;
  position: relative;
  box-shadow: 0 -8px 40px rgba(15,35,84,0.18);
  transform: translateY(30px);
  transition: transform 0.28s cubic-bezier(.34,1.56,.64,1);
}
.tier-modal--visible .tier-modal-box { transform: translateY(0); }

.tier-modal-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--surface2); border: none;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 13px; color: var(--text2);
  cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.tier-modal-close:hover { background: var(--border); }

.tier-modal-icon {
  font-size: 2rem; margin-bottom: 6px;
  color: var(--gold-dark);
}
.tier-modal-plan {
  display: inline-block;
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 3px 11px; border-radius: 20px;
  background: var(--gold-light); color: var(--gold-dark);
  border: 1px solid #FCD34D;
  margin-bottom: 10px;
}
.tier-modal-title {
  font-size: 17px; font-weight: 800; color: var(--text);
  margin-bottom: 6px; letter-spacing: -0.3px;
}
.tier-modal-desc {
  font-size: 12px; color: var(--text2);
  line-height: 1.5; margin-bottom: 8px;
}
.tier-modal-cta {
  font-size: 12px; color: var(--text3);
  line-height: 1.5; margin-bottom: 18px;
}
.tier-modal-btn {
  display: block; width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700;
  cursor: pointer; border: none;
  transition: transform 0.15s, opacity 0.15s;
  margin-bottom: 8px;
}
.tier-modal-btn:active { transform: scale(0.97); }
.tier-modal-btn--pro  { background: linear-gradient(135deg, var(--green-dark), #059669); color: white; }
.tier-modal-btn--plus { background: linear-gradient(135deg, var(--gold-dark), #D97706); color: white; }
.tier-modal-btn--cancel {
  background: var(--surface2); color: var(--text2);
  font-size: 13px; font-weight: 600;
}

/* ═══════════════════════════════════════════════
   FREE / PRO tier visibility
═══════════════════════════════════════════════ */

/* Visibilidad FREE/PRO controlada por clase en <body>
   body.tier-free  → muestra .free-only, oculta .pro-only
   body.tier-pro   → muestra .pro-only,  oculta .free-only
   Por defecto (sin clase) muestra ambos para evitar flash */
body.tier-free .pro-only  { display: none !important; }
body.tier-free .free-only { display: block; }

body.tier-pro  .free-only { display: none !important; }
body.tier-pro  .pro-only  { display: block; }

/* Badge PRO inline en labels */
.badge-pro {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  vertical-align: middle;
  margin-left: 4px;
}

/* Input readonly autofill PRO */
.form-input[readonly] {
  background: rgba(255,255,255,0.04);
  color: var(--text2);
  cursor: default;
}

/* ═══════════════════════════════════════════════
   FREE / PRO – visibilidad campos
═══════════════════════════════════════════════ */
.badge-pro {
  display: inline-block;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  background: linear-gradient(135deg, #10B981, #059669);
  color: white; padding: 2px 6px; border-radius: 10px;
  vertical-align: middle; margin-left: 4px;
}
.form-input[readonly] {
  background: rgba(255,255,255,0.04);
  color: var(--text2); cursor: default;
}

/* ═══════════════════════════════════════════════
   BOTÓN GUARDAR EN HISTORIAL
═══════════════════════════════════════════════ */
.save-btn--history {
  display: none;
  margin-top: 8px;
  width: 100%;
  height: 46px;
  padding: 0 16px;
  background: linear-gradient(135deg, #10B981, #059669);
  border: none;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: opacity 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.save-btn--history.visible {
  display: flex;
}
.save-btn--history:active {
  opacity: 0.82;
}

/* FREE: gris con badge PRO — abre modal upgrade */
.save-btn--history.btn-locked {
  background: var(--surface2);
  color: var(--text2);
  border: 1.5px solid var(--border);
  cursor: pointer;
}
.save-btn--history.btn-locked::after {
  content: ' · PRO';
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--green-dark);
}

/* ═══════════════════════════════════════════════
   MODAL GUARDAR CÁLCULO
═══════════════════════════════════════════════ */
.save-modal-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 env(safe-area-inset-bottom, 0);
  opacity: 0;
  transition: opacity 0.2s;
}
.save-modal--visible { opacity: 1 !important; }
.save-modal--visible .save-modal-box { transform: translateY(0) !important; }

.save-modal-box {
  background: var(--surface1);
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 28px 24px 32px;
  width: 100%; max-width: 480px;
  position: relative;
  transform: translateY(60px);
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}
.save-modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: var(--surface2);
  color: var(--text2); font-size: 14px;
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.save-modal-icon { font-size: 32px; margin-bottom: 8px; }
.save-modal-title {
  font-size: 20px; font-weight: 700;
  color: var(--text1); margin-bottom: 4px;
}
.save-modal-sub {
  font-size: 13px; color: var(--text2);
  margin-bottom: 20px;
  font-family: 'DM Mono', monospace;
}
.save-modal-field { margin-bottom: 20px; }
.save-modal-label {
  display: block; font-size: 13px;
  font-weight: 600; color: var(--text2);
  margin-bottom: 8px;
}
.save-modal-optional {
  font-weight: 400; color: var(--text3); font-size: 12px;
}
.save-modal-input {
  width: 100%; padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text1); font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  outline: none; box-sizing: border-box;
  transition: border-color 0.15s;
}
.save-modal-input:focus { border-color: #10B981; }
.save-modal-btn {
  display: block; width: 100%; padding: 14px;
  background: linear-gradient(135deg, #10B981, #059669);
  color: white; border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700; cursor: pointer;
  margin-bottom: 10px;
  transition: opacity 0.15s;
}
.save-modal-btn:active { opacity: 0.85; }
.save-modal-cancel {
  display: block; width: 100%; padding: 12px;
  background: none; border: none;
  color: var(--text3); font-size: 14px;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════
   PANTALLA HISTORIAL
═══════════════════════════════════════════════ */
.historial-locked-msg {
  text-align: center; padding: 56px 24px;
}
.locked-icon  { font-size: 48px; margin-bottom: 12px; }
.locked-title { font-size: 20px; font-weight: 700; color: var(--text1); margin-bottom: 8px; }
.locked-desc  { font-size: 14px; color: var(--text2); line-height: 1.6; margin-bottom: 24px; }

.historial-toolbar {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.historial-count { font-size: 12px; color: var(--text3); font-weight: 600; }
.historial-clear-btn {
  font-size: 12px; font-weight: 600; color: #F87171;
  background: none; border: 1px solid rgba(248,113,113,0.3);
  border-radius: 8px; padding: 6px 12px; cursor: pointer;
}
.historial-clear-btn:active { background: rgba(248,113,113,0.1); }

.historial-empty { text-align: center; padding: 48px 24px; color: var(--text3); }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-msg  { font-size: 14px; line-height: 1.6; }

.historial-lista { display: flex; flex-direction: column; gap: 12px; }

.historial-item {
  position: relative;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 44px 14px 14px;
  transition: border-color 0.15s;
}
.historial-item:hover { border-color: rgba(255,255,255,0.15); }
.historial-item-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 4px;
}
.historial-tipo   { font-size: 13px; font-weight: 700; color: var(--text1); }
.historial-fecha  { font-size: 11px; color: var(--text3); font-variant-numeric: tabular-nums; }
.historial-cliente {
  font-size: 12px; color: #10B981; font-weight: 600;
  margin-bottom: 4px;
}
.historial-resultado {
  font-size: 15px; font-weight: 700; color: #34D399;
  font-family: 'DM Mono', monospace; margin-bottom: 4px;
}
.historial-resumen { font-size: 12px; color: var(--text2); line-height: 1.5; }
.historial-delete-btn {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: rgba(248,113,113,0.12);
  color: #F87171; font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.historial-delete-btn:active { background: rgba(248,113,113,0.25); }

/* Botón editar cliente en historial */
.historial-actions {
  display: flex; gap: 8px;
  position: absolute; top: 10px; right: 10px;
}
.historial-edit-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: rgba(99,179,237,0.12);
  color: #63B3ED; font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.historial-edit-btn:active { background: rgba(99,179,237,0.25); }
.historial-delete-btn {
  position: static;
}


/* ═══════════════════════════════════════════════
   BOTÓN WHATSAPP (PRO)
═══════════════════════════════════════════════ */
.save-btn--whatsapp {
  display: none;
  background: #25D366;
  border-color: #1ebe5d;
  color: #fff;
}
.save-btn--whatsapp.visible {
  display: flex;
}
.save-btn--whatsapp:hover {
  background: #1ebe5d;
}
.save-btn--whatsapp.btn-locked {
  background: var(--surface2);
  color: var(--text2);
  border: 1.5px solid var(--border);
}
.save-btn--whatsapp.btn-locked::after {
  content: ' · PRO';
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--green-dark);
}

/* ═══════════════════════════════════════════════
   BOTÓN EXPORTAR PDF (PRO)
═══════════════════════════════════════════════ */
.save-btn--pdf {
  display: none;
  background: var(--green-light);
  border-color: #A7F3D0;
  color: var(--green-dark);
}
.save-btn--pdf.visible { display: flex; }
.save-btn--pdf:hover   { background: #bbf7d0; }
.save-btn--pdf.btn-locked {
  background: var(--surface2);
  color: var(--text2);
  border: 1.5px solid var(--border);
}
.save-btn--pdf.btn-locked::after {
  content: ' · PRO';
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--green-dark);
}

/* ═══════════════════════════════════════════════
   PERFIL DEL ASESOR – botón en home
═══════════════════════════════════════════════ */
.advisor-profile-row {
  margin-bottom: 10px;
}
.advisor-edit-btn {
  width: 100%;
  padding: 11px 16px;
  background: rgba(16,185,129,0.08);
  border: 1.5px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-sm);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.advisor-edit-btn:active { background: rgba(16,185,129,0.15); }

/* ═══════════════════════════════════════════════
   INFO BANNER VARIANTE WARNING
═══════════════════════════════════════════════ */
.info-banner--warn {
  background: #FFFBEB;
  border-left: 3px solid #F59E0B;
}
.info-banner--warn .info-icon { color: #F59E0B; }
.info-banner--warn .info-text { color: #92400E; }
.info-banner--warn strong     { color: #78350F; }

/* ═══════════════════════════════════════════════
   MODAL UPGRADE — modo FREE_ONLY release
═══════════════════════════════════════════════ */
.tier-modal-btn--soon {
  background: linear-gradient(135deg, #374151, #1F2937) !important;
  color: #D1FAE5 !important;
  cursor: default;
}

/* ════════════════════════════════════════════════
   PREVIEW BLOQUEADO PRO
════════════════════════════════════════════════ */
.result-rows--locked { position: relative; }
.result-rows--locked .result-row { filter: blur(4px); user-select: none; pointer-events: none; }
.result-locked-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; background: rgba(15,35,84,0.55); border-radius: 8px; z-index: 10;
  padding: 12px; text-align: center;
}
.result-locked-overlay .locked-icon { font-size: 22px; }
.result-locked-overlay .locked-text { font-size: 12px; color: rgba(255,255,255,0.9); font-weight: 500; }
.result-locked-overlay .locked-btn {
  background: var(--accent, #f59e0b); color: #1a1a2e; border: none;
  border-radius: 20px; padding: 6px 16px; font-size: 12px; font-weight: 700; cursor: pointer;
}

/* ════════════════════════════════════════════════
   FOUNDER BADGE & CODE SECTION
════════════════════════════════════════════════ */
.founder-badge-card {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(245,158,11,0.15); color: #D97706;
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 100px; padding: 3px 10px; font-size: 11px; font-weight: 700;
  margin-bottom: 6px;
}
.founder-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(245,158,11,0.15); color: #D97706;
  border-radius: 100px; padding: 2px 8px; font-size: 11px; font-weight: 700;
}
.founder-code-section {
  margin: 16px 0 0; padding: 16px;
  background: rgba(245,158,11,0.07);
  border: 1px solid rgba(245,158,11,0.25); border-radius: 10px;
}
.founder-code-hint { font-size: 12px; color: var(--text-muted, #6B7280); margin-bottom: 10px; line-height: 1.5; }
.founder-code-row { display: flex; flex-direction: column; gap: 8px; }
.founder-input { width: 100% !important; font-size: 14px !important; padding: 12px 14px !important; letter-spacing: 0.05em; text-align: center; font-weight: 600 !important; }
.founder-btn { width: 100% !important; padding: 12px 16px !important; font-size: 14px !important; }

/* ── Upgrade button centered ── */
.upgrade-row { display: flex; gap: 8px; justify-content: center; }
.upgrade-btn {
  flex: 1; padding: 11px 12px; border-radius: var(--radius-sm, 8px);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s; -webkit-tap-highlight-color: transparent;
}
