/* ============================================================
   INVERSIONES CREDIAHORRO DE R.L. — Asociados App Web
   Identidad: rojo corporativo #A61E23, glassmorphism suave,
   tarjetas blancas, tipografía Montserrat geométrica
   ============================================================ */

:root {
  --red-primary: #A61E23;
  --red-dark: #801317;
  --red-deep: #7A1217;
  --red-bright: #D13438;
  --red-soft: #F9E9E9;
  --red-softer: #F8E8E9;
  --bg-light: #F2F2F2;
  --text-dark: #1A2B33;
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --text-muted: #8E8E93;
  --card-bg: #FFFFFF;
  --border-light: #F3F4F6;
  --border-line: #E5E7EB;
  --divider: #E0E0E0;
  --divider-soft: #F0F0F0;
  --radius-card: 22px;
  --radius-btn: 15px;
  --radius-pill: 50px;
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.06);
  --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.05);
  --font: 'Montserrat', 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-light);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: var(--font);
  border: none;
  background: none;
  cursor: pointer;
}

/* ---------- Contenedor móvil centrado ---------- */
.app-shell {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-light);
  position: relative;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

/* ============================
   HEADER CON DEGRADADO + ONDAS
   ============================ */
.app-header {
  position: relative;
  background: linear-gradient(135deg, #A61E23 0%, #801317 100%);
  padding: 26px 20px 0;
  border-bottom-left-radius: 40px;
  border-bottom-right-radius: 40px;
  color: #fff;
  overflow: hidden;
}

.app-header::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -40px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle at center, rgba(255,255,255,0.10), transparent 70%);
  border-radius: 50%;
}

.app-header::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -60px;
  width: 260px;
  height: 200px;
  background: radial-gradient(circle at center, rgba(0,0,0,0.12), transparent 70%);
  border-radius: 50%;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

.logo-mark svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
}

.logo-text {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
  line-height: 1.1;
}

.logo-text small {
  display: block;
  font-weight: 500;
  font-size: 10px;
  opacity: 0.75;
  letter-spacing: 0.4px;
}

.notif-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.notif-btn svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
}

.notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  background: #fff;
  border: 2px solid var(--red-primary);
  border-radius: 50%;
}

.header-greeting {
  position: relative;
  z-index: 2;
  padding: 22px 2px 34px;
}

.header-greeting h1 {
  font-size: 26px;
  font-weight: 700;
}

.header-greeting p {
  font-size: 14px;
  opacity: 0.85;
  margin-top: 4px;
  font-weight: 500;
}

/* ---------- Contenido que flota sobre el header ---------- */
.app-content {
  padding: 0 20px 100px;
  margin-top: -26px;
  position: relative;
  z-index: 3;
}

/* ============================
   TARJETAS
   ============================ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px;
  border: 1px solid rgba(0,0,0,0.04);
  margin-bottom: 16px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title .link {
  font-size: 13px;
  font-weight: 600;
  color: var(--red-primary);
}

/* ---------- Resumen de productos (grid 3 cols) ---------- */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  position: relative;
}

.summary-item {
  text-align: center;
  padding: 4px 8px;
  position: relative;
}

.summary-item + .summary-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: var(--divider);
}

.summary-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--red-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  color: var(--red-primary);
}

.summary-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.summary-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}

.summary-amount {
  font-size: 16px;
  font-weight: 800;
  color: var(--red-primary);
}

/* ---------- Acciones rápidas ---------- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.quick-btn {
  background: var(--card-bg);
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow-soft);
  padding: 18px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(0,0,0,0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.quick-btn:active {
  transform: scale(0.96);
}

.quick-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--red-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(166, 30, 35, 0.28);
}

.quick-circle svg {
  width: 24px;
  height: 24px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
}

.quick-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---------- Movimientos / lista ---------- */
.movement-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--divider-soft);
}

.movement-row:last-child {
  border-bottom: none;
}

.mv-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #F5F5F5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.mv-icon.in {
  color: #11A96D;
  background: #E8F7F0;
}

.mv-icon.out {
  color: var(--red-primary);
  background: var(--red-soft);
}

.mv-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
}

.mv-info {
  flex: 1;
}

.mv-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.mv-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.mv-amount {
  font-size: 15px;
  font-weight: 700;
}

.mv-amount.pos { color: #11A96D; }
.mv-amount.neg { color: var(--text-dark); }

.mv-chevron {
  margin-left: 12px;
  color: #C9C9CE;
}

.mv-chevron svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ---------- Ahorros ---------- */
.balance-total {
  text-align: center;
  padding: 8px 0 16px;
}

.balance-total .label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.balance-total .amount {
  font-size: 34px;
  font-weight: 800;
  color: var(--text-dark);
  margin-top: 4px;
}

.savings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.savings-card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0,0,0,0.04);
}

.savings-card .sc-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}

.savings-card .sc-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.savings-card .sc-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.savings-card .sc-amount {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-dark);
}

.badge-pill {
  display: inline-block;
  background: var(--red-softer);
  color: var(--red-primary);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-top: 8px;
}

.progress-wrap {
  margin-top: 10px;
  text-align: left;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.progress-bar {
  height: 8px;
  background: var(--divider);
  border-radius: 50px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--red-primary);
  border-radius: 50px;
}

/* ---------- Mi crédito ---------- */
.credit-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  position: relative;
}

.credit-split::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  width: 1px;
  background: var(--border-line);
}

.credit-left .label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.credit-left .amount {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-dark);
  margin: 6px 0 14px;
}

.progress-wide {
  height: 12px;
  background: var(--border-line);
  border-radius: 50px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-credit {
  height: 100%;
  background: var(--red-primary);
  border-radius: 50px;
}

.credit-left .paid {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.credit-detail {
  padding: 2px 0 2px 8px;
}

.credit-detail .cd-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}

.cd-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cd-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.cd-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.cd-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-primary {
  display: block;
  width: 100%;
  background: var(--red-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 14px;
  border-radius: 12px;
  text-align: center;
  margin-top: 16px;
  box-shadow: 0 8px 18px rgba(166, 30, 35, 0.3);
  transition: transform 0.15s ease;
}

.btn-primary:active {
  transform: scale(0.98);
}

/* ---------- Stats / estadísticas ---------- */
.stats-row {
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
}

/* ---------- Noticias ---------- */
.news-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 10px;
}

.news-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--red-soft);
  color: var(--red-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.news-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.news-body {
  flex: 1;
}

.news-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.news-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.news-chevron {
  color: #C9C9CE;
}

.news-chevron svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ============================
   BOTTOM NAV
   ============================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: #fff;
  border-top: 1px solid var(--divider-soft);
  display: flex;
  justify-content: space-around;
  padding: 10px 0 16px;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.04);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  flex: 1;
  position: relative;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.nav-item.active {
  color: var(--red-primary);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  top: -10px;
  width: 28px;
  height: 3px;
  background: var(--red-primary);
  border-radius: 0 0 3px 3px;
}

.nav-item.active svg {
  stroke-width: 2.4;
}

/* ============================
   LOGIN
   ============================ */
.login-shell {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: linear-gradient(160deg, #A61E23 0%, #6E1015 100%);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 26px;
  overflow: hidden;
}

.login-shell::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -80px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 70%);
  border-radius: 50%;
}

.login-brand {
  text-align: center;
  color: #fff;
  margin-bottom: 36px;
  position: relative;
  z-index: 2;
}

.login-brand .logo-circle {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 24px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.login-brand .logo-circle svg {
  width: 44px;
  height: 44px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.8;
}

.login-brand h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.login-brand p {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 4px;
}

.login-card {
  background: #fff;
  border-radius: 26px;
  padding: 28px 24px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  position: relative;
  z-index: 2;
}

.login-card h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.login-card .sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.field input {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--border-line);
  border-radius: 12px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text-primary);
  background: #FAFAFA;
  transition: border-color 0.2s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--red-primary);
  background: #fff;
}

.btn-login {
  width: 100%;
  background: var(--red-primary);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 15px;
  border-radius: 12px;
  margin-top: 6px;
  box-shadow: 0 8px 18px rgba(166, 30, 35, 0.3);
  transition: transform 0.15s ease;
}

.btn-login:active {
  transform: scale(0.98);
}

.login-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 430px) {
  .app-shell, .login-shell, .bottom-nav {
    max-width: 100%;
  }
}
