/* Zap Terepi · páginas propias del visor (contraseña, carpetas compartidas, documentos) */
@font-face { font-family: "Figtree"; src: url("/_terepi/fuentes/figtree-latin-wght-normal.woff2") format("woff2-variations"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/_terepi/fuentes/fraunces-latin-soft-normal.woff2") format("woff2-variations"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light;
  --piedra: #f8f7f5; --cal: #eeeae4; --cal-2: #e7e1d8; --arena: #e3dace; --arena-2: #d6cab9;
  --tinta: #33261c; --tinta-2: #6e5c4d; --nogal: #5b3f2b; --nogal-hondo: #2e2219; --nogal-medio: #4a3627;
  --sobre-nogal: #f4ede3; --papel: #fbf9f6; --peligro: #a3361f;
  --display: "Fraunces", Georgia, serif; --texto: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --salida: cubic-bezier(0.22, 1, 0.36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; background: var(--piedra); color: var(--tinta); font: 400 1rem / 1.55 var(--texto); }
p { margin: 0; }
a { color: inherit; text-underline-offset: 0.2em; }
::selection { background: var(--arena); }
:focus-visible { outline: 2px solid var(--nogal); outline-offset: 2px; }

.marca { display: inline-flex; align-items: baseline; gap: 6px; font: 400 1.375rem / 1 var(--display); font-variation-settings: "SOFT" 100; letter-spacing: -0.02em; }
.marca span { font: 500 0.8125rem / 1 var(--texto); opacity: 0.7; }

.boton, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border: 0; border-radius: 999px; background: var(--nogal); color: var(--papel); font: 600 0.9375rem / 1 var(--texto);
  text-decoration: none; cursor: pointer; transition: background-color 160ms ease, transform 120ms var(--salida);
}
.boton:hover, button:hover { background: var(--nogal-hondo); }
.boton:active, button:active { transform: scale(0.97); }

/* Avisos y contraseña */
.sola { display: grid; place-items: center; padding: 24px; }
.aviso { width: min(30rem, 100%); display: grid; gap: 16px; }
.aviso h1 { font: 360 clamp(2.25rem, 6vw, 3.25rem) / 1.02 var(--display); font-variation-settings: "SOFT" 100; letter-spacing: -0.03em; margin: 18px 0 0; overflow-wrap: anywhere; text-wrap: balance; }
.aviso > p:not(.marca) { color: var(--tinta-2); font-size: 1.0625rem; }
.puerta::after { content: ""; display: block; height: 4px; border-radius: 2px; background: var(--arena); margin-top: 18px; }
.clave { display: grid; gap: 8px; margin-top: 8px; }
.clave label { font-weight: 600; font-size: 0.875rem; }
.clave .fila { display: flex; gap: 8px; }
.clave input {
  flex: 1; min-width: 0; min-height: 48px; padding: 10px 16px; border: 1px solid var(--arena-2); border-radius: 12px;
  background: var(--papel); font: inherit; color: inherit;
}
.clave input:focus { outline: none; border-color: var(--nogal); box-shadow: 0 0 0 3px rgb(91 63 43 / 0.16); }
.clave input[aria-invalid="true"] { border-color: var(--peligro); }
.clave button { min-height: 48px; }
.error { color: var(--peligro); font-weight: 500; font-size: 0.875rem; }
.alt { font-size: 0.875rem; color: var(--tinta-2); }

/* Carpeta compartida */
.barra { padding: 22px clamp(16px, 4vw, 48px); }
.carpeta { padding: 24px clamp(16px, 4vw, 48px) 96px; max-width: 1180px; }
.migas { display: flex; flex-wrap: wrap; gap: 6px; color: var(--tinta-2); font-size: 0.9375rem; }
.migas a { text-decoration: none; }
.migas a:hover { text-decoration: underline; }
.carpeta h1 { font: 360 clamp(2.25rem, 5vw, 3.5rem) / 1.02 var(--display); font-variation-settings: "SOFT" 100; letter-spacing: -0.03em; margin: 10px 0 8px; overflow-wrap: anywhere; text-wrap: balance; }
.quien { color: var(--tinta-2); }
.piezas { list-style: none; margin: 32px 0 0; padding: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 24px 16px; border-bottom: 4px solid var(--arena); }
.pieza { display: grid; gap: 2px; text-decoration: none; }
.sello {
  height: 140px; border-radius: 12px; margin-bottom: 8px; display: grid; place-items: center;
  background: var(--cal); color: var(--nogal); font: 700 0.875rem / 1 var(--texto); letter-spacing: 0.08em;
  transition: transform 200ms var(--salida), box-shadow 200ms ease;
}
.sello { position: relative; overflow: hidden; }
.sello--web { background: var(--tono); }
.sello--web > span { position: absolute; left: 18px; right: 18px; top: 18px; bottom: -6px; border-radius: 8px 8px 0 0; background: var(--papel); box-shadow: 0 2px 8px rgb(46 34 25 / 0.1); }
.sello--web i { position: absolute; left: 14px; height: 6px; border-radius: 3px; background: var(--cal-2); }
.sello--web i:nth-child(1) { top: 14px; width: 46%; height: 9px; background: rgb(46 34 25 / 0.16); }
.sello--web i:nth-child(2) { top: 34px; width: 62%; }
.sello--web i:nth-child(3) { top: 46px; width: 54%; }
.sello--web i:nth-child(4) { top: 66px; width: 32%; height: 28px; border-radius: 5px; background: var(--tono); }
.sello--imagen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sello--doc .hoja { position: relative; width: 74px; height: 96px; margin-top: 22px; border-radius: 4px; background: var(--papel); box-shadow: 0 2px 8px rgb(46 34 25 / 0.12); clip-path: polygon(0 0, 74% 0, 100% 20%, 100% 100%, 0 100%); }
.sello--doc .hoja::before { content: ""; position: absolute; right: 0; top: 0; width: 26%; height: 20%; background: var(--arena-2); }
.sello--doc .hoja b { position: absolute; left: 9px; top: 12px; font: 700 10px / 1 var(--texto); letter-spacing: 0.06em; color: var(--color); }
.sello--doc .hoja i { position: absolute; left: 9px; height: 4px; border-radius: 2px; background: var(--cal-2); }
.sello--doc .hoja i:nth-of-type(1) { top: 32px; width: 52px; }
.sello--doc .hoja i:nth-of-type(2) { top: 41px; width: 44px; }
.sello--doc .hoja i:nth-of-type(3) { top: 50px; width: 50px; }
.sello--carpeta { background: transparent; overflow: visible; }
.sello--carpeta::before { content: ""; position: absolute; left: 0; top: 0; width: 46%; height: 20px; border-radius: 10px 10px 0 0; background: var(--arena); }
.sello--carpeta::after { content: ""; position: absolute; inset: 14px 0 0; border-radius: 4px 12px 12px 12px; background: var(--arena); box-shadow: inset 0 12px 0 var(--arena), inset 0 0 0 200px var(--cal-2); clip-path: inset(0 round 4px 12px 12px 12px); }
.pieza:hover .sello { transform: translateY(-3px); box-shadow: 0 2px 6px rgb(46 34 25 / 0.08), 0 14px 28px rgb(46 34 25 / 0.1); }
.pieza .nombre { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pieza .meta { font-size: 0.8125rem; color: var(--tinta-2); }
.vacio { margin-top: 32px; padding: 48px 24px; border: 1.5px dashed var(--arena-2); border-radius: 18px; color: var(--tinta-2); text-align: center; }

/* Documento */
.documento { display: flex; flex-direction: column; height: 100svh; }
.barra--doc { display: flex; align-items: center; gap: 16px; padding: 12px clamp(16px, 3vw, 32px); background: var(--nogal-hondo); color: var(--sobre-nogal); flex-wrap: wrap; }
.barra--doc h1 { font: 380 1.25rem / 1.2 var(--display); font-variation-settings: "SOFT" 100; margin: 0; min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra--doc .marca { opacity: 0.85; }
.barra--doc .meta { font-size: 0.8125rem; color: #cdbba6; }
.barra--doc .boton { background: var(--arena); color: var(--nogal-hondo); min-height: 38px; }
.barra--doc .boton:hover { background: #fff; }
.lienzo { flex: 1; width: 100%; border: 0; background: #fff; min-height: 0; }
.lienzo--imagen, .lienzo--medio, .lienzo--descarga { display: grid; place-items: center; padding: 24px; background: var(--cal); overflow: auto; }
.lienzo--imagen img { max-width: 100%; max-height: calc(100svh - 120px); border-radius: 8px; box-shadow: 0 10px 40px rgb(46 34 25 / 0.18); }
.lienzo--medio video { max-width: 100%; max-height: calc(100svh - 120px); border-radius: 12px; background: #000; }
.lienzo--medio audio { width: min(560px, 100%); }
.lienzo--descarga { text-align: center; color: var(--tinta-2); align-content: center; gap: 16px; }
.sello.grande { width: 140px; height: 180px; font-size: 1.25rem; background: var(--papel); box-shadow: 0 6px 24px rgb(46 34 25 / 0.12); margin: 0 auto; }
.lienzo--texto { background: var(--papel); }

@media (max-width: 640px) {
  .barra--doc .marca, .barra--doc .meta { display: none; }
  .piezas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sello { height: 110px; }
}
@media (prefers-reduced-motion: reduce) { * { transition-duration: 1ms !important; } }
