/* SHARING TELCEL — estación (paleta del marco: #062F87) */
:root {
  --brand: #062F87;
  --brand-2: #0A44BC;
  --bg: #050d24;
  --bg-2: #081536;
  --panel: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.12);
  --txt: #f4f7ff;
  --muted: rgba(244, 247, 255, 0.6);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--txt);
  background: radial-gradient(1200px 700px at 80% -10%, var(--brand-2) 0%, transparent 55%),
              radial-gradient(900px 600px at -10% 110%, #0a2f7a33 0%, transparent 60%),
              linear-gradient(160deg, var(--bg-2), var(--bg));
  min-height: 100svh;
}

header {
  display: flex; align-items: center; gap: 16px;
  padding: 22px 30px 12px;
}
.badge {
  background: #fff; color: var(--brand);
  font-weight: 900; font-size: 18px; letter-spacing: 1px;
  border-radius: 12px; padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.head-txt h1 { font-size: 22px; font-weight: 900; letter-spacing: 2px; }
.head-txt p { color: var(--muted); font-size: 13px; margin-top: 2px; }

main {
  display: grid;
  grid-template-columns: minmax(400px, 540px) 1fr;
  gap: 26px;
  padding: 14px 30px 34px;
  align-items: start;
}
@media (max-width: 980px) { main { grid-template-columns: 1fr; } }

/* ---------- Panel de composición ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  min-height: 420px;
  backdrop-filter: blur(6px);
}
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 26px; gap: 16px; }

.dropzone {
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  user-select: none;
}
.dropzone:hover { border-color: rgba(255, 255, 255, 0.55); background: rgba(255, 255, 255, 0.07); }
.dropzone.drag { border-color: #7fa4ff; background: rgba(10, 68, 188, 0.25); transform: scale(1.01); }
.dz-inner { text-align: center; padding: 40px 26px; }
.dz-icon { font-size: 52px; margin-bottom: 10px; }
.dz-inner h2 { font-size: 24px; font-weight: 800; }
.dz-inner p { color: var(--muted); margin-top: 6px; font-size: 15px; }
.dz-hint { display: block; margin-top: 18px; font-size: 12.5px; color: var(--muted); opacity: .8; }

.preview-wrap { width: min(240px, 60%); border-radius: 14px; overflow: hidden; box-shadow: 0 14px 40px rgba(0,0,0,.45); }
.preview-wrap canvas { display: block; width: 100%; height: auto; }
.progress {
  width: 84%; height: 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12); overflow: hidden;
}
#bar { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, #2f6bff, #7fa4ff); transition: width .18s ease; }
.bar-label { font-size: 14px; color: var(--muted); }
.notice { font-size: 12.5px; color: #ffd97a; text-align: center; max-width: 90%; }

.result { padding: 22px; }
.result-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }
@media (max-width: 560px) { .result-cols { grid-template-columns: 1fr; } }
.result-gif-wrap { border-radius: 14px; overflow: hidden; box-shadow: 0 14px 40px rgba(0,0,0,.45); }
.result-gif-wrap img { display: block; width: 100%; height: auto; }
.result-qr { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.qr-wrap { background: #fff; padding: 12px; border-radius: 16px; box-shadow: 0 14px 40px rgba(0,0,0,.4); }
.qr-wrap img { display: block; width: 200px; height: 200px; }
.scan { font-weight: 800; font-size: 15px; }
.link { font-size: 11.5px; color: var(--muted); word-break: break-all; max-width: 240px; }
.result-actions { display: flex; gap: 8px; }

/* ---------- Botones ---------- */
button, a.ghost, a.primary { font-family: inherit; }
.primary {
  background: #fff; color: var(--brand);
  border: 0; border-radius: 12px;
  font-weight: 800; font-size: 15px;
  padding: 13px 22px; cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
  text-decoration: none;
}
.primary:active { transform: scale(.98); }
.ghost {
  background: rgba(255, 255, 255, 0.08); color: var(--txt);
  border: 1px solid var(--line); border-radius: 12px;
  font-weight: 600; font-size: 13.5px;
  padding: 10px 16px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.ghost:hover { background: rgba(255, 255, 255, 0.14); }

.error .err-icon {
  width: 54px; height: 54px; border-radius: 50%;
  background: #ff5470; color: #fff; font-weight: 900; font-size: 28px;
  display: flex; align-items: center; justify-content: center;
}
.error p { color: var(--txt); text-align: center; max-width: 85%; font-size: 15px; }

/* ---------- Galería ---------- */
.gallery-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.gallery-head h2 { font-size: 18px; font-weight: 800; letter-spacing: .5px; }
.count {
  background: rgba(255, 255, 255, 0.12); border-radius: 999px;
  font-size: 12.5px; padding: 3px 10px; margin-left: 6px; vertical-align: 2px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden;
  content-visibility: auto; contain-intrinsic-size: 380px;
}
.thumb { aspect-ratio: 2 / 3; background: #04102e; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.meta { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 2px; }
.meta .date { font-size: 12px; color: var(--muted); }
.meta .cid { font-size: 10.5px; color: var(--muted); opacity: .55; font-family: Consolas, monospace; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px 12px 12px; }
.act {
  background: rgba(255, 255, 255, 0.08); color: var(--txt);
  border: 1px solid var(--line); border-radius: 9px;
  font-size: 12px; font-weight: 600; padding: 8px 4px;
  cursor: pointer; text-align: center; text-decoration: none;
}
.act:hover { background: rgba(255, 255, 255, 0.16); }
.act.del:hover { background: #ff547033; border-color: #ff5470; }

/* ---------- Modal QR ---------- */
#modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(3, 8, 24, 0.78);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
#modal[hidden] { display: none; }
.modal-box {
  background: #fff; color: #14213d;
  border-radius: 20px; padding: 26px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  max-width: 92vw;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.modal-box img { width: min(340px, 70vw); height: auto; }
.modal-box p { font-size: 12.5px; color: #46557a; word-break: break-all; text-align: center; max-width: 340px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .ghost { color: #14213d; border-color: #d6ddef; background: #f1f4fb; }
.modal-actions .ghost:hover { background: #e5ebf8; }
