html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  /* Reduce excessive bottom margin from template to make footer area smaller */
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

.app-content { flex: 1 0 auto; }

footer { flex-shrink: 0; }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ==========================
   PdfMag theme variables
   ========================== */
:root {
  --pm-primary: #2563eb;        /* blue-600 */
  --pm-primary-600: #1e40af;    /* indigo-800 */
  --pm-accent: #10b981;         /* emerald-500 */
  --pm-warning: #f59e0b;        /* amber-500 */
  --pm-danger: #ef4444;         /* red-500 */
  --pm-surface: #f8fafc;        /* slate-50 */
  --pm-muted: #64748b;          /* slate-500 */
  --pm-border: #e5e7eb;         /* gray-200 */

  /* Bridge into Bootstrap tokens */
  --bs-primary: var(--pm-primary);
  --bs-primary-rgb: 37, 99, 235;
  --bs-link-color: var(--pm-primary);
  --bs-link-hover-color: var(--pm-primary-600);
}

/* Navbar */
.navbar {
  border-bottom: 1px solid var(--pm-border) !important;
}
.navbar-brand img {
  display: block;
  height: 28px; /* ensure consistent logo size */
  width: auto;
}

/* Sidebar */
aside .list-group .list-group-item {
  border: 0;
  border-left: 3px solid transparent;
  color: #111827; /* gray-900 */
  padding: .65rem .95rem;
  background: transparent;
}
aside .list-group .list-group-item:hover {
  background: var(--pm-surface);
  border-left-color: var(--pm-primary);
}
aside .list-group .list-group-item.active,
aside .list-group .list-group-item:active {
  background: linear-gradient(90deg, rgba(37,99,235,.12), rgba(16,185,129,.10));
  border-left-color: var(--pm-primary);
  color: #0f172a; /* slate-900 */
}

/* Buttons */
.btn-primary {
  background-image: linear-gradient(180deg, var(--pm-primary), var(--pm-primary-600));
  border-color: var(--pm-primary-600);
}
.btn-primary:hover, .btn-primary:focus {
  background-image: linear-gradient(180deg, var(--pm-primary-600), var(--pm-primary));
  border-color: var(--pm-primary);
}
.btn-outline-primary {
  color: var(--pm-primary);
  border-color: var(--pm-primary);
}
.btn-outline-primary:hover, .btn-outline-primary:focus {
  background-color: var(--pm-primary);
  border-color: var(--pm-primary);
  color: #fff;
}

/* Cards */
.card-theme {
  border: 1px solid var(--pm-border);
  border-top: 4px solid var(--pm-primary);
  background-color: #fff;
}

/* Badges (custom helpers) */
.badge-free { background-color: var(--pm-accent); }
.badge-paid { background-color: var(--pm-warning); color: #111; }

/* Tables */
.table thead th {
  border-bottom: 2px solid var(--pm-border);
}
.table tbody tr:hover {
  background-color: #fafafa;
}

/* Links */
.a-muted, .link-muted { color: var(--pm-muted); text-decoration: none; }
.link-muted:hover { color: var(--pm-primary); text-decoration: underline; }

/* Helper: subtle separators */
.hr-soft { height: 1px; background: var(--pm-border); border: 0; margin: 1rem 0; }

/* Support nice figures/captions (inspiration, not copied) */
figure > figcaption {
  font-style: italic;
  color: var(--pm-muted);
  margin-top: .5rem;
}

/* QR thumbnails */
img[alt="QR"] { border: 1px solid var(--pm-border); padding: 2px; background: #fff; }

/* Landing page hero */
.hero {
  background: linear-gradient(180deg, rgba(37,99,235,.06), rgba(16,185,129,.06));
  border: 1px solid var(--pm-border);
  border-left: 0; border-right: 0;
}
.hero-logo { height: 72px; width: auto; filter: drop-shadow(0 2px 2px rgba(0,0,0,.1)); }

/* 3D tilt cards */
.container-3d { padding: 1rem 0 2rem; }
.tilt-card {
  background: #fff;
  border: 1px solid var(--pm-border);
  border-radius: .5rem;
  box-shadow: 0 6px 14px rgba(16,24,40,.06), 0 2px 6px rgba(16,24,40,.04);
  transform-style: preserve-3d;
  transition: transform .2s ease, box-shadow .2s ease;
}
.tilt-card:hover { transform: translateY(-2px); box-shadow: 0 10px 18px rgba(16,24,40,.10), 0 3px 8px rgba(16,24,40,.06); }
.tilt-card.accent { border-top: 4px solid var(--pm-accent); }
.tilt-card.info { border-top: 4px solid var(--pm-primary); }

/* Compact footer */
.footer-min { padding-top: .5rem !important; padding-bottom: .5rem !important; }
.footer-min .container { gap: .25rem; }
.footer-min .nav .nav-link { padding-left: .5rem; padding-right: .5rem; }
.footer-min, .footer-min a { font-size: .875rem; }

@media (min-height: 1200px) {
  .footer-min .container { padding-top: .25rem; padding-bottom: .25rem; }
}