/* -------------------------------------------------------------
 * e-RITA Portal - Modern Bootstrap 5 UI Theme
 * Registration, Insolvency & Trusteeship Agency (RITA - Tanzania)
 * ------------------------------------------------------------- */

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

:root {
  --rita-blue-primary: #0F62FE;
  --rita-blue-dark: #0A369D;
  --rita-blue-deep: #0B192C;
  --rita-cyan: #00A3E0;
  --rita-gold: #FFC107;
  --rita-gold-warm: #F4B41A;
  --rita-green: #10B981;
  --rita-green-dark: #059669;
  --rita-bg-light: #F8FAFC;
  --rita-surface: #FFFFFF;
  --rita-text-dark: #0F172A;
  --rita-text-muted: #64748B;
  --rita-border: #E2E8F0;
  --rita-glass: opacity(0.9);
  --rita-radius: 16px;
  --rita-radius-sm: 10px;
  --rita-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08);
  --rita-shadow-hover: 0 20px 40px -10px rgba(15, 98, 254, 0.2);
  --rita-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--rita-bg-light);
  color: var(--rita-text-dark);
  overflow-x: hidden;
}

/* -------------------------------------------------------------
 * 1. Top Government Banner (Row 1)
 * ------------------------------------------------------------- */
.gov-top-bar {
  background: linear-gradient(90deg, #0A192F 0%, #1E3A8A 50%, #004085 100%);
  color: #E2E8F0;
  font-size: 0.825rem;
  padding: 0.5rem 0;
  border-bottom: 3px solid var(--rita-gold);
}

.gov-top-bar .container {
  justify-content: space-between;
}

.gov-title-wrap {
  justify-content: flex-start;
  text-align: left;
}

.gov-tools {
  margin-left: auto;
}

.gov-top-bar a {
  color: #93C5FD;
  text-decoration: none;
  transition: var(--rita-transition);
}

.gov-top-bar a:hover {
  color: var(--rita-gold);
}

.gov-emblem {
  height: 30px;
  width: auto;
  object-fit: contain;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 0.2rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--rita-transition);
}

.lang-btn:hover,
.lang-btn.active {
  background: var(--rita-gold);
  color: #0F172A;
  border-color: var(--rita-gold);
}

/* Main Brand Bar (Row 2) */
.rita-brand-bar {
  background: #FFFFFF;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rita-border);
}

.brand-logo {
  height: 54px;
  width: auto;
}

.brand-title {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--rita-blue-dark);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--rita-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Dedicated Navigation Sub-Row (Row 3 Sticky) */
.rita-sub-nav {
  background: rgba(15, 25, 44, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.rita-sub-nav .nav-link {
  font-weight: 600;
  font-size: 0.875rem;
  color: #CBD5E1 !important;
  padding: 0.55rem 1rem !important;
  border-radius: 8px;
  transition: var(--rita-transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.rita-sub-nav .nav-link:hover,
.rita-sub-nav .nav-link.active {
  color: var(--rita-gold) !important;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Buttons */
.btn-rita-primary {
  background: linear-gradient(135deg, var(--rita-blue-primary) 0%, var(--rita-blue-dark) 100%);
  color: #FFFFFF;
  border: none;
  font-weight: 700;
  padding: 0.6rem 1.4rem;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(15, 98, 254, 0.35);
  transition: var(--rita-transition);
}

.btn-rita-primary:hover {
  background: linear-gradient(135deg, #0247C7 0%, #06236A 100%);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(15, 98, 254, 0.45);
}

.btn-rita-outline {
  background: transparent;
  color: var(--rita-blue-primary);
  border: 2px solid var(--rita-blue-primary);
  font-weight: 700;
  padding: 0.55rem 1.3rem;
  border-radius: 30px;
  transition: var(--rita-transition);
}

.btn-rita-outline:hover {
  background: var(--rita-blue-primary);
  color: #FFFFFF;
  transform: translateY(-2px);
}

.btn-rita-gold {
  background: linear-gradient(135deg, var(--rita-gold) 0%, var(--rita-gold-warm) 100%);
  color: #0F172A;
  border: none;
  font-weight: 700;
  padding: 0.6rem 1.4rem;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(255, 193, 7, 0.35);
  transition: var(--rita-transition);
}

.btn-rita-gold:hover {
  background: linear-gradient(135deg, #E5AC00 0%, #D89808 100%);
  color: #0F172A;
  transform: translateY(-2px);
}

/* -------------------------------------------------------------
 * 2. Dynamic Hero Section (Decluttered & Centered)
 * ------------------------------------------------------------- */
.hero-section {
  background: radial-gradient(100% 100% at 50% 0%, #0F2A4A 0%, #071527 100%);
  color: #FFFFFF;
  padding: 5rem 0 4.5rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 163, 224, 0.22) 0%, rgba(0, 0, 0, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -15%;
  left: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 193, 7, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-badge {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--rita-gold);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.45rem 1.25rem;
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 1.25rem;
}

.hero-title span {
  background: linear-gradient(135deg, #60A5FA 0%, #93C5FD 50%, #FFD700 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: #94A3B8;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.hero-quick-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 1.75rem;
}

.hero-quick-search-input {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF !important;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

.hero-quick-search-input::placeholder {
  color: #CBD5E1;
}

.hero-quick-search-input:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--rita-gold);
  box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.2);
}

/* -------------------------------------------------------------
 * 3. Auth Offcanvas Drawer Styling
 * ------------------------------------------------------------- */
.auth-offcanvas {
  width: 440px !important;
  background: #0F172A;
  color: #FFFFFF;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}

.auth-offcanvas .offcanvas-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.25rem 1.5rem;
}

.auth-offcanvas .offcanvas-body {
  padding: 1.75rem;
}

#dynamicOffcanvas {
    border: 1.5px solid rgba(15, 98, 254, 0.2) !important;
    box-shadow: var(--rita-shadow);
    overflow: hidden !important;
    min-width: 35% !important;
}
#dynamicOffcanvasStart {
    border: 1.5px solid rgba(15, 98, 254, 0.2) !important;
    box-shadow: var(--rita-shadow);
    overflow: hidden !important;
    min-width: 50% !important;
}

#dynamicOffcanvas .offcanvas-header,
#dynamicOffcanvasStart  .offcanvas-header{
    background: linear-gradient(90deg, #0A192F 0%, #1E3A8A 50%, #004085 100%) !important;
    border-bottom: 3px solid var(--rita-gold) !important;
    height: 4.6em;
    border-top-left-radius: calc(var(--bs-offcanvas-border-radius, 1rem) - 1.5px) !important;
    border-top-right-radius: calc(var(--bs-offcanvas-border-radius, 1rem) - 1.5px) !important;
}

#dynamicOffcanvas .offcanvas-title,
#dynamicOffcanvasStart .offcanvas-title{
    color: #FFFFFF !important;
}

/* Linear Progress Indicator for Offcanvas Header */
.offcanvas-linear-progress {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  /* background-color: transparent rgba(255, 255, 255, 0.2); */
  background-color: transparent;
  overflow: hidden;
  z-index: 10;
}

.offcanvas-linear-progress::before {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, #FFFFFF, #FFFFFF, #FFFFFF, #FFFFFF, #FFFFFF);
  animation: offcanvas-linear-anim 1.2s infinite ease-in-out;
}

@keyframes offcanvas-linear-anim {
  0% {
    left: -50%;
    width: 30%;
  }

  50% {
    width: 60%;
  }

  100% {
    left: 100%;
    width: 30%;
  }
}

.htmx-request.offcanvas-linear-progress,
.htmx-request .offcanvas-linear-progress {
  display: block !important;
}

/* Auth Login Form styles */
#auth-login-form .text-center .bg-primary-subtle {
  width: 64px;
  height: 60px;
}

#dynamicOffcanvas .form-control,
#dynamicOffcanvas .form-select {
  padding-top: 1.05rem !important;
  padding-bottom: 1.05rem !important;
  font-size: 1rem !important;
}

.auth-offcanvas-tabs {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 4px;
}

.auth-offcanvas-tabs .btn {
  border-radius: 10px;
  font-size: 0.875rem;
  transition: var(--rita-transition);
}

.auth-offcanvas-tabs .btn.active {
  background: var(--rita-gold);
  color: #0F172A !important;
  font-weight: 800;
}

/* -------------------------------------------------------------
 * 4. Stats Ribbon & Services Grid
 * ------------------------------------------------------------- */
.stats-ribbon {
  background: #FFFFFF;
  margin-top: -2.5rem;
  border-radius: 20px;
  box-shadow: var(--rita-shadow);
  padding: 1.5rem 2rem;
  border: 1px solid var(--rita-border);
  position: relative;
  z-index: 10;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.stat-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(15, 98, 254, 0.08);
  color: var(--rita-blue-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--rita-text-dark);
  line-height: 1;
  margin-bottom: 0.2rem;
}

.stat-label {
  font-size: 0.825rem;
  color: var(--rita-text-muted);
  font-weight: 600;
}

.section-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--rita-text-dark);
  letter-spacing: -0.5px;
}

.section-subtitle {
  color: var(--rita-text-muted);
  font-size: 1.05rem;
}

.service-card {
  background: var(--rita-surface);
  border-radius: var(--rita-radius);
  border: 1px solid var(--rita-border);
  padding: 2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--rita-transition);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  transition: var(--rita-transition);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--rita-shadow-hover);
  border-color: rgba(15, 98, 254, 0.3);
}

.service-card:hover::before {
  background: linear-gradient(90deg, var(--rita-blue-primary), var(--rita-gold));
}

.service-card-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  margin-bottom: 1.5rem;
  transition: var(--rita-transition);
}

.bg-icon-blue {
  background: rgba(15, 98, 254, 0.08);
  color: var(--rita-blue-primary);
}

.bg-icon-green {
  background: rgba(16, 185, 129, 0.08);
  color: var(--rita-green-dark);
}

.bg-icon-gold {
  background: rgba(255, 193, 7, 0.12);
  color: #B45309;
}

.bg-icon-purple {
  background: rgba(139, 92, 246, 0.08);
  color: #7C3AED;
}

.service-card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--rita-text-dark);
  margin-bottom: 0.75rem;
}

.service-card-desc {
  color: var(--rita-text-muted);
  font-size: 0.925rem;
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

.service-badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.badge-fast {
  background: #DCFCE7;
  color: #15803D;
}

.badge-gepg {
  background: #FEF3C7;
  color: #92400E;
}

.badge-online {
  background: #DBEAFE;
  color: #1E40AF;
}

/* HTMX Loading, Disabling and Indicator Utilities */
.htmx-indicator {
  display: none !important;
}

.htmx-request .htmx-indicator {
  display: inline-block !important;
}

.htmx-request.htmx-indicator {
  display: inline-block !important;
}

.htmx-request .htmx-hide-on-request {
  display: none !important;
}

.htmx-request.htmx-hide-on-request {
  display: none !important;
}

/* -------------------------------------------------------------
 * 5. Timeline & Verification Badges
 * ------------------------------------------------------------- */
.timeline-tracker {
  position: relative;
  padding-left: 2.5rem;
}

.timeline-tracker::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 5px;
  bottom: 5px;
  width: 3px;
  background: var(--rita-border);
}

.timeline-event {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-event:last-child {
  margin-bottom: 0;
}

.timeline-icon {
  position: absolute;
  left: -2.5rem;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #E2E8F0;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
}

.timeline-event.completed .timeline-icon {
  background: var(--rita-green);
  color: #FFFFFF;
}

.timeline-event.active .timeline-icon {
  background: var(--rita-blue-primary);
  color: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(15, 98, 254, 0.2);
}

.timeline-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--rita-text-muted);
}

.verified-stamp-badge {
  border: 3px double var(--rita-green-dark);
  color: var(--rita-green-dark);
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: inline-block;
  transform: rotate(-3deg);
  background: rgba(16, 185, 129, 0.05);
}

.payment-partner-badge {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-weight: 700;
  font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 991.98px) {
  .rita-sub-nav {
    display: none;
  }

  .gov-top-bar .container,
  .rita-brand-bar .container {
    gap: 0.75rem;
  }

  .rita-brand-bar .container {
    flex-wrap: wrap;
  }

  .rita-brand-bar .container>a {
    width: 100%;
  }

  .rita-brand-bar .container>.d-flex {
    width: 100%;
    justify-content: flex-start;
  }

  .rita-brand-bar .container>div.d-flex {
    display: none !important;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  .stats-ribbon {
    margin-top: -1.5rem;
    padding: 1.25rem;
  }

  .stat-item {
    gap: 0.9rem;
  }

  .service-card {
    padding: 1.5rem;
  }

  .auth-offcanvas {
    width: 100% !important;
  }
}

@media (max-width: 767.98px) {
  .gov-top-bar {
    font-size: 0.78rem;
  }

  .gov-emblem {
    height: 24px;
  }

  .gov-top-bar .container {
    justify-content: center !important;
    text-align: center;
  }

  .gov-title-wrap {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .gov-tools {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }

  .gov-top-bar .container>div {
    width: 100%;
    justify-content: center;
  }

  .brand-logo {
    height: 46px;
  }

  .brand-title {
    font-size: 1.2rem;
  }

  .brand-subtitle {
    font-size: 0.68rem;
    letter-spacing: 0.35px;
  }

  .hero-section {
    padding: 3.4rem 0 3rem;
  }

  .hero-title {
    font-size: 1.9rem;
    line-height: 1.2;
  }

  .hero-subtitle {
    font-size: 1rem;
    line-height: 1.5;
  }

  .hero-badge {
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
  }

  .stats-ribbon {
    margin-top: -1.1rem;
    border-radius: 16px;
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.35rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .section-subtitle {
    font-size: 0.97rem;
  }

  .service-card-title {
    font-size: 1.15rem;
  }

  .service-card-desc {
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
  }

  .timeline-tracker {
    padding-left: 2.1rem;
  }

  .timeline-icon {
    left: -2.1rem;
  }

  #tracker .border.p-4,
  #tracker .border.p-4.d-none,
  #tracker .border.p-4:not(.d-none) {
    padding: 1rem !important;
  }

  #tracker .alert {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.75rem;
  }

  #tracker .alert .btn {
    width: 100%;
  }

  .modal-dialog {
    margin: 0.75rem;
  }
}

@media (max-width: 575.98px) {
  .hero-title {
    font-size: 1.7rem;
  }

  .hero-section .btn {
    width: 100%;
  }

  .btn-rita-primary,
  .btn-rita-gold,
  .btn-rita-outline {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 1.3rem;
  }

  .stat-label {
    font-size: 0.78rem;
  }

  .service-card {
    padding: 1.2rem;
  }

  .service-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    font-size: 1.5rem;
    margin-bottom: 1.1rem;
  }

  .auth-offcanvas .offcanvas-body,
  .auth-offcanvas .offcanvas-header {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}