/* ==========================================================================
   NDF BENGALI TYPOGRAPHY & DESIGN SYSTEM
   Modeled after the authoritative Bengali broadsheet typography of Daily Jonomonch
   Primary Bengali Font: SolaimanLipi (Gold standard for Bengali print & web)
   Progressive Fallbacks: Siyam Rupali, Kalpurush, Hind Siliguri, Noto Sans Bengali, sans-serif
   ========================================================================== */

/* SolaimanLipi Font-Face Definitions */
@font-face {
  font-family: 'SolaimanLipi';
  src: url('/fonts/SolaimanLipi.ttf') format('truetype'),
       local('SolaimanLipi'),
       local('Solaiman Lipi');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SolaimanLipi';
  src: url('/fonts/SolaimanLipi.ttf') format('truetype'),
       local('SolaimanLipi Bold'),
       local('SolaimanLipi-Bold');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SolaimanLipi';
  src: url('/fonts/SolaimanLipi.ttf') format('truetype'),
       local('SolaimanLipi Bold'),
       local('SolaimanLipi-Bold');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* High quality Google Fonts fallbacks */
@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&family=Noto+Sans+Bengali:wght@400;500;600;700&family=Noto+Serif+Bengali:wght@600;700&display=swap');

:root {
  /* Centralized Typography Tokens */
  --font-bengali-primary: 'SolaimanLipi', 'Siyam Rupali', 'Kalpurush', 'Hind Siliguri', 'Noto Sans Bengali', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-bengali-display: 'SolaimanLipi', 'Siyam Rupali', 'Kalpurush', 'Noto Serif Bengali', Georgia, serif;
  --font-bengali-headline: 'SolaimanLipi', 'Siyam Rupali', 'Kalpurush', 'Hind Siliguri', sans-serif;
  --font-bengali-body: 'SolaimanLipi', 'Siyam Rupali', 'Kalpurush', 'Hind Siliguri', sans-serif;
  --font-bengali: var(--font-bengali-primary);

  /* NDF Brand Color System */
  --ndf-green: #00843D;
  --ndf-green-dark: #00602c;
  --ndf-green-deep: #064e3b;
  --ndf-green-light: #e8f5e9;
  --ndf-green-subtle: #f0fdf4;
  --ndf-red: #E41C26;
  --ndf-red-dark: #b91c1c;
  --ndf-purple: #7e22ce;
  --ndf-purple-dark: #581c87;
  --ndf-purple-light: #faf5ff;
  --ndf-gold: #f59e0b;
  --ndf-gold-dark: #d97706;
  --ndf-charcoal: #0f172a;
  --ndf-slate-muted: #475569;
  --ndf-body-bg: #f8fafc;
  --ndf-card-border: #e2e8f0;
  --ndf-input-border: #cbd5e1;

  /* Shadows */
  --ndf-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --ndf-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
  --ndf-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --ndf-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --ndf-shadow-card: 0 4px 20px rgba(0, 0, 0, 0.05);
  --ndf-shadow-card-hover: 0 12px 30px rgba(0, 0, 0, 0.09);
}

/* Base Typographic Rules for Flawless Bengali Rendering */
html {
  font-family: var(--font-bengali);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-bengali);
  background-color: var(--ndf-body-bg);
  color: var(--ndf-charcoal);
  line-height: 1.75;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings with balanced Bengali line-height to prevent conjunct clipping */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-bengali-headline);
  font-weight: 700;
  line-height: 1.38;
  color: var(--ndf-charcoal);
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

h1, .h1 { font-size: 1.85rem; }
h2, .h2 { font-size: 1.6rem; }
h3, .h3 { font-size: 1.35rem; }
h4, .h4 { font-size: 1.2rem; }
h5, .h5 { font-size: 1.05rem; }
h6, .h6 { font-size: 0.95rem; }

@media (min-width: 768px) {
  h1, .h1 { font-size: 2.25rem; }
  h2, .h2 { font-size: 1.85rem; }
  h3, .h3 { font-size: 1.5rem; }
  h4, .h4 { font-size: 1.3rem; }
}

p, .lead, small, span, label, input, select, textarea, button, a {
  font-family: var(--font-bengali);
}

/* Preserving Bengali numerals & English numerals clarity */
.font-bengali {
  font-family: var(--font-bengali) !important;
}

.font-bengali-headline {
  font-family: var(--font-bengali-headline) !important;
}

/* Enhanced Form Labels & Inputs */
.form-label {
  font-family: var(--font-bengali);
  font-weight: 600;
  font-size: 0.96rem;
  color: #1e293b;
  margin-bottom: 0.45rem;
  line-height: 1.5;
}

.form-control, .form-select {
  font-family: var(--font-bengali);
  border-radius: 10px;
  border: 1.5px solid var(--ndf-input-border);
  padding: 10px 14px;
  font-size: 0.98rem;
  line-height: 1.6;
  color: #0f172a;
  background-color: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--ndf-green);
  box-shadow: 0 0 0 3px rgba(0, 132, 61, 0.16);
  outline: none;
}

.form-control::placeholder {
  color: #94a3b8;
  font-family: var(--font-bengali);
  opacity: 0.9;
}

/* Form Helper & Feedback */
.form-text {
  font-family: var(--font-bengali);
  font-size: 0.85rem;
  color: var(--ndf-slate-muted);
  line-height: 1.55;
  margin-top: 0.35rem;
}

.invalid-feedback, .text-danger {
  font-family: var(--font-bengali);
  line-height: 1.5;
}

/* Professional Radio and Checkbox Styling */
.form-check-label {
  font-family: var(--font-bengali);
  cursor: pointer;
  line-height: 1.6;
}

.form-check-input:checked {
  background-color: var(--ndf-green);
  border-color: var(--ndf-green);
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(0, 132, 61, 0.18);
  border-color: var(--ndf-green);
}

/* Interactive Radio Selection Card */
.selectable-card {
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 18px;
  background: #ffffff;
  transition: all 0.2s ease;
  cursor: pointer;
}

.selectable-card:hover {
  border-color: #a7f3d0;
  background-color: #fafffc;
  transform: translateY(-1px);
}

.selectable-card.active,
.selectable-card:has(input:checked) {
  border-color: var(--ndf-green);
  background-color: var(--ndf-green-subtle);
  box-shadow: 0 2px 8px rgba(0, 132, 61, 0.12);
}

/* Modern Buttons with Bengali Typographic Polish */
.btn {
  font-family: var(--font-bengali);
  letter-spacing: 0.01em;
  font-weight: 600;
  line-height: 1.5;
  transition: all 0.2s ease;
}

.btn-ndf-primary {
  background: linear-gradient(135deg, var(--ndf-green) 0%, var(--ndf-green-dark) 100%);
  color: #ffffff !important;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 132, 61, 0.25);
}

.btn-ndf-primary:hover {
  background: linear-gradient(135deg, var(--ndf-green-dark) 0%, #004520 100%);
  box-shadow: 0 6px 18px rgba(0, 132, 61, 0.35);
  transform: translateY(-1px);
}

.btn-ndf-primary:active {
  transform: translateY(0);
}

.btn-ndf-outline {
  border: 2px solid var(--ndf-green);
  color: var(--ndf-green);
  background: transparent;
  font-weight: 600;
  border-radius: 10px;
}

.btn-ndf-outline:hover {
  background-color: var(--ndf-green);
  color: #ffffff !important;
}

/* Elegant Table Typography */
.table {
  font-family: var(--font-bengali);
}

.table th {
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #334155;
  background-color: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

.table td {
  vertical-align: middle;
  line-height: 1.6;
}

/* Currency & Number formatting */
.currency-amount {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* Micro-animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-up {
  animation: fadeInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
