/* =========================================================
   Tristan Holding — Frontend Stylesheet
   ========================================================= */

/* Typography & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  color: #333;
  line-height: 1.7;
  overflow-x: hidden;
}

.candidate-portal-body {
  background: #f4f7fb;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Inter', sans-serif;
  line-height: 1.2;
}

.fw-500 {
  font-weight: 500 !important;
}

.fw-600 {
  font-weight: 600 !important;
}

.fw-700 {
  font-weight: 700 !important;
}

.fw-800 {
  font-weight: 800 !important;
}

/* Navbar */
#mainNav {
  transition: box-shadow .3s, background .3s;
  padding: .75rem 0;
}

#mainNav.scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, .1) !important;
}

#mainNav .nav-link {
  font-weight: 500;
  padding: .5rem .85rem;
  transition: color .2s;
}

#mainNav .nav-link:hover,
#mainNav .nav-link.active {
  color: #4da6ff;
}

#mainNav .dropdown-menu {
  border: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
  border-radius: 12px;
  padding: .5rem;
  min-width: 600px;
}

#mainNav .dropdown-item {
  border-radius: 8px;
  padding: .5rem 1rem;
  font-size: .9rem;
  font-weight: 500;
  transition: background .15s;
}

#mainNav .dropdown-item:hover {
  background: #f0f4ff;
  color: #1a3a6b;
}

/* Top Bar */
.top-bar a:hover {
  opacity: .85;
}

/* Buttons */
.btn {
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: all .2s;
}

.btn-primary {
  background: #1a3a6b;
  border-color: #1a3a6b;
}

.btn-primary:hover {
  background: #0f2a55;
  border-color: #0f2a55;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 58, 107, .3);
}

.btn-outline-primary {
  color: #1a3a6b;
  border-color: #1a3a6b;
}

.btn-outline-primary:hover {
  background: #1a3a6b;
  border-color: #1a3a6b;
}

/* Hero */
.hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="80" cy="20" r="40" fill="rgba(77,166,255,0.03)"/><circle cx="10" cy="80" r="30" fill="rgba(77,166,255,0.03)"/></svg>') no-repeat;
  background-size: cover;
  pointer-events: none;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.animate-bounce {
  animation: bounce 2s infinite;
}

/* Sector Cards */
.sector-card {
  transition: transform .3s, box-shadow .3s;
}

.sector-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .12) !important;
}

/* Quill Content (rendered on frontend) */
.quill-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #2c3e50;
}

.quill-content h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #0a1628;
  margin-top: 2rem;
}

.quill-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0a1628;
  margin-top: 1.8rem;
}

.quill-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a3a6b;
  margin-top: 1.5rem;
}

.quill-content p {
  margin-bottom: 1.2rem;
}

.quill-content ul,
.quill-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.2rem;
}

.quill-content li {
  margin-bottom: .4rem;
}

.quill-content a {
  color: #1a3a6b;
  font-weight: 600;
}

.quill-content a:hover {
  color: #0d5c8a;
}

.quill-content blockquote {
  border-left: 4px solid #1a3a6b;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: #f0f4ff;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #555;
}

.quill-content pre {
  background: #1a2942;
  color: #e0e0e0;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
}

.quill-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 1rem 0;
}

/* Page Hero */
.page-hero {
  padding: 80px 0;
}

.page-hero nav a {
  text-decoration: none;
}

/* Cards */
.card {
  transition: box-shadow .2s;
}

/* Footer */
.footer-main {
  font-size: .9rem;
}

.candidate-auth-section {
  padding: 80px 0;
  background: radial-gradient(circle at top left, rgba(77, 166, 255, .14), transparent 35%), linear-gradient(180deg, #f8fbff 0%, #eef3fb 100%);
}

.candidate-auth-card {
  max-width: 560px;
  margin: 0 auto;
  padding: 2rem;
  border-radius: 24px;
  background: #fff;
}

.candidate-auth-intro h1 {
  color: #0a1628;
  font-weight: 800;
  margin-bottom: .5rem;
}

.auth-badge {
  background: #e8f0fe;
  color: #1a3a6b;
  margin-bottom: 1rem;
}

.candidate-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.candidate-sidebar {
  background: linear-gradient(180deg, #0a1628, #15345f);
  color: #fff;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.candidate-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.candidate-brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.candidate-brand-title {
  font-weight: 800;
}

.candidate-brand-subtitle {
  color: #9ab4d6;
  font-size: .85rem;
}

.candidate-nav {
  display: grid;
  gap: .35rem;
}

.candidate-nav-link {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .85rem 1rem;
  border-radius: 14px;
  color: #dce9f7;
  text-decoration: none;
}

.candidate-nav-link:hover,
.candidate-nav-link.active {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.candidate-sidebar-footer {
  margin-top: auto;
}

.candidate-main {
  padding: 1.5rem;
}

.candidate-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.candidate-topbar-label {
  color: #68778d;
  font-size: .85rem;
}

.candidate-page-title {
  margin: 0;
  color: #0a1628;
  font-size: 2rem;
  font-weight: 800;
}

.candidate-summary-chip {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: #fff;
  border-radius: 999px;
  padding: .7rem 1rem;
  box-shadow: 0 10px 24px rgba(17, 37, 68, .08);
  color: #1a3a6b;
  font-weight: 700;
}

.portal-stat-card {
  background: #fff;
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 0 10px 24px rgba(17, 37, 68, .08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.portal-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #0a1628;
}

.portal-stat-label {
  color: #68778d;
}

.portal-stat-icon {
  font-size: 1.8rem;
  color: #4da6ff;
}

.portal-timeline,
.portal-history {
  list-style: none;
  padding: 0;
  margin: 0;
}

.portal-timeline li,
.portal-history li {
  padding: 1rem 0;
  border-bottom: 1px solid #eef2f7;
}

.portal-timeline li.is-complete span {
  color: #0a1628;
  font-weight: 700;
}

.portal-timeline li small,
.portal-history li .small {
  display: block;
  color: #68778d;
}

.site-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1200;
  display: grid;
  gap: .75rem;
}

.site-toast {
  min-width: 280px;
  max-width: 360px;
  background: #0a1628;
  color: #fff;
  border-radius: 16px;
  padding: 1rem 1.1rem;
  box-shadow: 0 14px 35px rgba(0, 0, 0, .2);
  transform: translateY(-8px);
  opacity: 0;
  transition: all .25s ease;
}

/* Service and landing pages */
.service-hero {
  position: relative;
  overflow: hidden;
}

.service-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, .12), transparent 30%), radial-gradient(circle at bottom left, rgba(255, 255, 255, .08), transparent 24%);
  pointer-events: none;
}

.service-hero-blue {
  background: linear-gradient(135deg, #0a1628, #1a3a6b 55%, #0d5c8a);
}

.service-hero-slate {
  background: linear-gradient(135deg, #16263f, #27486f 58%, #376f8e);
}

.service-hero-warm {
  background: linear-gradient(135deg, #33211a, #7a4027 58%, #c86b2f);
}

.service-kicker {
  display: inline-block;
  margin-bottom: .9rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.service-title {
  max-width: 760px;
  font-size: clamp(2rem, 4vw, 3.35rem);
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: 1rem;
}

.service-subtitle {
  max-width: 720px;
  font-size: 1.05rem;
}

.service-panel {
  padding: 1.5rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.service-panel-stat {
  color: #ffd28a;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .6rem;
}

.service-card {
  height: 100%;
  padding: 1.35rem 1.4rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #e9eef5;
  box-shadow: 0 16px 40px rgba(15, 42, 85, .06);
}

.service-card h3,
.service-card h4,
.service-step-card h5 {
  color: #0a1628;
  font-weight: 700;
}

.service-card p,
.service-step-card p,
.service-mini-card p {
  color: #66758a;
}

.service-mini-card {
  padding: 1.25rem;
  border-radius: 18px;
  background: #f7faff;
  border: 1px solid #e7eef9;
}

.service-mini-card i {
  color: #1a3a6b;
}

.service-step-card {
  position: relative;
  padding: 1.25rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #e8edf5;
  box-shadow: 0 14px 30px rgba(15, 42, 85, .05);
}

.service-step-number {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .9rem;
  border-radius: 12px;
  background: #e8f0fe;
  color: #1a3a6b;
  font-weight: 800;
}

.service-list {
  padding-left: 1.2rem;
  color: #5f6f84;
}

.service-list li+li {
  margin-top: .6rem;
}

.site-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.site-toast-success {
  border-left: 4px solid #28a745;
}

.site-toast-error {
  border-left: 4px solid #dc3545;
}

.site-toast-message {
  font-weight: 700;
}

.site-toast-details {
  margin-top: .45rem;
  font-size: .9rem;
  color: #c1d4f2;
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 92px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: #0a1628;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .2);
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  z-index: 999;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.track-promo-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, .68);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1400;
  padding: 1rem;
}

.track-promo-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 24px;
  padding: 2rem;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.track-promo-badge {
  display: inline-block;
  margin-bottom: 1rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: #e8f0fe;
  color: #1a3a6b;
  font-size: .8rem;
  font-weight: 700;
}

.track-promo-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: none;
  font-size: 1.5rem;
  color: #6d7c94;
}

/* Timeline (frontend tracking) */
.timeline-track .d-flex:last-child>.flex-shrink-0>div+div {
  display: none;
}

/* Form Controls */
.form-control,
.form-select {
  border-radius: 8px;
  border-color: #dee2e6;
  padding: .55rem .85rem;
}

.form-control:focus,
.form-select:focus {
  border-color: #1a3a6b;
  box-shadow: 0 0 0 .2rem rgba(26, 58, 107, .15);
}

/* Sections */
section {
  position: relative;
}

/* Responsive */
/* Mobile Optimizations (max-width: 768px) */
@media (max-width: 768px) {
  /* Layout */
  .hero-section {
    min-height: 0;
    padding: 60px 0;
  }

  .page-hero {
    padding: 40px 0;
  }

  h1 {
    font-size: 1.75rem;
  }

  /* Header & Navigation */
  #mainNav {
    height: 70px !important;
  }

  .top-bar-compact {
    font-size: 0.75rem !important;
  }

  .top-bar-compact .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .header-logo {
    height: 55px !important;
  }

  #navbarMain {
    background: #16151A;
    margin: 0 -15px;
    padding: 15px;
    border-top: 1px solid #28272d;
    max-height: 80vh;
    overflow-y: auto;
  }

  .navbar-nav .nav-link {
    padding: 12px 10px !important;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }

  /* Footer Adjustments */
  footer {
    padding-bottom: 80px; /* Space for WhatsApp / Back to top */
  }

  .footer-logo {
    max-width: 130px;
    margin-bottom: 1.5rem;
  }

  [style*="border-top:1px solid #0d1e35;"] .d-flex {
    flex-direction: column !important;
    text-align: center;
    gap: 1.5rem !important;
  }

  /* Candidate Shell */
  .candidate-shell {
    grid-template-columns: 1fr;
  }

  .candidate-sidebar {
    padding: 1rem;
  }

  .candidate-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Extra Small (max-width: 480px) */
@media (max-width: 480px) {
  .top-bar-left, .top-bar-right {
    font-size: 0.7rem !important;
  }
}

/* Utilities */
.gap-2 {
  gap: .5rem !important;
}

.gap-3 {
  gap: 1rem !important;
}

.rounded-4 {
  border-radius: 1rem !important;
}

.rounded-3 {
  border-radius: .75rem !important;
}

.shadow {
  box-shadow: 0 4px 20px rgba(0, 0, 0, .08) !important;
}

/* Font Awesome mr/ml helpers for Bootstrap 5 */
.mr-1 {
  margin-right: .25rem !important;
}

.mr-2 {
  margin-right: .5rem !important;
}

.mr-3 {
  margin-right: 1rem !important;
}

.ml-1 {
  margin-left: .25rem !important;
}

.ml-2 {
  margin-left: .5rem !important;
}

.ml-3 {
  margin-left: 1rem !important;
}

@media (max-width: 768px) {
  .gap-3 {
    gap: 0.75rem !important;
  }
  
  .section-padding {
    padding: 60px 0 !important;
  }
}

.nav-link-mobile-border {
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* ============================================
   DIVISION & SERVICE CARDS WITH IMAGES
   ============================================ */

/* Division Cards */
.division-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.division-card:hover .division-card-image img {
  transform: scale(1.08);
}

.division-card-image img {
  transition: transform 0.5s ease;
}

.division-card-icon {
  transition: all 0.3s ease;
}

.division-card:hover .division-card-icon {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Service Cards */
.service-card-image {
  position: relative;
  overflow: hidden;
}

.service-card-image img {
  transition: transform 0.5s ease;
}

.service-card:hover .service-card-image img {
  transform: scale(1.08);
}

/* Image Card Hover Effects */
.card-image-wrapper {
  position: relative;
  overflow: hidden;
}

.card-image-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-image-wrapper:hover::after {
  opacity: 1;
}

/* Responsive Image Cards */
@media (max-width: 768px) {
  .division-card-image {
    height: 150px !important;
  }

  .service-card-image {
    height: 140px !important;
  }
}

/* ============================================
   MOBILE & SAFARI RESPONSIVENESS FIXES
   ============================================ */

/* Floating Buttons (WhatsApp & Back to Top) */
.whatsapp-float, .back-to-top {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    -webkit-appearance: none;
    cursor: pointer;
}

.whatsapp-float i, .back-to-top i {
    color: #fff !important;
    font-size: 1.5rem !important;
    display: block !important;
}

/* Footer Clipping & Grid Optimization */
@media (max-width: 576px) {
    footer.footer-main {
        text-align: center;
        padding-bottom: 120px !important; /* Extra space for floating buttons */
    }
    footer.footer-main .row {
        margin-left: 0;
        margin-right: 0;
    }
    footer.footer-main ul {
        display: inline-block;
        text-align: left;
        width: 100%;
        max-width: 260px;
        margin: 0 auto;
    }
    footer.footer-main .d-flex {
        justify-content: center;
    }
    footer.footer-main .row > div {
        margin-bottom: 2.5rem;
        padding-left: 15px;
        padding-right: 15px;
    }
    /* Fix clipping by ensuring full width columns on mobile */
    .footer-main .col-6 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* Safari Icon Visibility Fix */
.fas, .fab, .far {
    -webkit-font-smoothing: antialiased;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* Mega Menu Mobile Fix */
@media (max-width: 991px) {
    #mainNav .dropdown-menu {
        min-width: 0 !important;
        width: 100% !important;
        max-height: 400px;
        overflow-y: auto;
    }
}