/* Technical Clearance Management System - Custom Styles */
/* Authentic Brand Theme: Republic of Ghana Sovereign Heritage (Red #CE1126, Gold #FCD116, Green #006B3F) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Ghana National Authentic Palette Core */
  --ghana-red: #CE1126;
  --ghana-red-hover: #A80D1E;
  --ghana-red-light: #FDF2F2;
  --ghana-yellow: #FCD116;
  --ghana-yellow-dark: #D4AF0D;
  --ghana-yellow-light: #FFFDEB;
  --ghana-green: #006B3F;
  --ghana-green-hover: #005432;
  --ghana-green-light: #E6F4ED;
  --ghana-neutral-dark: #0F172A;

  /* Ghana Green Palette Tokens */
  --primary-50: #E6F4ED;            /* Subtle Ghana Green tint */
  --primary-100: #CCE9DC;           /* Soft Ghana Green accent */
  --primary-200: #99D3B9;           /* Medium Ghana Green highlight */
  --primary-500: #008750;           /* Vibrant sovereign Green */
  --primary-600: #006B3F;           /* Authentic Rich Ghana Green (Primary Brand) */
  --primary-700: #005432;           /* Deep institutional Ghana Green */
  --primary-800: #003E25;           /* Rich forest Ghana Green */
  --primary-900: #002919;           /* Deep obsidian forest Green */

  /* National Gold / Yellow Palette Tokens (#FCD116) */
  --accent-gold-50: #FFFDEB;
  --accent-gold-100: #FFF9C2;
  --accent-gold-200: #FFF285;
  --accent-gold-500: #FCD116;       /* Authentic Golden Yellow */
  --accent-gold-600: #D4AF0D;       /* Rich Gold hover state */
  --accent-gold-700: #AA8C07;       /* Deep Gold accent */
  --accent-gold-800: #7F6903;       /* High-contrast Gold text */

  /* National Red Palette Tokens (#CE1126) */
  --accent-red-50: #FDF2F2;
  --accent-red-100: #FCE4E4;
  --accent-red-200: #F9C9C9;
  --accent-red-500: #DE2334;
  --accent-red-600: #CE1126;        /* Authentic Vibrant Ghana Red */
  --accent-red-700: #A80D1E;
  --accent-red-800: #810A17;

  /* Focus and Ring Tokens */
  --focus-ring-green: rgba(0, 107, 63, 0.25);
  --focus-ring-gold: rgba(252, 209, 22, 0.35);
  --focus-ring-red: rgba(206, 17, 38, 0.25);

  --sidebar-width: 260px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #0F172A;
  background-color: #F8FAFC;
}

/* Applicant sign-in scene: quiet Ghana-inspired color, with a soft map watermark. */
.signin-scene {
  isolation: isolate;
  background:
    radial-gradient(circle at 88% 64%, transparent 0 9rem, rgba(0, 107, 63, .055) 9.1rem 9.2rem, transparent 9.3rem 13rem, rgba(212, 175, 13, .07) 13.1rem 13.2rem, transparent 13.3rem),
    radial-gradient(ellipse at 78% 82%, rgba(0, 107, 63, .17), transparent 40%),
    radial-gradient(ellipse at 8% 20%, rgba(252, 209, 22, .23), transparent 34%),
    radial-gradient(ellipse at 92% 8%, rgba(0, 107, 63, .10), transparent 31%),
    linear-gradient(132deg, #eaf5ef 0%, #f5f9f7 43%, #fff6e6 100%);
}

.signin-scene::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: auto 0 0;
  height: 4px;
  pointer-events: none;
  opacity: .65;
  background: linear-gradient(90deg, transparent 4%, #ce1126 28%, #fcd116 50%, #006b3f 72%, transparent 96%);
}

.signin-photo {
  position: absolute;
  z-index: 0;
  inset: -8px;
  pointer-events: none;
  background-image: url("independence-arch-front.jpg?v=2");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  opacity: .20;
}

.signin-glow {
  position: absolute;
  width: min(34rem, 75vw);
  aspect-ratio: 1;
  border-radius: 9999px;
  filter: blur(75px);
  opacity: .42;
}

.signin-glow--green {
  top: -19rem;
  left: -13rem;
  background: rgba(0, 107, 63, .16);
}

.signin-glow--gold {
  top: -21rem;
  right: -14rem;
  background: rgba(252, 209, 22, .16);
}

.ghana-watermark {
  position: absolute;
  right: clamp(1rem, 7vw, 7rem);
  bottom: -3.5rem;
  width: clamp(15rem, 27vw, 22rem);
  height: auto;
  opacity: .24;
  filter: drop-shadow(0 8px 16px rgba(0, 107, 63, .05));
}

.signin-panel {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 28px 70px -38px rgba(0, 41, 25, .35), 0 8px 24px -16px rgba(15, 23, 42, .18);
  backdrop-filter: blur(12px);
  margin-left: auto;
  margin-right: auto;
}

.signin-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  width: 76%;
  height: 3px;
  border-radius: 0 0 9999px 9999px;
  background: linear-gradient(90deg, #ce1126 0 30%, #fcd116 30% 66%, #006b3f 66% 100%);
  opacity: .8;
}

@media (max-width: 767px) {
  .signin-photo {
    background-image: url("independence-arch-front.jpg?v=2");
    background-size: cover;
    background-position: center;
  }

  .signin-panel {
    margin: 0 auto;
  }
}

/* Fixed Navigation Header - Unified Sovereign NITA Green */
#app-header header.fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 40;
  background-color: var(--ghana-green, #006B3F) !important;
  border-bottom: 1px solid var(--ghana-green-hover, #005432) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 20px -2px rgba(0, 41, 25, 0.25);
}

/* Top National Tricolor Sovereign Accent Line - Removed */
.ghana-tricolor-bar {
  display: none !important;
  height: 0;
  width: 100%;
}

/* Top Navigation Active Tab Indicator */
.nav-link {
  position: relative;
  transition: all 0.2s ease-in-out;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  border-radius: 0.75rem;
}

.nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.12);
}

.nav-link.active-nav {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.22) !important;
  font-weight: 700 !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Completely strip out any multi-colored lines under active tabs */
.nav-link.active-nav::after,
.nav-link::after {
  content: none !important;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Mobile Navigation Active State */
.mobile-nav-link {
  color: rgba(255, 255, 255, 0.85);
  transition: all 0.15s ease;
  border-radius: 0.5rem;
}

.mobile-nav-link:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.mobile-nav-link.active-mobile-nav {
  background-color: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-left: 3px solid #ffffff;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Text Selection Accent */
::selection {
  background-color: var(--primary-600, #006B3F);
  color: #ffffff;
}

/* Glassmorphism & Elevation */
.glass-panel {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

/* Status Badges & Binders */
.badge-draft {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* Submitted: Warm Gold/Yellow tint coordinated with Ghana national palette */
.badge-submitted {
  background-color: var(--accent-gold-50, #FFFDEB);
  color: var(--accent-gold-800, #7F6903);
  border: 1px solid var(--accent-gold-200, #FFF285);
}

.badge-under-review {
  background-color: var(--accent-gold-100, #FFF9C2);
  color: var(--accent-gold-700, #AA8C07);
  border: 1px solid var(--accent-gold-200, #FFF285);
}

.badge-additional-info {
  background-color: #FFFDEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.badge-approved {
  background-color: var(--primary-50, #E6F4ED);
  color: var(--primary-700, #005432);
  border: 1px solid var(--primary-200, #99D3B9);
}

.badge-rejected {
  background-color: var(--accent-red-50, #FDF2F2);
  color: var(--accent-red-700, #A80D1E);
  border: 1px solid var(--accent-red-200, #F9C9C9);
}

/* Document Binders and Checklist Badges */
.binder-badge,
.binder-item-active {
  border-left: 3px solid var(--accent-gold-500, #FCD116);
  background-color: var(--primary-50, #E6F4ED);
}

/* ==========================================================================
   Global Color Sweep: Comprehensive Blue/Navy/Cyan/Sky Overrides
   All instances mapped strictly to Signature Ghana Green (#006B3F)
   ========================================================================== */

/* Buttons & Anchor Primary Actions */
button.bg-blue-600,
a.bg-blue-600,
.bg-blue-600,
button.bg-blue-700,
a.bg-blue-700,
.bg-blue-700,
button.bg-navy,
a.bg-navy,
.bg-navy,
button.bg-indigo-600,
a.bg-indigo-600,
.bg-indigo-600 {
  background-color: var(--primary-600, #006B3F) !important;
  border-color: transparent !important;
  color: #ffffff !important;
}

button.bg-blue-600:hover,
a.bg-blue-600:hover,
.bg-blue-600:hover,
button.bg-blue-700:hover,
a.bg-blue-700:hover,
.hover\:bg-blue-500:hover,
.hover\:bg-blue-600:hover,
.hover\:bg-blue-700:hover,
.hover\:bg-navy:hover,
.hover\:bg-indigo-700:hover {
  background-color: var(--primary-700, #005432) !important;
  border-color: transparent !important;
  color: #ffffff !important;
}

/* Primary Action Button Shadows with Signature Ghana Green (#006B3F) */
.shadow-blue-500\/20,
.shadow-blue-600\/20,
.shadow-blue-600\/30,
.shadow-blue-700\/25,
.shadow-indigo-500\/20 {
  box-shadow: 0 4px 14px 0 rgba(0, 107, 63, 0.25) !important;
}

button.bg-blue-600:hover,
a.bg-blue-600:hover,
button.bg-navy:hover,
a.bg-navy:hover {
  box-shadow: 0 6px 18px 0 rgba(0, 107, 63, 0.35) !important;
}

/* Light / Secondary Blue & Cyan Backgrounds */
.bg-blue-50,
.bg-sky-50,
.bg-cyan-50,
.bg-indigo-50 {
  background-color: var(--primary-50, #E6F4ED) !important;
}

.bg-blue-100,
.bg-sky-100,
.bg-cyan-100,
.bg-indigo-100 {
  background-color: var(--primary-100, #CCE9DC) !important;
}

.hover\:bg-blue-50:hover,
.hover\:bg-sky-50:hover,
.hover\:bg-cyan-50:hover,
.hover\:bg-indigo-50:hover {
  background-color: var(--primary-50, #E6F4ED) !important;
}

.hover\:bg-blue-100:hover,
.hover\:bg-sky-100:hover,
.hover\:bg-cyan-100:hover,
.hover\:bg-indigo-100:hover {
  background-color: var(--primary-100, #CCE9DC) !important;
}

/* Borders */
.border-blue-100,
.border-sky-100,
.border-cyan-100,
.border-indigo-100 {
  border-color: var(--primary-100, #CCE9DC) !important;
}

.border-blue-200,
.border-sky-200,
.border-cyan-200,
.border-indigo-200 {
  border-color: var(--primary-200, #99D3B9) !important;
}

.border-blue-500,
.border-blue-600,
.border-navy,
.border-sky-500,
.border-cyan-500,
.border-indigo-500 {
  border-color: var(--primary-600, #006B3F) !important;
}

/* Text Colors */
.text-blue-500,
.text-blue-600,
.text-sky-600,
.text-cyan-600,
.text-indigo-600 {
  color: var(--primary-600, #006B3F) !important;
}

.text-blue-700,
.text-blue-800,
.text-blue-900,
.text-navy,
.text-sky-700,
.text-cyan-700,
.text-indigo-700 {
  color: var(--primary-700, #005432) !important;
}

.hover\:text-blue-500:hover,
.hover\:text-blue-600:hover,
.hover\:text-blue-700:hover,
.hover\:text-navy:hover,
.hover\:text-cyan-600:hover,
.hover\:text-sky-600:hover {
  color: var(--primary-700, #005432) !important;
}

/* Inline Badges & Small Indicators */
.bg-blue-50.text-blue-700 .bg-blue-500,
span.bg-blue-50 .bg-blue-500,
.bg-blue-500,
.bg-blue-400 {
  background-color: var(--primary-600, #006B3F) !important;
}

/* Focus Rings & Form Controls */
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-600, #006B3F) !important;
  box-shadow: 0 0 0 3px rgba(0, 107, 63, 0.25) !important;
  outline: none !important;
}

input[type="checkbox"]:checked {
  background-color: var(--primary-600, #006B3F) !important;
  border-color: var(--primary-600, #006B3F) !important;
}

.focus\:ring-blue-500:focus,
.focus\:ring-blue-600:focus,
.ring-blue-500\/20,
.ring-blue-600,
.focus\:ring-navy:focus {
  --tw-ring-color: rgba(0, 107, 63, 0.35) !important;
}

/* Step Wizard Indicator Styling (#006B3F Dominance) */
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  position: relative;
}

.step-circle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  background-color: #f1f5f9;
  color: #64748b;
  border: 2px solid #e2e8f0;
  transition: all 0.2s ease-in-out;
}

.step-item.active .step-circle {
  background-color: var(--primary-600, #006B3F) !important;
  color: #ffffff !important;
  border-color: var(--primary-600, #006B3F) !important;
  box-shadow: 0 0 0 4px rgba(0, 107, 63, 0.25) !important;
}

.step-item.completed .step-circle {
  background-color: var(--primary-700, #005432) !important;
  color: #ffffff !important;
  border-color: var(--primary-700, #005432) !important;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
  animation: fadeIn 0.25s ease-out forwards;
}

@keyframes pulseBorder {
  0%, 100% { border-color: rgba(217, 119, 6, 0.35); }
  50% { border-color: rgba(217, 119, 6, 0.85); }
}
.pulse-border {
  animation: pulseBorder 2s infinite ease-in-out;
}

/* ==========================================================================
   Hero Entrance & Interactive Motion Animations
   ========================================================================== */

/* Keyframe for Hero Fade and Slide Up (translate-y-4 [16px] to translate-y-0) */
@keyframes heroFadeSlideUp {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Subtle Hero Ambient Container Fade */
@keyframes heroContainerFade {
  0% {
    opacity: 0.85;
  }
  100% {
    opacity: 1;
  }
}

.animate-hero-wrapper {
  animation: heroContainerFade 0.6s ease-out forwards;
}

/* Base class for staggered hero elements */
.hero-fade-slide {
  opacity: 0;
  animation: heroFadeSlideUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: opacity, transform;
}

/* Staggered Delay Sequences */
.hero-stagger-1 {
  animation-delay: 0.1s;
}

.hero-stagger-2 {
  animation-delay: 0.22s;
}

.hero-stagger-3 {
  animation-delay: 0.36s;
}

.hero-stagger-4 {
  animation-delay: 0.5s;
}

.hero-stagger-5 {
  animation-delay: 0.64s;
}

.hero-stagger-card {
  animation-delay: 0.32s;
}

/* Primary Green Action Button Subtle Pulse & Hover Motion */
@keyframes emeraldGlowPulse {
  0%, 100% {
    box-shadow: 0 4px 14px 0 rgba(0, 107, 63, 0.35), 0 0 0 0 rgba(0, 107, 63, 0.45);
  }
  50% {
    box-shadow: 0 6px 20px 0 rgba(0, 107, 63, 0.45), 0 0 0 6px rgba(0, 107, 63, 0);
  }
}

.btn-emerald-pulse {
  position: relative;
  animation: emeraldGlowPulse 2.8s infinite cubic-bezier(0.4, 0, 0.6, 1);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.25s ease;
}

.btn-emerald-pulse:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px 0 rgba(0, 107, 63, 0.45), 0 0 0 2px rgba(0, 107, 63, 0.4) !important;
  animation-play-state: paused;
}

.btn-emerald-pulse:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px 0 rgba(0, 107, 63, 0.3) !important;
}

.btn-emerald-pulse svg {
  transition: transform 0.2s ease-in-out;
}

.btn-emerald-pulse:hover svg {
  transform: translateX(3px);
}

/* Accessibility: Respect Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  .animate-hero-wrapper,
  .hero-fade-slide,
  .btn-emerald-pulse {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .btn-emerald-pulse:hover svg {
    transform: none !important;
  }
}

/* Print Styling for Clearance Certificates */
@media print {
  @page {
    size: A4 portrait;
    /* Browser print headers and footers are controlled by the print dialog. */
    margin: 12mm;
  }
  body * {
    visibility: hidden;
  }
  #printable-certificate, #printable-certificate * {
    visibility: visible;
  }
  #printable-certificate {
    position: fixed;
    left: 0;
    top: 0;
    width: 186mm;
    height: 273mm;
    min-height: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 12mm !important;
    border: 5px double #006B3F !important;
    box-shadow: none !important;
    overflow: hidden !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  body.certificate-printing > :not(#app-main) {
    display: none !important;
  }
  body.certificate-printing #app-main {
    position: static !important;
    display: block !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    flex: none !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  body.certificate-printing #printable-certificate > div.mt-8 {
    min-height: 0 !important;
  }
  #requirements-print-root,
  #requirements-print-root * {
    visibility: visible;
  }
  #requirements-print-root {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 18px;
  }
  #requirements-print-controls {
    display: none !important;
  }
  #requirements-print-root > section {
    box-shadow: none !important;
    break-inside: auto;
    page-break-inside: auto;
  }
  #requirements-print-root h2,
  #requirements-print-root h3 {
    break-after: avoid;
    page-break-after: avoid;
  }
  #requirements-print-root tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .no-print {
    display: none !important;
  }
}

/* Consistent visible indicator for every single-choice dropdown. */
select:not([multiple]) {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364758b'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.17l3.71-3.94a.75.75 0 111.09 1.03l-4.25 4.5a.75.75 0 01-1.09 0l-4.25-4.5a.75.75 0 01.02-1.05z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1rem 1rem;
  padding-right: 2.5rem;
}
