/* ============================================
   VideoGuarda — CSS
   Diseñado para baja visión, iPhone 8
   ============================================ */

:root {
  --azul:      #0D2B55;
  --azul-m:    #1A56A0;
  --azul-claro:#E8F0FB;
  --rojo:      #C8192A;
  --rojo-hover:#A81020;
  --verde:     #15803D;
  --verde-bg:  #DCFCE7;
  --blanco:    #FFFFFF;
  --gris-bg:   #F4F6FA;
  --gris-borde:#CBD5E1;
  --texto:     #0D2B55;
  --sombra:    0 4px 20px rgba(13,43,85,0.12);
  --radio:     18px;
  --radio-sm:  12px;
}

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

body {
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  background: var(--gris-bg);
  color: var(--texto);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ──────────────────────────────── */

.vg-header {
  background: var(--azul);
  padding: 24px 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 3px 20px rgba(0,0,0,0.3);
}

.vg-header__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-left: 20px;
  padding-right: 20px;
}

.vg-header__icon {
  background: rgba(255,255,255,0.12);
  border-radius: 14px;
  width: 62px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vg-header__icon .bi {
  font-size: 32px;
  color: #fff;
}

.vg-header__greeting {
  color: #93C5FD;
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.vg-header__name {
  color: #FFFFFF;
  font-size: clamp(26px, 7vw, 36px);
  font-weight: 900;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.5px;
}

.vg-header__sub {
  color: #93C5FD;
  font-size: clamp(14px, 3.8vw, 17px);
  font-weight: 700;
  margin: 4px 0 0;
}

/* ── MAIN ─────────────────────────────────── */

.vg-main {
  padding: 22px 16px 40px;
}

/* ── TARJETAS ────────────────────────────── */

.vg-card {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 26px 20px;
  margin-bottom: 20px;
}

.vg-card--info { border-top: 5px solid var(--azul-m); }

/* ── STEP LABEL ──────────────────────────── */

.vg-step-label {
  font-size: clamp(17px, 4.5vw, 22px);
  font-weight: 900;
  color: var(--azul);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.vg-step-num {
  background: var(--azul);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  flex-shrink: 0;
}

.vg-hint {
  font-size: clamp(15px, 3.8vw, 18px);
  color: #64748B;
  font-weight: 700;
  margin-bottom: 16px;
}

/* ── INPUT ───────────────────────────────── */

.vg-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.vg-input-icon {
  position: absolute;
  left: 16px;
  font-size: 24px;
  color: var(--azul-m);
  pointer-events: none;
  z-index: 1;
}

.vg-input {
  width: 100%;
  font-family: 'Nunito', sans-serif;
  font-size: clamp(17px, 4.5vw, 21px);
  font-weight: 700;
  padding: 18px 50px 18px 50px;
  border: 3px solid var(--gris-borde);
  border-radius: var(--radio-sm);
  color: var(--texto);
  background: #F8FAFC;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
}

.vg-input:focus {
  outline: none;
  border-color: var(--azul-m);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(26,86,160,0.15);
}

.vg-input::placeholder { color: #A0AEC0; font-weight: 700; }

.vg-input-clear {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #94A3B8;
  font-size: 22px;
  line-height: 1;
}

.vg-input-clear:hover { color: var(--rojo); }

/* ── BOTONES ─────────────────────────────── */

.vg-btn {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(19px, 5vw, 24px);
  font-weight: 900;
  padding: 18px 24px;
  border-radius: var(--radio-sm);
  border: none;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform .12s, box-shadow .12s, background .15s;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.2;
}

.vg-btn:active { transform: scale(0.97); }

.vg-btn .bi { font-size: 1.2em; }

.vg-btn--primary {
  background: var(--azul-m);
  color: #fff;
  box-shadow: 0 4px 16px rgba(26,86,160,0.35);
}
.vg-btn--primary:hover { background: #154a8a; }

.vg-btn--descargar {
  background: var(--rojo);
  color: #fff;
  box-shadow: 0 4px 16px rgba(200,25,42,0.35);
  font-size: clamp(21px, 5.5vw, 27px);
  padding: 22px 24px;
}
.vg-btn--descargar:hover { background: var(--rojo-hover); }

.vg-btn--ghost {
  background: #EEF2F7;
  color: var(--azul);
  font-size: clamp(16px, 4vw, 19px);
  padding: 14px 20px;
  box-shadow: none;
}
.vg-btn--ghost:hover { background: #DDE4EF; }

/* ── ALERTA ──────────────────────────────── */

.vg-alerta {
  font-size: clamp(17px, 4.5vw, 21px);
  font-weight: 700;
  border-radius: var(--radio-sm);
  padding: 18px 20px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.vg-alerta::before {
  font-family: "bootstrap-icons";
  font-size: 1.3em;
  flex-shrink: 0;
  margin-top: 1px;
}

.vg-alerta.error   { background:#FEE2E2; color:#7F1D1D; }
.vg-alerta.error::before { content: "\F623"; } /* bi-exclamation-circle-fill */

.vg-alerta.exito   { background: var(--verde-bg); color:#14532D; }
.vg-alerta.exito::before { content: "\F26A"; } /* bi-check-circle-fill */

.vg-alerta.info    { background:#DBEAFE; color:#1E3A8A; }
.vg-alerta.info::before  { content: "\F430"; } /* bi-info-circle-fill */

/* ── LOADER ──────────────────────────────── */

.vg-loader {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 36px 20px 30px;
  text-align: center;
  margin-bottom: 20px;
}

.vg-loader--descarga { border-top: 5px solid var(--rojo); }

.vg-loader__ring {
  width: 72px;
  height: 72px;
  border: 8px solid #CBD5E1;
  border-top-color: var(--azul-m);
  border-radius: 50%;
  animation: girar 0.8s linear infinite;
  margin: 0 auto 20px;
}

.vg-loader__ring--rojo {
  border-top-color: var(--rojo);
}

@keyframes girar { to { transform: rotate(360deg); } }

.vg-loader__texto {
  font-size: clamp(20px, 5.5vw, 26px);
  font-weight: 900;
  color: var(--azul);
  margin-bottom: 6px;
}

.vg-loader__sub {
  font-size: clamp(15px, 4vw, 18px);
  color: #64748B;
  font-weight: 700;
}

/* ── PROGRESS BAR ────────────────────────── */

.vg-progress {
  background: #E2E8F0;
  border-radius: 99px;
  height: 12px;
  overflow: hidden;
}

.vg-progress__bar {
  height: 100%;
  background: var(--rojo);
  border-radius: 99px;
  width: 0%;
  transition: width 0.4s ease;
  animation: progreso-anim 8s ease-out forwards;
}

@keyframes progreso-anim {
  0%   { width: 0%; }
  20%  { width: 30%; }
  50%  { width: 60%; }
  80%  { width: 85%; }
  100% { width: 95%; }
}

/* ── MINIATURA ───────────────────────────── */

.vg-thumb-wrap {
  border-radius: var(--radio-sm);
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
  background: #1a1a2e;
  margin-bottom: 16px;
  box-shadow: var(--sombra);
}

.vg-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vg-thumb-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.72);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  padding: 5px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── INFO VIDEO ──────────────────────────── */

.vg-video-titulo {
  font-size: clamp(19px, 5vw, 24px);
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 10px;
  color: var(--azul);
}

.vg-video-autor {
  font-size: clamp(15px, 4vw, 19px);
  color: #475569;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.vg-divider {
  height: 2px;
  background: var(--gris-bg);
  margin: 16px 0;
  border-radius: 2px;
}

/* ── CALIDADES ───────────────────────────── */

.vg-calidades {
  display: grid;
  gap: 12px;
  margin-bottom: 4px;
}

.vg-calidad-label {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #F1F5F9;
  border: 3px solid transparent;
  border-radius: var(--radio-sm);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.vg-calidad-label:hover {
  background: #E2EBF6;
  border-color: var(--azul-m);
}

.vg-calidad-label:has(input:checked) {
  background: #FEE2E2;
  border-color: var(--rojo);
}

.vg-calidad-label input[type="radio"] {
  width: 28px;
  height: 28px;
  accent-color: var(--rojo);
  flex-shrink: 0;
  cursor: pointer;
}

.vg-cal-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vg-cal-nombre {
  font-size: clamp(18px, 4.8vw, 22px);
  font-weight: 900;
  color: var(--azul);
  display: flex;
  align-items: center;
  gap: 8px;
}

.vg-cal-nombre .bi { color: var(--azul-m); font-size: 1.1em; }

.vg-cal-tamano {
  font-size: clamp(14px, 3.5vw, 17px);
  color: #64748B;
  font-weight: 700;
}

/* ── FOOTER ──────────────────────────────── */

.vg-footer {
  text-align: center;
  padding: 20px 20px 36px;
  color: #94A3B8;
  font-size: clamp(14px, 3.5vw, 17px);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ── RESPONSIVE ──────────────────────────── */

@media (min-width: 480px) {
  .vg-card { padding: 32px 28px; }
  .vg-calidades { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .vg-calidades { grid-template-columns: repeat(3, 1fr); }
}