:root {
  --primary: #1e4d8b;
  --primary-dark: #163a6a;
  --primary-light: #2e6bb8;
  --accent: #d97706;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-dark: #0f172a;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --green: #16a34a;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-lg: 0 4px 6px rgba(0,0,0,0.05), 0 20px 40px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body.lang-ta,
body.lang-ta * {
  font-family: 'Noto Sans Tamil', 'Inter', sans-serif;
}

/* Tamil-specific layout adjustments — Tamil glyphs are wider and taller than Latin */
body.lang-ta h1 { font-size: clamp(1.5rem, 3.8vw, 2.5rem); line-height: 1.3; }
body.lang-ta h2 { font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1.35; }
body.lang-ta h3 { font-size: 1.1rem; line-height: 1.4; }
body.lang-ta .lead { font-size: 1.05rem; }
body.lang-ta .logo-text strong { font-size: 0.95rem; line-height: 1.2; }
body.lang-ta .logo-text small { font-size: 0.7rem; line-height: 1.3; }
body.lang-ta .badge { font-size: 0.78rem; }
body.lang-ta .nav a { font-size: 0.9rem; }
body.lang-ta .btn { font-size: 0.9rem; }
body.lang-ta .btn-lg { font-size: 0.95rem; padding: 0.85rem 1.5rem; }
body.lang-ta .hero-stats strong { font-size: 1.5rem; }
body.lang-ta .hero-stats span { font-size: 0.78rem; }
body.lang-ta .eyebrow { font-size: 0.78rem; letter-spacing: 0.05em; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { line-height: 1.2; color: var(--bg-dark); font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
p { color: var(--text-light); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn-outline {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}
.btn-outline:hover {
  background: var(--primary);
  color: white;
  text-decoration: none;
}
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }

/* Topbar */
.topbar {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}
.topbar-inner {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.topbar a { color: inherit; }
.topbar a:hover { color: white; text-decoration: none; }

/* Header */
.header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  gap: 2rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  min-width: 44px;
  height: 44px;
  padding: 0 0.6rem;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: -0.02em;
}
.logo-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.logo-text strong {
  display: block;
  font-size: 1rem;
  color: var(--bg-dark);
  white-space: nowrap;
}
.logo-text small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light);
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: nowrap;
}
body.lang-ta .nav { gap: 1.1rem; }
.nav a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav a:hover { color: var(--primary); text-decoration: none; }

.nav-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* Language switch — segmented control with sliding pill */
.lang-switch {
  position: relative;
  display: inline-flex;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  white-space: nowrap;
}
.lang-switch::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  background: var(--primary);
  border-radius: 999px;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
  box-shadow: 0 1px 3px rgba(30, 77, 139, 0.25);
}
.lang-switch.is-ta::before {
  transform: translateX(100%);
}
.lang-opt {
  position: relative;
  z-index: 2;
  background: transparent;
  border: none;
  padding: 0.4rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-light);
  border-radius: 999px;
  font-family: inherit;
  transition: color 0.2s;
  line-height: 1.2;
}
.lang-opt:hover { color: var(--text); }
.lang-opt.active { color: white; }
.lang-opt.active:hover { color: white; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #f0f7ff 0%, #fafbff 100%);
  padding: 5rem 0 5rem;
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
}
.hero-grid:has(> :only-child) {
  grid-template-columns: 1fr;
}
.hero-grid:has(> :only-child) h1 { text-wrap: balance; }
.hero-grid:has(> :only-child) h1 .accent { display: block; }
.badge {
  display: inline-block;
  background: white;
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.accent { color: var(--primary); }
.lead {
  font-size: 1.15rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  max-width: 540px;
}
.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}
.hero-stats {
  display: flex;
  gap: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.hero-stats > div { display: flex; flex-direction: column; }
.hero-stats strong {
  font-size: 1.75rem;
  color: var(--primary);
  font-weight: 800;
}
.hero-stats span {
  font-size: 0.85rem;
  color: var(--text-light);
}

.hero-visual { display: flex; justify-content: center; }
.hero-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  width: 100%;
  max-width: 380px;
  border: 1px solid var(--border);
}
.hero-card-header {
  background: var(--bg-dark);
  color: white;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
}
.dot-green { background: var(--green); box-shadow: 0 0 8px rgba(22,163,74,0.5); }
.hero-card-body { padding: 1.5rem; }
.cert-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.cert-row:last-child { border-bottom: none; }
.cert-row span { color: var(--text-light); }
.cert-row strong { color: var(--bg-dark); }
.cert-row strong.green { color: var(--green); }

/* Trust strip */
.trust-strip {
  background: var(--primary);
  color: white;
  padding: 1rem 0;
  text-align: center;
}
.trust-strip p { color: rgba(255,255,255,0.95); font-weight: 500; font-size: 0.95rem; }

/* Sections */
.section {
  padding: 5rem 0;
}
.section-alt { background: var(--bg-alt); }
.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem;
}
.section-head p { font-size: 1.05rem; }
.eyebrow {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: inline-block;
  margin-bottom: 0.75rem;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
}
.about-grid:has(> :only-child) {
  grid-template-columns: 1fr;
  max-width: 820px;
  margin: 0 auto;
}
.about-grid p { margin-bottom: 1rem; font-size: 1.05rem; }
.check-list {
  list-style: none;
  margin-top: 1.5rem;
}
.check-list li {
  padding: 0.5rem 0 0.5rem 2rem;
  position: relative;
  color: var(--text);
}
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--green);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.image-placeholder {
  background: linear-gradient(135deg, var(--bg-alt), #e0e7ff);
  border-radius: var(--radius);
  aspect-ratio: 4/5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-style: italic;
  border: 2px dashed var(--border);
}

/* Service cards */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.card {
  background: white;
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.card-icon {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

/* Level table */
.level-comparison {
  margin-top: 3rem;
  background: white;
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--border);
}
.level-comparison h3 { text-align: center; margin-bottom: 1.5rem; }
.level-comparison table {
  width: 100%;
  border-collapse: collapse;
}
.level-comparison th, .level-comparison td {
  padding: 0.85rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.level-comparison th:first-child, .level-comparison td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--text);
}
.level-comparison th { background: var(--bg-alt); font-weight: 600; color: var(--bg-dark); }
.level-comparison th.highlight, .level-comparison td.highlight {
  background: rgba(30, 77, 139, 0.06);
  color: var(--primary);
  font-weight: 600;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  position: relative;
}
.step {
  text-align: center;
  padding: 1.5rem 1rem;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.step-num {
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}
.step h3 { font-size: 1.05rem; }
.step p { font-size: 0.9rem; }

/* Why grid items */
.why-item {
  background: white;
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.why-item h3 { color: var(--bg-dark); margin-bottom: 0.5rem; font-size: 1.1rem; }

/* Testimonials */
.quote {
  background: var(--bg-alt);
  padding: 1.75rem;
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
}
.quote p {
  font-style: italic;
  margin-bottom: 1rem;
  color: var(--text);
  font-size: 1rem;
}
.quote p a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
.quote p a:hover { color: var(--primary-dark); }
.quote footer {
  font-size: 0.9rem;
  color: var(--text-light);
  font-style: normal;
}
.quote footer strong { color: var(--bg-dark); }

/* FAQ */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-list details {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: all 0.2s;
}
.faq-list details[open] {
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
}
.faq-list summary {
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--bg-dark);
  list-style: none;
  position: relative;
  padding-right: 3rem;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 1.5rem;
  top: 1.1rem;
  font-size: 1.5rem;
  color: var(--primary);
  transition: transform 0.2s;
  font-weight: 400;
}
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p {
  padding: 0 1.5rem 1.25rem;
  color: var(--text-light);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: start;
}
.contact-list {
  list-style: none;
  margin-top: 1.5rem;
}
.contact-list li {
  padding: 0.65rem 0;
  font-size: 1rem;
  color: var(--text);
}
.contact-list a { color: var(--text); }
.contact-list a:hover { color: var(--primary); }

.contact-form {
  background: white;
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.contact-form label {
  display: block;
  margin-bottom: 1rem;
}
.contact-form label span {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--bg-dark);
}
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: white;
  transition: border-color 0.2s;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 77, 139, 0.1);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-row label { margin-bottom: 0; }
.form-note {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 1rem;
  text-align: center;
}
.contact-form button { width: 100%; margin-top: 0.5rem; }
.contact-form button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Field-level validation errors */
.field-error {
  display: none;
  margin-top: 0.35rem;
  color: #b91c1c;
  font-size: 0.8rem;
  font-weight: 500;
}
.contact-form label.is-invalid input,
.contact-form label.is-invalid select,
.contact-form label.is-invalid textarea {
  border-color: #dc2626;
  background: #fef2f2;
}
.contact-form label.is-invalid input:focus,
.contact-form label.is-invalid select:focus,
.contact-form label.is-invalid textarea:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.contact-form label.is-invalid .field-error { display: block; }

/* Footer */
.footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.75);
  padding: 4rem 0 0;
}
.footer .logo-text strong { color: white; }
.footer .logo-text small { color: rgba(255,255,255,0.5); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
}
.footer h4 {
  color: white;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.footer ul { list-style: none; }
.footer ul li { padding: 0.3rem 0; font-size: 0.9rem; }
.footer ul a { color: rgba(255,255,255,0.75); }
.footer ul a:hover { color: white; }
.footer-about { font-size: 0.9rem; margin-top: 1rem; max-width: 320px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.85rem;
}
.footer-bottom p { color: rgba(255,255,255,0.5); }

/* City grid (homepage) */
.city-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.city-card {
  background: white;
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}
.city-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  text-decoration: none;
}
.city-card-icon {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}
.city-card h3 {
  color: var(--bg-dark);
  margin-bottom: 0.5rem;
}
.city-card p {
  color: var(--text-light);
  font-size: 0.9rem;
  flex: 1;
  margin-bottom: 1rem;
}
.city-card-link {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}
.city-card-add {
  background: linear-gradient(135deg, var(--bg-alt), #f0f7ff);
  border-style: dashed;
}

/* Area chips (city page hero card) */
.area-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chip {
  display: inline-block;
  background: var(--bg-alt);
  color: var(--text);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
}

/* Area grid (city page) */
.area-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.area-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  transition: all 0.2s;
}
.area-card:hover {
  border-color: var(--primary);
  background: rgba(30, 77, 139, 0.04);
}

/* WhatsApp float */
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #25D366;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  z-index: 99;
  transition: transform 0.2s;
}
.whatsapp-float:hover { transform: scale(1.08); }

/* Responsive */
@media (max-width: 968px) {
  .hero-grid,
  .about-grid,
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero { padding: 3rem 0; }
  .hero-visual { order: -1; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .city-grid { grid-template-columns: repeat(2, 1fr); }
  .area-grid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
  .topbar { display: none; }
}

@media (max-width: 640px) {
  .nav { display: none; }
  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem 1.5rem;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .nav.open a { padding: 0.5rem 0; }
  .menu-toggle { display: block; }
  .nav-actions .btn { display: none; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .city-grid { grid-template-columns: 1fr; }
  .area-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.5rem; flex-wrap: wrap; }
  .hero-stats strong { font-size: 1.5rem; }
  .form-row { grid-template-columns: 1fr; }
  .section { padding: 3rem 0; }
  h1 { font-size: 2rem; }
  .level-comparison { padding: 1rem; overflow-x: auto; }
  .level-comparison table { font-size: 0.85rem; min-width: 480px; }
}
