:root {
  --crema: #F2F0E4;      /* Cannoli Cream · Pantone 11-4302 TCX */
  --crema-2: #E7E2CF;
  --papel: #FAF8F1;
  --vino: #713744;       /* Burgundy · Pantone 19-1617 TCX */
  --vino-2: #5A2A35;
  --vino-3: #3A1A22;
  --texto: #3B2A2E;
  --suave: #7D6B67;
  --linea: rgba(113, 55, 68, 0.18);
  --sombra: 0 14px 34px -16px rgba(77, 37, 46, 0.45);
  --script: "Great Vibes", cursive;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: var(--crema);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(113, 55, 68, 0.07), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(113, 55, 68, 0.07), transparent 45%);
  background-attachment: fixed;
  color: var(--texto);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.5;
}
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

.contenedor { max-width: 560px; margin: 0 auto; padding: 28px 16px 110px; }
.contenedor.ancho { max-width: 1200px; }

/* ---------- Encabezado ---------- */
.encabezado { text-align: center; padding: 12px 0 4px; }
.rama { width: 150px; margin: 0 auto; color: var(--vino); opacity: 0.85; }
.rama.abajo { transform: scaleY(-1); margin-top: 6px; }
.nombres {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(3rem, 14vw, 4.6rem);
  line-height: 1.1;
  color: var(--vino);
  margin-top: 4px;
}
.fecha {
  font-family: var(--serif);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--suave);
}
.intro {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.35;
  text-align: center;
  max-width: 28ch;
  margin: 18px auto 26px;
}

/* ---------- Tarjeta y formulario ---------- */
.tarjeta {
  background: var(--papel);
  border: 1px solid var(--linea);
  border-radius: 20px;
  padding: 22px 18px;
  box-shadow: var(--sombra);
}
.etiqueta {
  display: block;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--vino);
  margin-bottom: 8px;
}
.campo {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 14px 16px;
  border: 1px solid var(--linea);
  border-radius: 12px;
  background: #fff;
  color: var(--texto);
}
.campo:focus { outline: 2px solid var(--vino); outline-offset: 1px; }
.campo.falta { border-color: var(--vino); animation: sacudir 0.4s ease; }
.aviso-nombre {
  margin-top: 8px; font-size: 0.88rem; color: var(--vino);
  animation: aparecer 0.3s ease both;
}
@keyframes sacudir {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.botones { display: grid; gap: 12px; margin-top: 18px; }
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 22px;
  border: 1px solid var(--vino);
  border-radius: 999px;
  font-size: 1.02rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-principal { background: var(--vino); color: var(--crema); }
.btn-principal:hover { background: var(--vino-2); }
.btn-secundario { background: transparent; color: var(--vino); }
.btn-secundario:hover { background: rgba(113, 55, 68, 0.06); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.nota { font-size: 0.82rem; color: var(--suave); text-align: center; margin-top: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.oculto { display: none !important; }

/* ---------- Cola de subida ---------- */
.cola { list-style: none; padding: 0; margin-top: 20px; display: grid; gap: 10px; }
.item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 10px 8px 8px;
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: 14px;
}
.item .mini {
  width: 56px; height: 56px; object-fit: cover;
  border-radius: 10px; background: var(--crema-2);
}
.item .nombre { font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .estado { font-size: 0.78rem; color: var(--suave); }
.item.ok .estado { color: #4E6B47; }
.item.error .estado { color: #A13A3A; }
.barra { height: 4px; margin-top: 6px; background: var(--crema-2); border-radius: 4px; overflow: hidden; }
.barra span { display: block; height: 100%; width: 0; background: var(--vino); transition: width 0.2s; }
.item.ok .barra, .item.error .barra { display: none; }
.icono-estado { width: 22px; height: 22px; }
.reintentar {
  border: 0; background: none; color: var(--vino); cursor: pointer;
  font-size: 0.8rem; text-decoration: underline; padding: 4px;
}

.gracias {
  text-align: center;
  margin-top: 22px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(113, 55, 68, 0.06);
  font-family: var(--serif);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--vino);
  animation: aparecer 0.6s ease both;
}

.pie { text-align: center; margin-top: 26px; }
.enlace {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--vino);
  text-decoration: none;
  border-bottom: 1px solid var(--linea);
}

/* ---------- Galería ---------- */
.barra-galeria {
  display: flex; justify-content: center; align-items: center; gap: 10px;
  margin: 18px 0 22px;
  font-family: var(--serif); font-size: 1.1rem; color: var(--suave);
}
.punto-vivo {
  width: 8px; height: 8px; border-radius: 50%; background: var(--vino);
  animation: latido 1.8s ease-in-out infinite;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
}
.foto {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--crema-2);
  cursor: zoom-in;
  animation: aparecer 0.6s ease both;
}
.foto img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.foto:hover img { transform: scale(1.04); }
.foto .autor {
  position: absolute; left: 8px; right: 8px; bottom: 6px;
  font-family: var(--serif); font-style: italic; font-size: 0.85rem;
  text-align: left; color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.foto .play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(242, 240, 228, 0.88); color: var(--vino);
}
.foto .play svg { width: 18px; height: 18px; margin-left: 3px; }
.vacio {
  text-align: center; padding: 56px 16px;
  font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--suave);
}
.flotante {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  z-index: 5; box-shadow: var(--sombra); white-space: nowrap;
}
.flotante:active { transform: translateX(-50%) scale(0.98); }

/* ---------- Visor ---------- */
.visor {
  position: fixed; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 12px 16px;
  background: rgba(30, 12, 17, 0.95);
  color: var(--crema);
}
.visor .medio { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; width: 100%; }
.visor img, .visor video { max-width: 100%; max-height: 100%; border-radius: 8px; }
.visor .info { display: flex; gap: 18px; align-items: center; padding-top: 12px; font-size: 0.9rem; }
.visor .quien { font-family: var(--serif); font-style: italic; font-size: 1.05rem; opacity: 0.85; }
.visor .info a { color: var(--crema); }
.visor .ctrl {
  position: absolute; border: 0; cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(242, 240, 228, 0.12); color: var(--crema);
}
.visor .ctrl svg { width: 22px; height: 22px; }
.visor .cerrar { top: 10px; right: 10px; }
.visor .ant { left: 10px; top: 50%; }
.visor .sig { right: 10px; top: 50%; }

/* ---------- Admin ---------- */
.foto .borrar {
  position: absolute; top: 6px; right: 6px;
  width: 30px; height: 30px; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(242, 240, 228, 0.85); color: var(--vino);
}
.foto .borrar svg { width: 15px; height: 15px; }
.acciones-admin { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 22px; }
.acciones-admin .btn { padding: 12px 18px; font-size: 0.95rem; }
.mensaje { text-align: center; color: var(--suave); font-size: 0.9rem; margin: -8px 0 18px; min-height: 1.4em; }

.aviso-flotante {
  position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 30;
  width: max-content; max-width: calc(100% - 32px);
  padding: 10px 18px; border-radius: 999px;
  background: var(--vino); color: var(--crema); font-size: 0.88rem; text-align: center;
  box-shadow: var(--sombra); animation: aparecer 0.3s ease both;
}

@keyframes aparecer { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes latido { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
