/* =========================================================
   Agenda Familiar Responsive
   CSS separado para que sea fácil modificar colores y diseño.
   Paleta inspirada en textiles ayacuchanos.
   ========================================================= */

:root {
  --fondo: #fff8ef;
  --tarjeta: #ffffff;
  --texto: #2d1f1a;
  --muted: #7a665e;

  --morado: #4c1d95;
  --morado-oscuro: #351061;
  --fucsia: #c026d3;
  --rojo-tierra: #b91c1c;
  --naranja: #f97316;
  --dorado: #facc15;
  --turquesa: #0891b2;

  --borde: #f0d7bd;
  --suave: #fff0da;
  --peligro: #dc2626;
  --pasado: #ea580c;
  --ok: #15803d;

  --radio: 22px;
  --sombra: 0 18px 45px rgba(83, 44, 15, .13);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--texto);
  background:
    radial-gradient(circle at top left, rgba(192, 38, 211, .14), transparent 34%),
    radial-gradient(circle at top right, rgba(250, 204, 21, .25), transparent 32%),
    linear-gradient(180deg, #fff8ef, #fff3df);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

button {
  cursor: pointer;
}

.app {
  width: min(1240px, 94%);
  margin: auto;
  padding: 24px 0 90px;
}

/* HERO */

.hero {
  display: grid;
  grid-template-columns: 1.35fr .85fr;
  gap: 22px;
  align-items: stretch;
  background:
    linear-gradient(135deg, rgba(76, 29, 149, .96), rgba(192, 38, 211, .90), rgba(249, 115, 22, .96)),
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(255,255,255,.12) 10px 16px);
  color: #fff;
  border-radius: 32px;
  padding: 30px;
  box-shadow: var(--sombra);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(250, 204, 21, .22);
}

.hero__texto {
  position: relative;
  z-index: 1;
}

.hero__tag {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.28);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.02;
  margin-bottom: 12px;
}

.hero p {
  max-width: 680px;
  font-size: 16px;
  line-height: 1.55;
  opacity: .96;
}

.hero__acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero__foto {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 26px;
  padding: 12px;
  display: grid;
  align-content: end;
  backdrop-filter: blur(8px);
}

.hero__foto img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  border-radius: 20px;
  box-shadow: 0 14px 34px rgba(45, 31, 26, .25);
}

.hero__foto div {
  padding: 12px 4px 2px;
}

.hero__foto strong,
.hero__foto span {
  display: block;
}

.hero__foto span {
  font-size: 12px;
  opacity: .86;
  margin-top: 3px;
}

/* BOTONES */

.btn {
  border: none;
  min-height: 44px;
  border-radius: 15px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 900;
  transition: .2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--claro {
  background: #fff;
  color: var(--morado);
}

.btn--fantasma {
  background: rgba(255,255,255,.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,.30);
}

.btn--principal {
  background: var(--morado);
  color: #fff;
}

.btn--principal:hover {
  background: var(--morado-oscuro);
}

.btn--suave {
  background: var(--suave);
  color: var(--morado);
}

.btn--peligro {
  background: #fee2e2;
  color: var(--peligro);
}

.btn-icono {
  border: none;
  min-width: 42px;
  min-height: 42px;
  border-radius: 14px;
  background: var(--suave);
  color: var(--morado);
  font-weight: 900;
  font-size: 18px;
}

.btn-mini {
  border: none;
  border-radius: 13px;
  padding: 9px 11px;
  font-size: 12px;
  font-weight: 900;
}

/* FECHA */

.barra-tiempo {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 14px;
  margin: 18px 0;
}

.barra-tiempo div {
  background: rgba(255,255,255,.82);
  border: 1px solid var(--borde);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 10px 28px rgba(83, 44, 15, .06);
}

.barra-tiempo span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.barra-tiempo strong {
  font-size: 18px;
}

/* RESUMEN */

.resumen {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.resumen__card {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(83, 44, 15, .08);
  position: relative;
  overflow: hidden;
}

.resumen__card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--morado), var(--fucsia), var(--naranja), var(--dorado));
}

.resumen__card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 7px;
}

.resumen__card strong {
  display: block;
  font-size: 32px;
  margin-bottom: 5px;
}

.resumen__card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.resumen__card--hoy {
  background: #fffbeb;
}

.resumen__card--pasado {
  background: #fff7ed;
}

.resumen__card--pendiente {
  background: #fef2f2;
}

/* AVISO */

.aviso {
  display: none;
  border: 1px solid #facc15;
  background: #fffbeb;
  color: #7a5300;
  padding: 14px 16px;
  border-radius: 18px;
  margin-bottom: 18px;
  line-height: 1.45;
}

.aviso.activo {
  display: block;
}

/* LAYOUT */

.layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 22px;
  align-items: start;
}

.panel {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 22px;
  box-shadow: var(--sombra);
}

.panel--formulario {
  position: sticky;
  top: 18px;
}

.panel__titulo {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel__titulo h2 {
  font-size: 21px;
  margin-bottom: 5px;
}

.panel__titulo p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

/* FORMULARIO */

.formulario {
  display: grid;
  gap: 14px;
}

.formulario__dos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.campo label {
  display: block;
  color: #4a3228;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 7px;
}

.campo label b {
  color: var(--peligro);
}

.campo input,
.campo select,
.campo textarea,
.filtros input,
.filtros select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--borde);
  background: #fffdf9;
  border-radius: 15px;
  padding: 12px 13px;
  color: var(--texto);
  font-size: 14px;
  outline: none;
  transition: .2s ease;
}

.campo textarea {
  min-height: 88px;
  resize: vertical;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus,
.filtros input:focus,
.filtros select:focus {
  border-color: var(--fucsia);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(192, 38, 211, .12);
}

.campo small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  margin-top: 6px;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--fucsia);
}

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

.nota-local {
  border: 1px dashed var(--borde);
  background: #fffaf1;
  border-radius: 15px;
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* FILTROS */

.filtros {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.chip {
  border: 1px solid var(--borde);
  background: #fffaf1;
  color: var(--texto);
  border-radius: 999px;
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.chip--activo {
  background: var(--morado);
  color: #fff;
  border-color: var(--morado);
}

/* LISTA */

.lista {
  display: grid;
  gap: 12px;
}

.evento {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 20px;
  padding: 16px;
  transition: .2s ease;
}

.evento:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(83, 44, 15, .10);
}

.evento__info h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 17px;
  margin-bottom: 8px;
}

.evento__info p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 3px;
}

.evento__acciones {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.etiqueta {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.etiqueta--cumple {
  color: var(--fucsia);
  background: #fae8ff;
}

.etiqueta--fecha {
  color: var(--turquesa);
  background: #e0f7ff;
}

.etiqueta--hoy {
  color: #854d0e;
  background: #fef3c7;
}

.etiqueta--proximo {
  color: var(--morado);
  background: #ede9fe;
}

.etiqueta--pasado {
  color: var(--pasado);
  background: #ffedd5;
}

.etiqueta--pendiente {
  color: var(--peligro);
  background: #fee2e2;
}

.dias {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 105px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 14px;
  background: #ede9fe;
  color: var(--morado);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.dias--hoy {
  background: #fef3c7;
  color: #854d0e;
  animation: latido 1s infinite alternate;
}

.dias--pasado {
  background: #ffedd5;
  color: var(--pasado);
}

.dias--pendiente {
  background: #fee2e2;
  color: var(--peligro);
}

@keyframes latido {
  from { transform: scale(1); }
  to { transform: scale(1.04); }
}

.vacio {
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--borde);
  background: #fffaf1;
  border-radius: 20px;
  padding: 28px 12px;
  line-height: 1.5;
}

/* TOAST */

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: 340px;
  background: #2d1f1a;
  color: #fff;
  padding: 14px 16px;
  border-radius: 16px;
  box-shadow: var(--sombra);
  line-height: 1.4;
  font-size: 14px;
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
  transition: .25s ease;
}

.toast.activo {
  opacity: 1;
  transform: translateY(0);
}

/* BOTÓN FLOTANTE MÓVIL */

.btn-flotante {
  display: none;
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--morado), var(--fucsia), var(--naranja));
  color: #fff;
  font-size: 32px;
  line-height: 1;
  box-shadow: 0 18px 35px rgba(76, 29, 149, .28);
}

/* RESPONSIVE */

@media (max-width: 1120px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .panel--formulario {
    position: static;
  }

  .resumen {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px) {
  .app {
    width: min(100% - 24px, 1240px);
    padding-top: 14px;
  }

  .hero {
    padding: 22px;
    border-radius: 24px;
  }

  .hero__acciones {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero__foto img {
    height: 220px;
  }

  .barra-tiempo {
    grid-template-columns: 1fr;
  }

  .resumen {
    grid-template-columns: repeat(2, 1fr);
  }

  .panel {
    padding: 18px;
    border-radius: 20px;
  }

  .formulario__dos,
  .formulario__acciones {
    grid-template-columns: 1fr;
  }

  .evento {
    grid-template-columns: 1fr;
  }

  .evento__acciones {
    justify-content: flex-start;
  }

  .dias {
    width: 100%;
  }

  .btn-mini {
    flex: 1;
    min-height: 42px;
  }

  .btn-flotante {
    display: grid;
    place-items: center;
  }

  .toast {
    right: 12px;
    left: 12px;
    bottom: 86px;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 30px;
  }

  .hero__foto img {
    height: 190px;
  }

  .resumen {
    grid-template-columns: 1fr;
  }

  .panel__titulo {
    align-items: center;
  }
}
