@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Manrope:wght@400;500;600;700;800&family=Cinzel:wght@600;700;800&display=swap');

:root {
  --afca-navy: #001c3d;
  --afca-navy-deep: #001226;
  --afca-navy-light: #0d2e5c;
  --afca-yellow: #facc15;
  --afca-yellow-hover: #eab308;
  --afca-gold: #c28800;
  --afca-white: #ffffff;
  --afca-bg: #f8fafc;
  --afca-surface: #ffffff;
  --afca-border: #e2e8f0;
  
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  
  --afca-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --afca-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --afca-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --afca-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --afca-radius: 12px;
}

html {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  -webkit-text-size-adjust: 100%;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--afca-bg);
  color: var(--slate-800);
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

img, svg, video, canvas, audio, iframe, embed, object {
  max-width: 100%;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  color: var(--afca-navy);
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Global Badge Wrapping & Overflow Prevention */
.badge {
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  line-height: 1.35;
  text-align: left;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.badge.text-nowrap {
  white-space: nowrap !important;
}

/* Universal Table Responsiveness */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* AFCA Brand Navbar */
.navbar-afca {
  background: linear-gradient(135deg, var(--afca-navy-deep) 0%, var(--afca-navy) 100%);
  border-bottom: 3px solid var(--afca-yellow);
  box-shadow: var(--afca-shadow);
}

.navbar-afca .navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--afca-white);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.navbar-afca .brand-logo {
  height: 42px;
  width: auto;
  border-radius: 6px;
  background: #fff;
  padding: 2px;
}

.navbar-afca .nav-link {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
  border-radius: 8px;
}

.navbar-afca .nav-link:hover,
.navbar-afca .nav-link:focus {
  color: var(--afca-yellow);
  background: rgba(255, 255, 255, 0.08);
}

.navbar-afca .nav-link.active {
  color: var(--afca-yellow);
  background: rgba(250, 204, 21, 0.15);
}

/* Yellow Action Button */
.btn-afca-primary {
  background-color: var(--afca-yellow);
  color: var(--afca-navy);
  font-weight: 700;
  border: 1px solid var(--afca-yellow);
  border-radius: 8px;
  padding: 0.55rem 1.35rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(250, 204, 21, 0.25);
}

.btn-afca-primary:hover {
  background-color: var(--afca-yellow-hover);
  color: var(--afca-navy-deep);
  border-color: var(--afca-yellow-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(250, 204, 21, 0.35);
}

/* Navy Action Button */
.btn-afca-navy {
  background-color: var(--afca-navy);
  color: var(--afca-white);
  font-weight: 700;
  border: 1px solid var(--afca-navy);
  border-radius: 8px;
  padding: 0.55rem 1.35rem;
  transition: all 0.2s ease;
}

.btn-afca-navy:hover {
  background-color: var(--afca-navy-light);
  color: var(--afca-yellow);
  border-color: var(--afca-navy-light);
  transform: translateY(-1px);
}

/* Outline Navy Button */
.btn-outline-navy {
  color: var(--afca-navy);
  border: 1.5px solid var(--afca-navy);
  background-color: transparent;
  font-weight: 700;
  border-radius: 8px;
  padding: 0.45rem 1.15rem;
  transition: all 0.2s ease;
}

.btn-outline-navy:hover,
.btn-outline-navy:focus {
  background-color: var(--afca-navy);
  color: #ffffff;
  border-color: var(--afca-navy);
}

/* Brand Color Utilities */
.bg-navy {
  background-color: var(--afca-navy) !important;
  color: #ffffff !important;
}

.bg-navy-deep {
  background-color: var(--afca-navy-deep) !important;
  color: #ffffff !important;
}

.bg-navy-light {
  background-color: var(--afca-navy-light) !important;
  color: #ffffff !important;
}

.text-navy {
  color: var(--afca-navy) !important;
}

.bg-navy h1, .bg-navy h2, .bg-navy h3, .bg-navy h4, .bg-navy h5, .bg-navy h6,
.bg-navy-deep h1, .bg-navy-deep h2, .bg-navy-deep h3, .bg-navy-deep h4, .bg-navy-deep h5, .bg-navy-deep h6 {
  color: #ffffff !important;
}

.card-header.bg-navy {
  background: linear-gradient(135deg, var(--afca-navy-deep) 0%, var(--afca-navy) 100%) !important;
  border-bottom: 3px solid var(--afca-yellow) !important;
  color: #ffffff !important;
}

.card-header.bg-navy h1,
.card-header.bg-navy h2,
.card-header.bg-navy h3,
.card-header.bg-navy h4,
.card-header.bg-navy h5,
.card-header.bg-navy h6 {
  color: #ffffff !important;
}

/* High Contrast Badges and Code Utilities */
.badge.bg-white.text-navy {
  background-color: #ffffff !important;
  color: var(--afca-navy) !important;
}

.badge.bg-navy {
  background-color: var(--afca-navy) !important;
  color: #ffffff !important;
}

.badge.bg-warning {
  background-color: var(--afca-yellow) !important;
  color: var(--afca-navy-deep) !important;
}

/* Global Code Element Visibility & Contrast */
code {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.875em;
  color: var(--afca-navy);
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.bg-navy code,
.bg-navy-deep code,
.afca-hero code {
  color: var(--afca-navy) !important;
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
}

/* Cards & Elevated Containers */
.card-afca {
  background: var(--afca-surface);
  border: 1px solid var(--afca-border);
  border-radius: var(--afca-radius);
  box-shadow: var(--afca-shadow-sm);
  transition: all 0.25s ease;
}

.card-afca:hover {
  box-shadow: var(--afca-shadow);
  border-color: #cbd5e1;
}

.card-afca-interactive:hover {
  transform: translateY(-3px);
  box-shadow: var(--afca-shadow-lg);
  border-color: var(--afca-yellow);
}

/* AFCA Hero Header */
.afca-hero {
  background: linear-gradient(135deg, var(--afca-navy-deep) 0%, var(--afca-navy) 60%, var(--afca-navy-light) 100%);
  color: var(--afca-white);
  border-radius: 1.25rem;
  padding: 3.5rem 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--afca-shadow-xl);
  border: 1px solid rgba(250, 204, 21, 0.2);
}

.afca-hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.12) 0%, rgba(0, 28, 61, 0) 70%);
  pointer-events: none;
}

.afca-hero h1 {
  color: var(--afca-white);
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.afca-hero .lead {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  max-width: 650px;
}

.afca-badge-yellow {
  background-color: rgba(250, 204, 21, 0.2);
  color: #b45309;
  border: 1px solid rgba(250, 204, 21, 0.4);
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.afca-badge-navy {
  background-color: rgba(0, 28, 61, 0.1);
  color: var(--afca-navy);
  border: 1px solid rgba(0, 28, 61, 0.2);
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
}

/* Sidebar Styling for 7 Roles */
.has-role-sidebar {
  padding-left: 260px;
  transition: padding-left 0.3s ease;
}

.role-sidebar {
  width: 260px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--afca-navy-deep);
  color: #fff;
  z-index: 1040;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
}

.role-sidebar-header {
  padding: 20px 18px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 2px solid var(--afca-yellow);
}

.role-sidebar-header .brand-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.role-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--afca-yellow);
  color: var(--afca-navy);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-top: 4px;
}

.role-sidebar-nav {
  list-style: none;
  padding: 14px 10px;
  margin: 0;
}

.role-sidebar-nav li {
  margin-bottom: 3px;
}

.role-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.role-sidebar-nav a i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  color: var(--afca-yellow);
  opacity: 0.85;
}

.role-sidebar-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.role-sidebar-nav a:hover i {
  opacity: 1;
}

.role-sidebar-nav a.active {
  color: var(--afca-navy);
  background: var(--afca-yellow);
  font-weight: 700;
}

.role-sidebar-nav a.active i {
  color: var(--afca-navy);
  opacity: 1;
}

/* Mobile Sidebar Behavior */
@media (max-width: 991.98px) {
  .has-role-sidebar {
    padding-left: 0;
  }
  .role-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .role-sidebar.show {
    transform: translateX(0);
  }
  .role-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
  }
  .role-sidebar-overlay.show {
    display: block;
  }
}

/* ==================== Student Portal Layout & Sidebar ==================== */
.statement-shell {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.statement-sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--afca-navy-deep);
  border-radius: var(--afca-radius);
  padding: 22px 16px;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(0, 18, 38, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.statement-sidebar .sidebar-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: #ffffff;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: -0.01em;
}

.statement-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.statement-menu li {
  margin-bottom: 4px;
}

.statement-menu a {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s ease;
}

.statement-menu a i {
  width: 20px;
  text-align: center;
  color: #94a3b8;
  transition: color 0.2s ease;
}

.statement-menu a:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.statement-menu a:hover i {
  color: #ffffff;
}

.statement-menu a.active {
  background: var(--afca-navy-light);
  color: #ffffff;
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--afca-yellow);
}

.statement-menu a.active i {
  color: var(--afca-yellow);
}

.statement-content {
  flex: 1;
  min-width: 0;
}

@media (max-width: 991.98px) {
  .statement-shell {
    flex-direction: column;
    gap: 16px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .statement-sidebar {
    width: 100%;
    min-width: 100%;
    padding: 14px;
    margin-bottom: 0;
  }
  .statement-content {
    width: 100%;
    min-width: 0;
  }
}

/* Self-Study Classroom & Video Player */
.classroom-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.classroom-mobile-nav {
  display: none;
}

@media (max-width: 991.98px) {
  .classroom-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .classroom-mobile-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
  }
  .classroom-mobile-nav .nav-link {
    flex: 1;
    text-align: center;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--afca-border);
    background: #fff;
    color: var(--afca-navy);
  }
  .classroom-mobile-nav .nav-link.active {
    background: var(--afca-navy);
    color: #fff;
    border-color: var(--afca-navy);
  }
}

.video-player-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--afca-radius);
  background: #000;
  box-shadow: var(--afca-shadow-lg);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  max-width: 100%;
}

.video-player-container iframe,
.video-player-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Protected Video Shields - dynamically scaled across screen sizes */
.video-shield-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  z-index: 10;
  background: transparent;
  cursor: default;
  pointer-events: auto;
}

.video-shield-bottom-right {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 95px;
  height: 50px;
  z-index: 10;
  background: transparent;
  cursor: default;
  pointer-events: auto;
}

.video-shield-bottom-left {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 80px;
  height: 60px;
  z-index: 10;
  background: transparent;
  cursor: default;
  pointer-events: auto;
}

@media (max-width: 767.98px) {
  .video-shield-top {
    height: 42px;
  }
  .video-shield-bottom-right {
    width: 78px;
    height: 38px;
  }
  .video-shield-bottom-left {
    width: 70px;
    height: 48px;
  }
}

@media (max-width: 480px) {
  .video-shield-top {
    height: 34px;
  }
  .video-shield-bottom-right {
    width: 65px;
    height: 30px;
  }
  .video-shield-bottom-left {
    width: 60px;
    height: 42px;
  }
}

.btn-player-fullscreen {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 15;
  background: rgba(0, 28, 61, 0.75);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease, transform 0.1s ease, color 0.2s ease;
  backdrop-filter: blur(4px);
}

.btn-player-fullscreen:hover {
  background: #001c3d;
  color: #ffb800;
  border-color: #ffb800;
  transform: scale(1.05);
}

.video-player-container:fullscreen {
  border-radius: 0;
  padding-bottom: 0;
  height: 100vh;
  width: 100vw;
}

.video-player-container:-webkit-full-screen {
  border-radius: 0;
  padding-bottom: 0;
  height: 100vh;
  width: 100vw;
}

.playlist-sidebar {
  background: var(--afca-surface);
  border: 1px solid var(--afca-border);
  border-radius: var(--afca-radius);
  box-shadow: var(--afca-shadow-sm);
  max-height: 800px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 991.98px) {
  .playlist-sidebar {
    max-height: none;
  }
}

.playlist-lesson-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--afca-border);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--slate-700);
  transition: all 0.2s ease;
  min-height: 48px;
}

.playlist-lesson-item:hover {
  background: var(--slate-100);
  color: var(--afca-navy);
}

.playlist-lesson-item.active {
  background: rgba(0, 28, 61, 0.05);
  border-left: 4px solid var(--afca-navy);
  color: var(--afca-navy);
  font-weight: 700;
}

.playlist-lesson-item .check-icon {
  color: #10b981;
  flex-shrink: 0;
}

/* Exam Timer & Examination Room */
.exam-header {
  background: var(--afca-navy);
  color: #fff;
  border-radius: var(--afca-radius);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--afca-shadow);
  border-left: 6px solid var(--afca-yellow);
  flex-wrap: wrap;
  gap: 14px;
}

@media (max-width: 767.98px) {
  .exam-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
  }
}

.exam-timer {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(250, 204, 21, 0.4);
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--afca-yellow);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

@media (max-width: 767.98px) {
  .exam-timer {
    font-size: 1.1rem;
    padding: 6px 14px;
    align-self: flex-start;
  }
}

.exam-timer.urgent {
  background: #dc2626;
  color: #fff;
  border-color: #ef4444;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.question-card {
  background: #fff;
  border: 1px solid var(--afca-border);
  border-radius: var(--afca-radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--afca-shadow-sm);
}

.option-label {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border: 2px solid var(--slate-200);
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-label:hover {
  background: var(--slate-100);
  border-color: #cbd5e1;
}

.option-label.selected,
input[type="radio"]:checked + .option-label,
input[type="checkbox"]:checked + .option-label {
  border-color: var(--afca-navy);
  background: rgba(0, 28, 61, 0.04);
}

/* ==================== Digital Certificate Styling ==================== */
.certificate-frame {
  max-width: 900px;
  margin: 0 auto;
  background: #ffffff;
  padding: 40px;
  border: 16px solid var(--afca-navy);
  border-image: linear-gradient(to right, var(--afca-navy-deep), var(--afca-navy), var(--afca-navy-deep)) 30;
  position: relative;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
  font-family: 'Cinzel', serif;
  color: var(--afca-navy-deep);
  text-align: center;
  background-image: radial-gradient(circle at 50% 50%, rgba(250, 204, 21, 0.03) 0%, rgba(255, 255, 255, 1) 70%);
}

.certificate-inner-border {
  border: 3px double var(--afca-gold);
  padding: 30px 20px;
  position: relative;
}

.cert-logo {
  height: 75px;
  margin-bottom: 12px;
}

.cert-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--afca-navy);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.cert-subtitle {
  font-size: 1.1rem;
  color: var(--afca-gold);
  letter-spacing: 0.18em;
  margin-bottom: 24px;
  text-transform: uppercase;
  font-weight: 700;
}

.cert-awarded-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--slate-600);
  margin-bottom: 12px;
}

.cert-recipient {
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--afca-navy);
  border-bottom: 2px solid var(--afca-gold);
  display: inline-block;
  padding: 0 30px 6px;
  margin-bottom: 18px;
  letter-spacing: 0.05em;
}

.cert-reason {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem;
  color: var(--slate-700);
  max-width: 650px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.cert-course {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--afca-navy);
  display: block;
  margin-top: 6px;
  letter-spacing: 0.04em;
}

.cert-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 40px;
  padding: 0 20px;
}

.cert-sign-block {
  text-align: center;
  width: 220px;
}

.cert-signature-img {
  max-height: 55px;
  margin-bottom: 6px;
}

.cert-sign-line {
  border-top: 1.5px solid var(--slate-400);
  padding-top: 6px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--slate-800);
}

.cert-seal {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px double var(--afca-gold);
  background: radial-gradient(circle, #fff 40%, #fef3c7 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(194, 136, 0, 0.25);
  margin: 0 auto;
}

.cert-serial {
  font-family: 'Plus Jakarta Sans', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--slate-500);
  letter-spacing: 0.08em;
  margin-top: 20px;
}

@media (max-width: 767.98px) {
  .certificate-frame {
    padding: 16px 10px;
    border-width: 8px;
    max-width: 100%;
    box-shadow: none;
  }
  .certificate-inner-border {
    padding: 18px 10px;
    border-width: 2px;
  }
  .cert-logo {
    height: 52px;
  }
  .cert-title {
    font-size: 1.4rem;
    letter-spacing: 0.05em;
  }
  .cert-subtitle {
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
  }
  .cert-recipient {
    font-size: 1.35rem;
    padding: 0 12px 4px;
    word-break: break-word;
  }
  .cert-reason {
    font-size: 0.88rem;
    margin-bottom: 16px;
  }
  .cert-course {
    font-size: 1.1rem;
    word-break: break-word;
  }
  .cert-footer-row {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 24px;
    padding: 0;
  }
  .cert-sign-block {
    width: 100%;
    max-width: 220px;
  }
  .cert-seal {
    width: 80px;
    height: 80px;
    order: -1;
    margin-bottom: 8px;
  }
}

@media (max-width: 575.98px) {
  .card-body.p-4, .card.p-4, .card-body.p-md-5 {
    padding: 1.15rem !important;
  }
  .display-5 {
    font-size: 1.85rem !important;
  }
  .display-6 {
    font-size: 1.5rem !important;
  }
  .btn-lg {
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
  }
  .border-end {
    border-right: none !important;
  }
}

@media print {
  @page {
    size: landscape;
    margin: 6mm 8mm;
  }
  html, body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  header, nav, .navbar, footer, aside,
  .statement-sidebar, .role-sidebar, .btn, .no-print,
  .has-role-sidebar > aside,
  .statement-shell > aside,
  .alert, .toast, .modal {
    display: none !important;
  }
  .has-role-sidebar,
  .statement-shell,
  .statement-content,
  .student-statement,
  .cert-print-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: calc(100vh - 12mm) !important;
    max-width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    background: none !important;
  }
  .certificate-frame {
    box-sizing: border-box !important;
    width: 100% !important;
    height: calc(100vh - 14mm) !important;
    min-height: calc(100vh - 14mm) !important;
    max-height: calc(100vh - 14mm) !important;
    margin: 0 auto !important;
    padding: 16px 20px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: stretch !important;
    border: 12px solid var(--afca-navy) !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
    background: #ffffff !important;
    background-image: radial-gradient(circle at 50% 50%, rgba(250, 204, 21, 0.04) 0%, rgba(255, 255, 255, 1) 70%) !important;
  }
  .certificate-inner-border {
    box-sizing: border-box !important;
    width: 100% !important;
    height: 100% !important;
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    border: 2px double var(--afca-gold) !important;
    padding: 14px 20px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  .cert-logo {
    height: 60px !important;
    margin-bottom: 4px !important;
  }
  .cert-title {
    font-size: 1.85rem !important;
    margin-bottom: 2px !important;
    color: var(--afca-navy) !important;
  }
  .cert-subtitle {
    font-size: 1rem !important;
    margin-bottom: 10px !important;
    color: var(--afca-gold) !important;
  }
  .cert-recipient {
    font-size: 2.1rem !important;
    padding: 0 24px 4px !important;
    margin-bottom: 10px !important;
    color: var(--afca-navy) !important;
    border-bottom: 2px solid var(--afca-gold) !important;
  }
  .cert-reason {
    font-size: 0.98rem !important;
    margin: 0 auto 12px !important;
    line-height: 1.4 !important;
    max-width: 820px !important;
  }
  .cert-course {
    font-size: 1.35rem !important;
    margin-top: 4px !important;
    color: var(--afca-navy) !important;
  }
  .cert-footer-row {
    margin-top: 8px !important;
  }
  .cert-serial {
    font-size: 0.74rem !important;
    margin-top: 6px !important;
  }
}
