/* ============================================================
   Agrin Ltd — Main Stylesheet
   Professional Blue & White Corporate Theme
   ============================================================ */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --primary:      #1B4F8A;
  --primary-dark: #0f2f54;
  --primary-light:#2d6dbf;
  --secondary:    #D4A017;
  --accent:       #17a2b8;
  --dark:         #0D1B2E;
  --text:         #2c3e50;
  --text-muted:   #6c757d;
  --light:        #f5f7fa;
  --border:       #e2e8f0;
  --white:        #ffffff;
  --shadow-sm:    0 2px 8px rgba(0,0,0,.08);
  --shadow:       0 4px 24px rgba(0,0,0,.12);
  --shadow-lg:    0 8px 40px rgba(0,0,0,.16);
  --radius:       12px;
  --transition:   0.3s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* ── Top Bar ───────────────────────────────────────────── */
.topbar {
  background: var(--dark);
  color: rgba(255,255,255,.8);
  font-size: 0.82rem;
  padding: 7px 0;
}
.topbar a {
  color: rgba(255,255,255,.8);
  font-size: 1rem;
  transition: color var(--transition);
}
.topbar a:hover { color: var(--white); }
.topbar .btn-outline-light {
  border-color: rgba(255,255,255,.4);
  color: rgba(255,255,255,.8);
  font-size: 0.78rem;
  padding: 2px 10px;
}
.topbar .btn-outline-light:hover { background: rgba(255,255,255,.15); border-color: var(--white); color: var(--white); }

/* ── Navbar ────────────────────────────────────────────── */
.main-navbar {
  background: var(--white) !important;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  padding: 0.6rem 0;
  transition: all 0.3s;
  z-index: 1030;
}
.main-navbar.scrolled {
  padding: 0.4rem 0;
  box-shadow: 0 4px 20px rgba(0,0,0,.14);
}
.navbar-brand .brand-text {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.navbar-brand .brand-text span { color: var(--secondary); }
.navbar-nav .nav-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--dark) !important;
  padding: 0.55rem 1rem !important;
  position: relative;
  transition: color var(--transition);
}
.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; right: 50%;
  height: 2px;
  background: var(--primary);
  transition: all var(--transition);
}
.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after { left: 1rem; right: 1rem; }
.navbar-nav .nav-link:hover { color: var(--primary) !important; }

.dropdown-menu {
  border: none;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  min-width: 200px;
  padding: 0.5rem;
  margin-top: 6px;
  animation: fadeInDown 0.2s ease;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-item {
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  transition: all var(--transition);
}
.dropdown-item:hover {
  background: var(--light);
  color: var(--primary);
  padding-left: 1.25rem;
}
.nav-cta {
  background: var(--primary) !important;
  color: var(--white) !important;
  border-radius: 50px;
  padding: 0.45rem 1.4rem !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  border: none;
  transition: all var(--transition);
}
.nav-cta::after { display: none !important; }
.nav-cta:hover { background: var(--primary-dark) !important; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(27,79,138,.3); }

/* ── Buttons ───────────────────────────────────────────── */
.btn { font-weight: 600; border-radius: 8px; transition: all var(--transition); }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(27,79,138,.3);
}
.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: var(--white);
}
.btn-lg { padding: 0.75rem 2rem; font-size: 1rem; border-radius: 10px; }
.btn-pill { border-radius: 50px; }

/* ── Hero Section ──────────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  position: relative;
  overflow: hidden;
  padding: 5rem 0 4rem;
  color: var(--white);
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-section::after {
  content: '';
  position: absolute;
  bottom: -30%; left: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,.04) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-section .container { position: relative; z-index: 2; }
.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 1.25rem;
}
.hero-title span { color: var(--secondary); }
.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255,255,255,.85);
  margin-bottom: 2rem;
  max-width: 540px;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-actions .btn-primary {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--dark);
  font-weight: 700;
}
.hero-actions .btn-primary:hover { background: #b8860e; border-color: #b8860e; }
.hero-actions .btn-outline-light {
  border-color: rgba(255,255,255,.6);
  color: var(--white);
}
.hero-actions .btn-outline-light:hover { background: rgba(255,255,255,.15); border-color: var(--white); }
.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}
.hero-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}
.hero-stat-label {
  font-size: 0.82rem;
  color: rgba(255,255,255,.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-visual .floating-card {
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  color: var(--white);
}
.hero-visual .floating-card .fs-1 { color: var(--secondary); }

/* ── Section Headers ───────────────────────────────────── */
.section-header { text-align: center; margin-bottom: 3rem; }
.section-label {
  display: inline-block;
  background: rgba(27,79,138,.1);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 50px;
  margin-bottom: 0.75rem;
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 0.75rem;
}
.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}
.section-divider {
  width: 60px; height: 4px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  border-radius: 2px;
  margin: 1rem auto 0;
}

/* ── Service Cards ─────────────────────────────────────── */
.service-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  height: 100%;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.service-card:hover::before { transform: scaleX(1); }
.service-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, rgba(27,79,138,.1), rgba(27,79,138,.05));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 1.25rem;
  transition: all var(--transition);
}
.service-card:hover .service-icon {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
}
.service-card h5 { font-size: 1.1rem; margin-bottom: 0.6rem; }
.service-card p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 1rem; }
.service-card .read-more {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.service-card:hover .read-more { gap: 8px; }

/* ── Stats Banner ──────────────────────────────────────── */
.stats-section {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 3.5rem 0;
  color: var(--white);
}
.stat-item { text-align: center; padding: 1rem; }
.stat-number {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
  display: block;
}
.stat-number span { color: var(--secondary); }
.stat-label {
  font-size: 0.9rem;
  color: rgba(255,255,255,.8);
  margin-top: 0.3rem;
  display: block;
}
.stat-divider {
  width: 1px;
  height: 60px;
  background: rgba(255,255,255,.2);
  margin: auto;
}

/* ── Testimonials ──────────────────────────────────────── */
.testimonial-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  height: 100%;
}
.testimonial-card .quote-icon {
  font-size: 2.5rem;
  color: var(--primary);
  opacity: .3;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.testimonial-card .stars { color: var(--secondary); font-size: 0.9rem; margin-bottom: 0.75rem; }
.testimonial-card p { font-style: italic; color: var(--text); margin-bottom: 1.25rem; }
.testimonial-card .author-name { font-weight: 700; color: var(--dark); margin-bottom: 0; }
.testimonial-card .author-role { font-size: 0.85rem; color: var(--text-muted); }

/* ── Page Content ──────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
  padding: 3.5rem 0 2.5rem;
  color: var(--white);
}
.page-hero h1 { color: var(--white); font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 0.5rem; }
.page-hero .breadcrumb { margin-bottom: 0; }
.page-hero .breadcrumb-item, .page-hero .breadcrumb-item a { color: rgba(255,255,255,.7); }
.page-hero .breadcrumb-item.active { color: rgba(255,255,255,.9); }
.page-hero .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.4); }

.page-content {
  padding: 3.5rem 0;
  flex: 1;
}
.page-content h2 { color: var(--primary); font-size: 1.8rem; margin: 2rem 0 1rem; }
.page-content h3 { font-size: 1.4rem; margin: 1.5rem 0 0.75rem; }
.page-content h2:first-child, .page-content h3:first-child { margin-top: 0; }
.page-content p { margin-bottom: 1.25rem; }
.page-content ul li, .page-content ol li { margin-bottom: 0.4rem; }
.page-content img { border-radius: var(--radius); }

/* ── CTA Section ───────────────────────────────────────── */
.cta-section {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: 4rem 0;
  color: var(--white);
  text-align: center;
}
.cta-section h2 { color: var(--white); font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 1rem; }
.cta-section p { color: rgba(255,255,255,.85); font-size: 1.1rem; margin-bottom: 1.75rem; }

/* ── Letters ───────────────────────────────────────────── */
.letter-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.letter-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--primary); }
.letter-number-badge {
  font-family: monospace;
  font-size: 0.82rem;
  background: var(--light);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}
.letter-card-title { font-size: 1rem; font-weight: 700; color: var(--dark); margin: 0.75rem 0 0.5rem; }
.letter-card-meta { font-size: 0.85rem; color: var(--text-muted); }
.letter-card-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Official Letter Document */
.letter-document {
  background: var(--white);
  max-width: 860px;
  margin: 0 auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 24px rgba(0,0,0,.1);
}
.letter-document-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: var(--white);
  padding: 2rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
}
.letter-company-name { font-size: 1.6rem; font-weight: 800; color: var(--white); margin-bottom: 0.25rem; }
.letter-company-details { font-size: 0.82rem; color: rgba(255,255,255,.8); }
.letter-document-meta {
  padding: 1.25rem 2.5rem;
  background: var(--light);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.88rem;
}
.letter-meta-item strong { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.letter-meta-item span  { color: var(--dark); font-weight: 600; }
.letter-document-body { padding: 2.5rem; }
.letter-document-body .recipient-block { margin-bottom: 2rem; }
.letter-document-body .recipient-name { font-weight: 700; font-size: 1.05rem; }
.letter-document-body .letter-body { line-height: 1.9; color: var(--text); }
.letter-document-footer {
  padding: 1.5rem 2.5rem 2rem;
  border-top: 1px solid var(--border);
}
.signature-block { margin-top: 1.5rem; }
.signature-block .signer-name { font-weight: 700; margin-top: 0.5rem; }
.signature-block .signer-title { font-size: 0.9rem; color: var(--text-muted); }
.signature-img { border-bottom: 2px solid var(--dark); padding-bottom: 4px; max-height: 80px; }

/* Verification badge */
.verify-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.92rem;
}
.verify-badge.active   { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.verify-badge.revoked  { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.verify-badge.expired  { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.verify-badge.not-found{ background: #e2e3e5; color: #383d41; border: 1px solid #d6d8db; }

/* QR Section */
.qr-block {
  text-align: center;
  padding: 1rem;
  background: var(--light);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.qr-block img { border: 4px solid var(--white); border-radius: 8px; box-shadow: var(--shadow-sm); }
.qr-block p { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.5rem; margin-bottom: 0; }

/* Verification Page */
.verify-page { padding: 4rem 0; background: var(--light); min-height: 60vh; }
.verify-card { background: var(--white); border-radius: 16px; box-shadow: var(--shadow); padding: 2.5rem; max-width: 700px; margin: 0 auto; }
.verify-icon { font-size: 3.5rem; margin-bottom: 1rem; }

/* ── Breadcrumb ────────────────────────────────────────── */
.breadcrumb { background: transparent; padding: 0; margin: 0; font-size: 0.88rem; }
.breadcrumb-item + .breadcrumb-item::before { content: '›'; }

/* ── Cards ─────────────────────────────────────────────── */
.card { border: 1px solid var(--border); border-radius: var(--radius); }
.card-shadow { box-shadow: var(--shadow-sm); }
.card-hover { transition: all var(--transition); }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

/* ── Category Filters ──────────────────────────────────── */
.filter-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.filter-pill {
  padding: 6px 18px;
  border-radius: 50px;
  font-size: 0.87rem;
  font-weight: 600;
  background: var(--light);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.filter-pill:hover, .filter-pill.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* ── Alert ─────────────────────────────────────────────── */
.alert { border-radius: var(--radius); border: none; }
.alert-primary { background: rgba(27,79,138,.1); color: var(--primary); }

/* ── Badge ─────────────────────────────────────────────── */
.badge { font-weight: 600; letter-spacing: 0.3px; }

/* ── Forms ─────────────────────────────────────────────── */
.form-control, .form-select {
  border-color: var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font-size: 0.95rem;
  transition: all var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27,79,138,.15);
}
.form-label { font-weight: 600; font-size: 0.9rem; color: var(--dark); margin-bottom: 0.4rem; }
.input-group-text { background: var(--light); border-color: var(--border); }

/* ── Footer ────────────────────────────────────────────── */
.site-footer { background: var(--dark); color: rgba(255,255,255,.85); margin-top: auto; }
.footer-main { padding: 4rem 0 3rem; }
.footer-brand {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--white);
  display: inline-block;
}
.footer-brand:hover { color: var(--secondary); }
.footer-tagline { font-size: 0.95rem; color: rgba(255,255,255,.6); }
.footer-desc { font-size: 0.88rem; color: rgba(255,255,255,.5); line-height: 1.7; max-width: 320px; }
.footer-heading {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,.5);
  margin-bottom: 1rem;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.6rem; }
.footer-links a {
  color: rgba(255,255,255,.75);
  font-size: 0.9rem;
  transition: all var(--transition);
  display: inline-block;
}
.footer-links a:hover { color: var(--secondary); padding-left: 4px; }
.footer-social { display: flex; gap: 0.75rem; }
.footer-social a {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.75);
  font-size: 0.95rem;
  transition: all var(--transition);
}
.footer-social a:hover { background: var(--primary); color: var(--white); transform: translateY(-2px); }
.footer-contact p { font-size: 0.88rem; color: rgba(255,255,255,.6); margin-bottom: 0.5rem; }
.footer-contact i { color: var(--secondary); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 1.25rem 0;
  font-size: 0.85rem;
  color: rgba(255,255,255,.5);
}

/* ── Print Styles (for letters) ───────────────────────── */
@media print {
  .topbar, .main-navbar, .site-footer, .no-print, .btn { display: none !important; }
  .letter-document { box-shadow: none; border: none; max-width: 100%; }
  .letter-document-header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { font-size: 14px; }
  .page-hero { display: none; }
}

/* ── Utilities ─────────────────────────────────────────── */
.text-primary-custom { color: var(--primary) !important; }
.text-secondary-custom { color: var(--secondary) !important; }
.bg-primary-custom { background: var(--primary) !important; }
.bg-light-custom  { background: var(--light) !important; }
.section-pad { padding: 5rem 0; }
.section-pad-sm { padding: 3rem 0; }
.rounded-custom { border-radius: var(--radius) !important; }
.shadow-custom { box-shadow: var(--shadow) !important; }
.font-mono { font-family: 'Courier New', monospace; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .navbar-nav .nav-link::after { display: none; }
  .navbar-nav { padding: 0.75rem 0; }
  .navbar-nav .nav-link { padding: 0.5rem 0 !important; border-bottom: 1px solid var(--light); }
  .dropdown-menu { box-shadow: none; border: none; background: var(--light); border-radius: 8px; padding: 0.25rem 0.75rem; }
  .nav-cta { margin-top: 0.75rem; display: inline-block; }
  .hero-stats { gap: 1.5rem; }
}
@media (max-width: 767.98px) {
  .hero-section { padding: 3.5rem 0 3rem; }
  .letter-document-header { flex-direction: column; }
  .letter-document-meta { gap: 1rem; }
  .letter-document-body, .letter-document-footer { padding: 1.5rem; }
  .letter-document-header { padding: 1.5rem; }
  section.section-pad { padding: 3rem 0; }
}

/* ── Signature Pad ─────────────────────────────────────── */
.signature-pad-container {
  border: 2px dashed var(--border);
  border-radius: 8px;
  background: var(--light);
  cursor: crosshair;
  touch-action: none;
}
.signature-pad-container canvas { display: block; width: 100%; }
