:root {
  --brand: #2b3a67;
  --brand-light: #4a5a94;
  --accent: #f2a541;
}
body {
  background: #f5f7fb;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
.bg-primary-custom { background-color: var(--brand) !important; }
.navbar-brand { letter-spacing: .5px; }
.card { border: none; border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.card-header { border-radius: 14px 14px 0 0 !important; background: var(--brand); color: #fff; font-weight: 600; }
.btn-primary { background-color: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background-color: var(--brand-light); border-color: var(--brand-light); }
.btn-accent { background-color: var(--accent); border-color: var(--accent); color: #222; }
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--brand), var(--brand-light)); }
.login-card { max-width: 420px; width: 100%; }
.subject-card { transition: transform .15s ease; }
.subject-card:hover { transform: translateY(-3px); }
#exam-timer { font-size: 1.4rem; font-weight: 700; }
#exam-timer.text-danger { animation: blink 1s linear infinite; }
@keyframes blink { 50% { opacity: .4; } }
.question-box { border-left: 4px solid var(--brand); padding-left: 1rem; margin-bottom: 1.5rem; }
video { max-width: 100%; border-radius: 10px; background: #000; }

/* Botones flotantes de contacto */
.floating-contacts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1050;
}
.floating-contact-btn {
  width: 54px; height: 54px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.4rem;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  transition: transform .15s ease;
  text-decoration: none;
}
.floating-contact-btn:hover { transform: scale(1.1); color: #fff; }
.floating-contact-whatsapp { background: #25D366; }
.floating-contact-email { background: #2b3a67; }
.floating-contact-phone { background: #4a5a94; }
.floating-contact-other { background: #f2a541; color: #222; }

/* Página de login pública */
.hero-bg {
  background-size: cover;
  background-position: center;
  position: relative;
}
.hero-bg::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(43,58,103,.88), rgba(74,90,148,.85));
}
.hero-content { position: relative; z-index: 1; }
.team-photo { width: 140px; height: 140px; object-fit: cover; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.avatar-lg { width: 140px; height: 140px; object-fit: cover; border-radius: 50%; border: 4px solid #eee; }
.hours-table td, .hours-table th { padding: .6rem 1rem; }

/* Certificado / diploma */
.certificate {
  max-width: 1000px;
  margin: 0 auto;
  background: #fff;
}
.cert-border {
  border: 3px solid #2b3a67;
  padding: 10px;
  border-radius: 4px;
}
.cert-inner {
  border: 1px solid #f2a541;
  padding: 50px 60px;
  text-align: center;
  position: relative;
}
.cert-logo { max-height: 65px; margin-bottom: 18px; }
.cert-kicker { font-size: .95rem; letter-spacing: 3px; text-transform: uppercase; color: #f2a541; font-weight: 700; margin-bottom: 4px; }
.cert-institution { font-size: 1.3rem; color: #2b3a67; font-weight: 700; margin-bottom: 26px; }
.cert-presents { font-size: 1rem; color: #666; margin-bottom: 10px; }
.cert-name { font-family: 'Playfair Display', Georgia, serif; font-size: 2.6rem; color: #2b3a67; font-weight: 700; margin-bottom: 22px; border-bottom: 2px solid #f2a541; display: inline-block; padding-bottom: 10px; }
.cert-message { font-size: 1.05rem; color: #444; max-width: 650px; margin: 0 auto 14px; line-height: 1.6; }
.cert-grade { font-size: .95rem; color: #2b3a67; font-weight: 600; margin-bottom: 24px; }
.cert-footer { display: flex; justify-content: center; gap: 90px; margin: 40px 0 30px; }
.cert-sign, .cert-date { text-align: center; min-width: 200px; }
.cert-signature-img { max-height: 55px; margin-bottom: 4px; }
.cert-sign-line { border-top: 1px solid #999; margin-top: 40px; margin-bottom: 6px; }
.cert-sign-name { font-weight: 700; color: #2b3a67; font-size: .95rem; }
.cert-sign-title { font-size: .8rem; color: #888; }
.cert-code { font-size: .75rem; color: #aaa; text-align: left; }
.cert-verify-row { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 10px; }
.cert-qr { flex-shrink: 0; line-height: 0; }
.cert-qr img { display: block; }

/* Calendario unificado */
.calendar-table { table-layout: fixed; }
.calendar-cell { height: 110px; vertical-align: top; padding: 4px; overflow: hidden; }
.calendar-daynum { font-weight: 600; font-size: .85rem; color: #555; margin-bottom: 3px; }
.calendar-today { display: inline-block; background: #2b3a67; color: #fff; border-radius: 50%; width: 22px; height: 22px; text-align: center; line-height: 22px; }
.calendar-event { display: block; font-size: .7rem; padding: 1px 4px; border-radius: 4px; margin-bottom: 2px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-event:hover { opacity: .8; }
@media (max-width: 767px) {
  .calendar-cell { height: 70px; font-size: .7rem; }
  .calendar-event { font-size: .6rem; }
}

/* Constancia de Estudio (formato carta) */
.study-cert { max-width: 750px; margin: 0 auto; background: #fff; }
.study-cert-inner { border: 1px solid #ddd; padding: 50px 60px; }
.study-cert-header { text-align: center; margin-bottom: 30px; }
.study-cert-logo { max-height: 70px; margin-bottom: 10px; }
.study-cert-institution { font-size: 1.2rem; font-weight: 700; color: #2b3a67; }
.study-cert-title { text-align: center; font-size: 1.3rem; font-weight: 700; letter-spacing: 2px; color: #f2a541; margin-bottom: 30px; }
.study-cert-body { font-size: 1rem; line-height: 1.9; color: #333; text-align: justify; margin-bottom: 40px; }
.study-cert-footer { text-align: center; margin-top: 50px; }
.study-cert-sign-line { border-top: 1px solid #999; width: 260px; margin: 0 auto 8px; }
.study-cert-sign-name { font-weight: 700; color: #2b3a67; }
.study-cert-sign-title { font-size: .85rem; color: #888; }
.study-cert-code { text-align: center; font-size: .75rem; color: #aaa; margin-top: 30px; }
@media print {
  body * { visibility: hidden; }
  .study-cert, .study-cert * { visibility: visible; }
  .study-cert { position: absolute; top: 0; left: 0; width: 100%; margin: 0; }
  @page { margin: 1.5cm; }
}

@media print {
  body * { visibility: hidden; }
  .certificate, .certificate * { visibility: visible; }
  .certificate { position: absolute; top: 0; left: 0; width: 100%; margin: 0; }
  @page { size: landscape; margin: 0.5cm; }
}
