/* ===================== Fuente ===================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

/* ===================== Base ===================== */
body {
  font-family: 'Poppins', sans-serif;
  background-color: #fdfaff;
  color: #2c3e50;
  margin: 0;
}

/* ===================== Títulos ===================== */
h1, h2 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: #4a235a;
  margin: 0;
}

/* ===================== Botones (generales) ===================== */
button {
  background: linear-gradient(to right, #a78bfa, #c084fc);
  color: #fff;
  border: none;
  padding: 12px 20px;
  font-size: 15px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  width: 100%;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 4px 12px rgba(160, 120, 200, 0.2);
}
button:hover {
  background: linear-gradient(to right, #7c3aed, #a855f7);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(120, 60, 180, 0.25);
}

/* Botón de Google: blanco, sin gradiente */
button.google-btn {
  background: #fff !important;
  color: #444 !important;
  border: 1px solid #ccc !important;
  box-shadow: none !important;
}
button.google-btn:hover {
  background: #f0f0f0 !important;
  transform: none !important;
  box-shadow: none !important;
}

/* ----------------- Inputs ----------------- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  display: block;
  width: 100%;
  height: 48px;                
  padding: 12px 14px;          
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;             
  line-height: 22px;
  font-family: 'Poppins', sans-serif;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Da margen interno extra a email/password para no “achicarse” por los iconos nativos */
input[type="email"],
input[type="password"] {
  padding-right: 44px;         
}

/* Placeholders a mismo tamaño */
input::placeholder {
  font-size: 16px;
  color: #9aa1a9;
}

/* Foco consistente */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #d8b4fe;
  box-shadow: 0 0 0 3px rgba(216, 180, 254, 0.35);
}

/* Intenta ocultar/neutralizar controles nativos que “aplastan” el contenido */
input[type="email"]::-webkit-contacts-auto-fill-button { visibility: hidden; display: none; }
input[type="password"]::-ms-reveal { display: none; }
input[type="password"]::-ms-clear  { display: none; }
input[type="password"]::-webkit-credentials-auto-fill-button { visibility: hidden; display: none; }


/* (Opcional) mejor foco */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #d8b4fe;
  box-shadow: 0 0 0 3px rgba(216, 180, 254, 0.35);
}



/* ===================== Formularios ===================== */
form {
  background-color: #ffffff;
  padding: 20px;
  margin-bottom: 10px;
  border-radius: 12px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.05);
}

/* ===================== Etiquetas ===================== */
label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

/* ===================== Enlaces ===================== */
a {
  display: inline-block;
  margin-top: 20px;
  color: #2980b9;
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ===================== Página de inicio (Hero) ===================== */
.hero {
  background-image: url("/static/img/finanzas_2.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 20px;
  color: white;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
}
.hero-content {
  position: relative; z-index: 2; max-width: 800px;
}
.hero-content h1 {
  font-size: 3em; font-weight: 700; margin-bottom: 20px; color: #fff;
}
.hero-content p { font-size: 1.3em; margin-bottom: 30px; }

/* Botón CTA */
.boton-cta {
  background: #ffffff; color: #4b256d; padding: 12px 30px;
  font-weight: 600; border-radius: 25px; text-decoration: none; font-size: 1em;
  transition: background 0.3s, color 0.3s; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.boton-cta:hover { background: #4b256d; color: #fff; }

/* ===================== Tarjetas (Home) ===================== */
.finanzas-grid { margin-top: 40px; padding-top: 10px; }
.finanzas-card {
  background: linear-gradient(145deg, #ffffff, #faf5ff);
  border: 1px solid #e0c7ff; border-radius: 18px; padding: 28px 24px;
  box-shadow: 0 8px 24px rgba(134, 85, 167, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex; flex-direction: column; gap: 14px;
}
.finanzas-card:hover { transform: translateY(-6px); box-shadow: 0 12px 32px rgba(134, 85, 167, 0.15); }
.finanzas-card h2 { font-size: 22px; margin-bottom: 14px; text-align: center; color: #5e2d77; }

/* ===================== Resumen Anual ===================== */
.resumen-anual-body { background-color: #f9f5ff; font-family: 'Poppins', sans-serif; }
.resumen-anual-container { max-width: 1100px; margin: 40px auto; padding: 20px; }
.resumen-anual-container h1 {
  text-align: center; color: #4a235a; font-size: 36px; margin-bottom: 30px;
}
.resumen-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px;
}
.resumen-mes {
  background-color: #ffffff; border: 2px solid #d8b4fe; border-radius: 18px;
  padding: 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.06); text-align: center;
}
.resumen-mes h2 { font-size: 20px; margin-bottom: 12px; color: #4a235a; font-weight: 600; }
.ingreso { color: #27ae60; font-weight: 500; }
.gasto   { color: #c0392b; font-weight: 500; }
.balance { color: #2c3e50; font-weight: 600; }
.volver-link { display: inline-block; margin-top: 40px; text-decoration: none; color: #2980b9; font-weight: 500; }
.volver-link:hover { text-decoration: underline; }

/* ===================== Botón Inicio (Landing) ===================== */
.boton-inicio {
  display: inline-block; background-color: #a78bfa; color: #fff;
  padding: 12px 28px; font-size: 16px; font-weight: 600; border-radius: 30px;
  text-decoration: none; transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}
.boton-inicio:hover { background-color: #7c3aed; transform: scale(1.05); }

/* ===================== Sección “Esencia” (dark) ===================== */
#info-esencial { background-color: #111; color: #fff; padding: 60px 20px; text-align: center; }
#info-esencial h2 { font-size: 2.5rem; margin-bottom: 50px; color: #fff; }
.tarjetas-container {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 30px;
}
.tarjeta {
  background-color: #1c1c1c; border-radius: 12px; padding: 30px 20px; width: 300px; text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4); transition: transform 0.3s ease;
}
.tarjeta:hover { transform: translateY(-8px); }
.tarjeta h3 { font-size: 1.4rem; margin-bottom: 15px; color: #fff; }
.tarjeta p { font-size: 1rem; color: #ddd; line-height: 1.6; margin-bottom: 20px; }
.tarjeta button {
  background-color: #9c27b0; color: #fff; border: none; border-radius: 25px; padding: 10px 20px;
  font-size: 1rem; cursor: pointer; transition: background-color 0.3s ease;
}
.tarjeta button:hover { background-color: #ba68c8; }

/* ===================== Calendario (FullCalendar) ===================== */
#calendario {
  max-width: 950px; margin: auto; background-color: #fffafc; padding: 30px;
  border-radius: 20px; box-shadow: 0 0 30px rgba(68, 35, 90, 0.1);
}
.fc { font-family: 'Poppins', sans-serif; font-size: 16px; color: #44235a; }
.fc-toolbar-title { font-size: 28px; font-weight: bold; color: #44235a; }
.fc-button {
  background-color: #44235a; border: none; border-radius: 6px; padding: 6px 14px;
  font-size: 15px; color: white; font-weight: 500; transition: background-color 0.25s ease;
}
.fc-button:hover { background-color: #5e2d77; }
.fc-button-primary:not(:disabled):active,
.fc-button-primary:not(:disabled).fc-button-active { background-color: #5e2d77; border: none; }
.fc-daygrid-day-number { font-weight: 600; font-size: 14px; color: #44235a; }
.fc-daygrid-event {
  font-size: 14px; padding: 3px 6px; border-radius: 5px; font-weight: 500;
  box-shadow: 0 0 5px rgba(0,0,0,0.1); opacity: 0.95;
}

/* ===================== Panel Resumen (mini ventana izq) ===================== */
.resumen-panel {
  position: fixed; left: 0; top: 0; height: 100%; width: 270px; background-color: #f4dffb;
  padding: 30px 20px; font-family: 'Poppins', sans-serif; color: #000;
  transition: left 0.4s ease; box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1); z-index: 99;
}
.resumen-panel h2 { font-size: 20px; margin-bottom: 20px; color: rebeccapurple; font-weight: bold; }
.toggle-btn {
  position: absolute; top: 20px; right: -25px; width: 25px; height: 25px; border-radius: 50%;
  background-color: rebeccapurple; color: white; font-weight: bold; border: none; cursor: pointer;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}
.resumen-panel.closed { left: -270px; }

/* ===================== Carrusel (Home) ===================== */
.carrusel { position: relative; height: 100vh; overflow: hidden; }
.slides { position: relative; height: 100%; }
.slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1s ease; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 20px; color: white;
}
.slide.activo { opacity: 1; z-index: 2; }
.contenido-slide h1 { font-size: 42px; margin-bottom: 10px; }
.contenido-slide p  { font-size: 20px; margin-bottom: 20px; }

/* ===================== Layout FinanZen (sidebar/header) ===================== */
.sidebar {
  position: fixed; top: 0; left: 0; height: 100%; width: 240px;
  background-color: #1e1e2f; padding-top: 20px; display: flex; flex-direction: column;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}
.sidebar h1 { font-size: 1.5rem; color: #fff; text-align: center; margin-bottom: 20px; }
.sidebar a {
  display: block; padding: 14px 20px; color: #cfcfd6; text-decoration: none; font-size: 1rem;
  transition: background 0.3s, color 0.3s;
}
.sidebar a:hover { background-color: #2e2e42; color: #fff; }

.main-content { margin-left: 240px; padding: 20px; }

.header {
  display: flex; justify-content: space-between; align-items: center; padding: 15px 20px;
  background-color: #2e2e42; color: #fff; border-bottom: 2px solid #1e1e2f;
}
.header .user-info { display: flex; align-items: center; gap: 15px; }
.header .user-info a { color: #cfcfd6; text-decoration: none; transition: color 0.3s; }
.header .user-info a:hover { color: #fff; }

.encabezado {
  background-color: #ffffff; border-bottom: 2px solid #d8b4fe; padding: 16px 32px;
  display: flex; justify-content: space-between; align-items: center; font-family: 'Segoe UI', sans-serif;
}
.titulo {
  font-size: 24px; font-weight: bold; color: #4a235a; display: flex; align-items: center; margin: 0;
}
.logo-link {
  text-decoration: none; color: #4a235a; font-weight: bold; font-size: 24px; transition: color 0.25s ease; margin: 0;
}
.logo-link:hover { color: #7d3c98; text-decoration: none; }

.acciones { display: flex; align-items: center; gap: 16px; }
.acciones .user-info { display: flex; align-items: center; gap: 6px; padding: 0; margin: 0; }
.acciones .user-info img { width: 18px; height: 18px; vertical-align: middle; }
.acciones .user-info span { font-weight: bold; color: #4b256d; line-height: 1.2; margin: 0; padding: 0; }
.acciones a { text-decoration: none; color: #4a235a; font-weight: 500; transition: color 0.2s; line-height: 1.2; padding: 0; margin: 0; }
.acciones a:hover { color: #7d3c98; }

/* ===================== Widget USDCLP (encabezado) ===================== */
.right-zone { display:flex; align-items:center; gap:16px; }
.usdclp {
  display:flex; align-items:center; gap:8px; padding:6px 10px;
  border:1px solid #ebdff6; border-radius:10px; background:#f8f5ff;
  font-weight:600; color:#4b256d; line-height:1;
}
.usdclp-change { font-weight:700; }
/* Estados: ↑ verde si sube, ↓ rojo si baja */
.usdclp-change.up   { color:#16a34a; }
.usdclp-change.down { color:#dc2626; }
.usdclp-change.up::before   { content:"▲ "; }
.usdclp-change.down::before { content:"▼ "; }

/* Responsive header */
@media (max-width: 640px){
  .encabezado{ padding:12px 16px; }
  .right-zone{ gap:12px; }
  .usdclp{ padding:5px 8px; }
}

/* ===================== Alertas (index) ===================== */
.alert {
  margin: 12px 0 0 0; padding: 12px 14px; border-radius: 8px; border: 1px solid; font-weight: 600;
}
.alert.error  { background:#fff5f5; color:#991b1b; border-color:#fecaca; }
.alert.success{ background:#f0fdf4; color:#065f46; border-color:#bbf7d0; }


/* ==================================================================== */
/* COMMENT: La flecha unificada se añade al final de style.css.
   Este es el código del resumen anual que querías aplicar a todos.
*/
/* ==================================================================== */

/* ===================== Flecha de retroceso UNIFICADA ===================== */

.back-arrow {
  /* COMMENT: Estilo migrado de resumen.css */
  position: absolute;
  top: 80px;         
  left: 36px;        
  display: flex;
  align-items: center;
  gap: 8px;

  /* Estilo visual */
  font-size: 16px;
  color: #7d3c98; 
  font-weight: 600;
  text-decoration: none;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 6px 12px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  z-index: 10; 
}

.back-arrow:hover {
  color: #5e2d77; 
  background-color: rgba(255, 255, 255, 1);
  transform: translateX(-4px); 
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

/* COMMENT: Estilos SVG migrados de resumen.css (necesitas usar un SVG en el HTML) */
.back-arrow svg {
  width: 18px;
  height: 18px;
  stroke: #7d3c98; 
  transition: transform 0.3s ease, stroke 0.3s ease;
}

.back-arrow:hover svg {
  stroke: #5e2d77; 
  transform: translateX(-2px);
}