/* Shared Web Panchayat design system.
   Loaded last on every page so typography, color, and component states stay aligned. */
:root {
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Plus Jakarta Sans", "DM Sans", system-ui, sans-serif;

  --ink: #0b2e3f;
  --muted: #536873;
  --line: #dce7df;
  --navy: #0d3559;
  --navy-dark: #071f35;
  --violet: #147a3d;
  --medium-blue: #285f78;
  --bright-green: #1b934d;
  --green-dark: #0c5b2c;
  --green-soft: #e9f5ec;
  --blue-soft: #edf3f7;
  --bg: #f7faf7;
  --surface: #ffffff;
  --surface-soft: #f0f6f1;
  --danger: #b93645;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-display: clamp(2.25rem, 5vw, 3.5rem);

  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 8px 24px rgba(11, 46, 63, 0.06);
  --shadow-md: 0 16px 42px rgba(11, 46, 63, 0.1);
  --focus-ring: 0 0 0 3px rgba(20, 122, 61, 0.16);
}

html {
  font-size: 100%;
}

body {
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font-family: var(--font-body);
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
}

h1 {
  line-height: 1.1;
  letter-spacing: -0.035em;
}

h2 {
  line-height: 1.18;
  letter-spacing: -0.022em;
}

h3,
h4,
h5,
h6 {
  line-height: 1.3;
  letter-spacing: -0.01em;
}

p,
li,
dd,
dt,
th,
td {
  text-wrap: pretty;
}

.eyebrow {
  color: var(--violet);
  font-size: 0.6875rem;
  line-height: 1.45;
  letter-spacing: 0.12rem;
}

.site-header {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom: 1px solid rgba(11, 46, 63, 0.08);
  background: #fff;
  box-shadow: 0 7px 24px rgba(11, 46, 63, 0.07);
}

body:has(.site-header) {
  padding-top: 78px;
}

.site-header > .brand {
  width: auto;
  height: auto;
  flex: 0 0 auto;
  background: none !important;
  display: inline-flex;
  align-items: center;
}

.site-header > nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.site-header nav > a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: #405661;
  font-size: var(--text-sm);
  line-height: 1;
}

.site-header nav > a:hover,
.site-header nav > a.active {
  color: var(--green-dark);
}

.site-header .nav-button,
.site-header nav > a.nav-button.active {
  min-height: 44px;
  padding: 0 18px;
  color: #fff;
  background: var(--navy);
}

.site-header .nav-button:hover {
  color: #fff;
  background: var(--green-dark);
}

footer,
.dashboard-footer {
  color: #d7e3e7;
  background: var(--navy-dark);
  font-size: var(--text-xs);
}

footer > nav a {
  color: #d7e3e7;
}

footer > nav a:hover,
footer > nav a.active {
  color: #fff;
}

a,
button,
summary,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #efb235;
  outline-offset: 3px;
}

button {
  min-height: 48px;
  border-radius: 11px;
  background: var(--navy);
  font-size: 0.9375rem;
}

button:hover {
  background: var(--green-dark);
}

label,
legend {
  color: #344f5b;
  font-size: 0.8125rem;
}

input,
select,
textarea {
  color: var(--ink);
  border-color: var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.9375rem;
}

input:focus,
select:focus,
textarea:focus,
.contact-form textarea:focus {
  border-color: var(--violet);
  box-shadow: var(--focus-ring);
}

.error {
  color: var(--danger);
}

.hint,
.switch-text,
.heading > p:last-child,
.dashboard-copy {
  color: var(--muted);
}

.switch-text a,
.image-button,
.verified {
  color: var(--violet);
}

.auth-aside {
  background: linear-gradient(145deg, var(--navy-dark), var(--navy) 62%, var(--green-dark));
}

.auth-aside .eyebrow {
  color: #bce0c6;
}

.auth-aside h1,
.purpose-band h2 {
  color: #fff;
}

.panel,
.profile-card,
.profile-editor,
.profile-summary,
.dashboard-profile,
.village-table,
.village-feed,
.contact-form,
.legal-content,
.data-card,
.overview-card {
  background: var(--surface);
}

.auth-home-link {
  position: absolute;
  top: 31px;
  left: 7%;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green-dark);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  text-underline-offset: 4px;
}

.auth-home-link:hover {
  text-decoration: underline;
}

.profile-card {
  background: var(--green-soft);
}

.profile-editor,
.profile-summary,
.dashboard-profile,
.contact-form,
.legal-content {
  box-shadow: var(--shadow-md);
}

.profile-view > div,
.profile-details div,
.dashboard-profile,
.contact-form,
.data-card,
.overview-card {
  border-color: var(--line);
}

.avatar,
.profile-photo img,
.profile-photo > div {
  background: var(--bright-green);
}

.gender-options label:has(input:checked),
.profile-gender-options label:has(input:checked) {
  border-color: var(--violet);
  color: var(--green-dark);
  background: var(--green-soft);
  box-shadow: 0 0 0 2px rgba(27, 147, 77, 0.12);
}

.secondary,
.cancel-link {
  color: #344f5b;
  background: var(--blue-soft);
}

.secondary:hover,
.cancel-link:hover {
  background: #e1ecef;
}

.page-hero h1 {
  font-size: var(--text-display);
}

.page-hero > p:last-child {
  color: var(--muted);
  font-size: 1.0625rem;
}

.content-section h2,
.section-intro h2,
.split-section h2,
.contact-wrap h2 {
  font-size: clamp(1.75rem, 3vw, 2.375rem);
}

.content-section > p:last-child,
.split-section p,
.split-section li,
.contact-wrap > div > p,
.legal-content p {
  color: var(--muted);
}

.split-section article {
  background: var(--blue-soft);
}

.split-section article + article {
  background: var(--green-soft);
}

.legal-content,
.contact-form,
.data-card {
  border: 1px solid var(--line);
}

.legal-content h2 {
  color: var(--navy);
  font-size: var(--text-2xl);
}

.legal-updated,
.form-message {
  color: var(--violet) !important;
  font-size: 0.8125rem;
}

.purpose-band {
  background: linear-gradient(120deg, var(--navy-dark), var(--navy));
}

.purpose-band .eyebrow {
  color: #bce0c6;
}

.data-card h3 {
  color: var(--navy);
  background: var(--green-soft);
  font-size: 1.3125rem;
}

th,
td {
  border-color: var(--line);
  font-size: var(--text-sm);
}

thead th {
  color: var(--navy);
  background: var(--blue-soft);
}

tbody th {
  color: #344f5b;
}

tbody td {
  color: var(--ink);
}

.village-dashboard,
.profile-page {
  color: var(--ink);
  background: var(--bg);
}

.dashboard-intro h1,
.profile-heading h1 {
  font-size: 2.25rem;
}

.dashboard-intro > p:last-child,
.profile-heading > p,
.profile-subtitle,
.dashboard-profile .welcome-copy,
.village-feed p,
.profile-view span,
.profile-details span,
.village-table span {
  color: var(--muted);
}

.village-table h2,
.feed-heading h2 {
  font-size: 1.3125rem;
}

.village-table strong,
.profile-view strong,
.profile-details strong {
  color: var(--ink);
}

.edit-profile-button,
.view-profile-link {
  color: #fff;
  background: var(--violet);
}

.edit-profile-button:hover,
.view-profile-link:hover {
  background: var(--bright-green);
}

.dashboard-profile-details div {
  background: var(--surface-soft);
}

.feed-heading > span {
  color: var(--green-dark);
  background: var(--green-soft);
}

.feed-icon {
  color: var(--navy);
  background: var(--blue-soft);
}

.village-feed article {
  border-color: var(--line);
}

.village-feed small {
  color: var(--violet);
}

.overview-section {
  background: var(--surface-soft);
}

.overview-icon {
  color: var(--green-dark);
  background: var(--green-soft);
}

.overview-card h3,
.overview-card p {
  color: var(--muted);
}

.overview-card strong {
  color: var(--ink);
}

@media (max-width: 760px) {
  body:has(.site-header) {
    padding-top: 74px;
  }

  .site-header,
  .home-body .site-header {
    height: 74px;
  }

  .site-header > .brand {
    width: 145px;
    height: 52px;
    flex-basis: 145px;
  }

  .auth-home-link {
    top: 77px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
  }

  .dashboard-intro h1,
  .profile-heading h1 {
    font-size: 1.8125rem;
  }

  .data-card h3 {
    font-size: var(--text-lg);
  }
}

@media (max-width: 600px) {
  .site-header {
    flex-direction: row;
    justify-content: center;
    padding: 9px 5%;
  }

  .site-header > .brand,
  .home-body .site-header > .brand {
    display: inline-flex;
    align-items: center;
    width: auto;
    height: auto;
    flex: 0 0 auto;
    background: none !important;
    margin: 0;
  }

  .home-body .site-header {
    backdrop-filter: none;
  }

  .site-header > nav {
    justify-content: space-evenly;
    gap: 6px;
    margin-left: 0;
  }

  .home-body .site-header > nav {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
  }

  .site-header > nav > a {
    min-height: 44px;
    flex: 1;
    max-width: 130px;
    padding: 0 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
