/* Mobile-first public portal for Hội Nông dân xã Tân Phước Hưng */
:root {
  color-scheme: light;
  --forest-950: #08291e;
  --forest-900: #0d3b2b;
  --forest-800: #14513a;
  --forest-700: #1f6848;
  --leaf: #3c8a5f;
  --mint: #dff2e6;
  --cream: #fffaf0;
  --paper: #ffffff;
  --sand: #f3ead5;
  --gold: #c89a3b;
  --gold-soft: #f2dfaa;
  --ink: #173228;
  --muted: #62736a;
  --line: rgba(20, 81, 58, 0.14);
  --shadow: 0 14px 34px rgba(8, 41, 30, 0.12);
  --shadow-soft: 0 8px 20px rgba(8, 41, 30, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --safe-bottom: max(12px, env(safe-area-inset-bottom));
  font-family: "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: #eef4ef;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
button, input, select, textarea, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(200, 154, 59, 0.45);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 999;
  padding: 10px 14px;
  border-radius: 12px;
  color: white;
  background: var(--forest-900);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.shell {
  width: min(100% - 28px, 720px);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(255,255,255,.2);
  background: rgba(8, 41, 30, 0.94);
  backdrop-filter: blur(16px);
  color: white;
}
.header-row {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-block: 10px;
}
.brand {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
.brand-seal {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242, 223, 170, .7);
  border-radius: 50%;
  background: radial-gradient(circle at 45% 38%, #2c7a55, #0d3b2b 70%);
  box-shadow: 0 8px 18px rgba(0,0,0,.18), inset 0 0 0 3px rgba(255,255,255,.05);
}
.brand-seal svg { width: 30px; height: 30px; }
.brand-copy { min-width: 0; }
.brand-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  letter-spacing: .1px;
}
.brand-copy small {
  display: block;
  margin-top: 1px;
  color: rgba(255,255,255,.72);
  font-size: 11px;
}
.header-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  color: white;
  background: rgba(255,255,255,.08);
  cursor: pointer;
}
.header-button svg { width: 21px; height: 21px; }

.hero {
  position: relative;
  overflow: hidden;
  padding: 22px 0 26px;
  color: white;
  background:
    radial-gradient(circle at 84% 18%, rgba(242, 223, 170, .30), transparent 26%),
    radial-gradient(circle at 15% 80%, rgba(73, 147, 101, .28), transparent 32%),
    linear-gradient(145deg, var(--forest-900), #0a3024 62%, #164f39);
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -44px;
  height: 88px;
  border-radius: 50% 50% 0 0;
  background: #eef4ef;
}
.hero-content { position: relative; z-index: 1; }
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 12px;
  padding: 7px 10px;
  border: 1px solid rgba(242, 223, 170, .45);
  border-radius: 999px;
  color: #f7e9bf;
  background: rgba(255,255,255,.07);
  font-size: 12px;
  font-weight: 700;
}
.hero h1 {
  max-width: 560px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 9vw, 46px);
  line-height: 1.08;
  letter-spacing: -.8px;
}
.hero p {
  max-width: 590px;
  margin: 12px 0 0;
  color: rgba(255,255,255,.82);
  font-size: 15px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}
.hero-stat {
  min-width: 0;
  padding: 11px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background: rgba(255,255,255,.08);
  text-align: center;
}
.hero-stat strong { display: block; color: #f8df99; font-size: 19px; }
.hero-stat span { display: block; margin-top: 2px; color: rgba(255,255,255,.72); font-size: 10px; }

.main-content {
  position: relative;
  z-index: 2;
  padding: 8px 0 calc(92px + var(--safe-bottom));
}
.section { scroll-margin-top: 88px; margin-top: 20px; }
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}
.section-heading span { min-width: 0; }
.section-heading small {
  display: block;
  color: var(--leaf);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.section-heading h2 { margin: 2px 0 0; font-size: 21px; line-height: 1.2; }
.text-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 11px;
  border: 0;
  border-radius: 12px;
  color: var(--forest-800);
  background: var(--mint);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.today-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 13px;
  align-items: center;
  padding: 17px;
  border: 1px solid rgba(200, 154, 59, .20);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #fffaf0, #fff 58%);
  box-shadow: var(--shadow-soft);
}
.today-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #f5e7bd;
  font-size: 29px;
}
.today-card strong { display: block; font-size: 17px; }
.today-card p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.today-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--forest-800);
  background: #edf5ee;
  font-size: 11px;
  font-weight: 700;
}

.notice-list { display: grid; gap: 10px; }
.notice-card {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  text-align: left;
  cursor: pointer;
}
.notice-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eef6ef;
  font-size: 21px;
}
.notice-card strong, .notice-card small { display: block; }
.notice-card strong { font-size: 14px; }
.notice-card small { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.notice-arrow { color: #8ba094; font-size: 18px; }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.quick-action {
  min-height: 126px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  border: 0;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  text-align: left;
  cursor: pointer;
}
.quick-action:nth-child(1) { background: linear-gradient(145deg, #e6f5eb, #fff); }
.quick-action:nth-child(2) { background: linear-gradient(145deg, #fff2d5, #fff); }
.quick-action:nth-child(3) { background: linear-gradient(145deg, #e8f0ff, #fff); }
.quick-action:nth-child(4) { background: linear-gradient(145deg, #fce9e6, #fff); }
.quick-action:nth-child(5) { background: linear-gradient(145deg, #f2e9ff, #fff); }
.quick-action:nth-child(6) { background: linear-gradient(145deg, #e8f7f5, #fff); }
.quick-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: white;
  background: var(--forest-800);
  font-size: 22px;
}
.quick-action strong { display: block; margin-top: 12px; font-size: 15px; }
.quick-action small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

.activity-list { display: grid; gap: 10px; }
.activity-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}
.activity-card header {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}
.activity-number {
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--forest-800);
  font-weight: 800;
}
.activity-card h3 { margin: 0; font-size: 15px; }
.activity-card p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.activity-card footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.activity-card footer span { color: var(--forest-700); font-size: 11px; font-weight: 800; }
.activity-card footer button {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  color: white;
  background: var(--forest-800);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.branch-card {
  padding: 17px;
  border: 1px solid rgba(20, 81, 58, .18);
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, #0f4432, #1a6044);
  color: white;
  box-shadow: var(--shadow);
}
.branch-card label { display: block; color: rgba(255,255,255,.72); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.branch-select {
  width: 100%;
  min-height: 50px;
  margin-top: 8px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  color: var(--ink);
  background: white;
  font-weight: 800;
}
.branch-result {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.13);
}
.branch-symbol {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #f5d986;
  background: rgba(255,255,255,.1);
  font-size: 25px;
}
.branch-result strong, .branch-result small { display: block; }
.branch-result strong { font-size: 17px; }
.branch-result small { margin-top: 3px; color: rgba(255,255,255,.72); font-size: 11px; }
.branch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.branch-actions a, .branch-actions button {
  min-height: 45px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 13px;
  color: white;
  background: rgba(255,255,255,.09);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.info-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}
.info-card + .info-card { margin-top: 10px; }
.info-card header { display: flex; align-items: center; gap: 11px; }
.info-badge {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: var(--forest-800);
  font-size: 21px;
}
.info-card h3 { margin: 0; font-size: 15px; }
.info-card p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.info-card a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 0 13px;
  border-radius: 12px;
  color: white;
  background: var(--forest-800);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}

.map-teaser {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  border-radius: 24px;
  color: white;
  background:
    linear-gradient(180deg, rgba(8,41,30,.04), rgba(8,41,30,.85)),
    url('/tph-village-map-v1.webp') center / cover,
    linear-gradient(145deg, #2d7652, #0e3b2b);
  box-shadow: var(--shadow);
}
.map-teaser-content { position: relative; z-index: 1; }
.map-teaser h3 { margin: 0; font-size: 20px; }
.map-teaser p { margin: 5px 0 0; color: rgba(255,255,255,.78); font-size: 12px; }
.map-teaser a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  padding: 0 14px;
  border-radius: 13px;
  color: var(--forest-900);
  background: #f5df9c;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.site-footer {
  margin-top: 26px;
  padding: 24px 0 calc(92px + var(--safe-bottom));
  color: rgba(255,255,255,.82);
  background: var(--forest-950);
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand strong { color: white; font-size: 14px; }
.footer-copy { margin: 12px 0 0; font-size: 11px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.footer-links a {
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 11px;
  color: white;
  text-decoration: none;
  font-size: 11px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 8px 10px var(--safe-bottom);
  border-top: 1px solid rgba(20,81,58,.13);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px);
  box-shadow: 0 -10px 30px rgba(8,41,30,.10);
}
.bottom-nav-inner {
  width: min(100%, 720px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.bottom-link {
  min-height: 57px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  border-radius: 14px;
  color: #6d7e75;
  background: transparent;
  text-decoration: none;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.bottom-link span:first-child { font-size: 20px; line-height: 1; }
.bottom-link.active { color: var(--forest-800); background: var(--mint); }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 18px 14px max(18px, env(safe-area-inset-bottom));
  background: rgba(3, 20, 14, .58);
  backdrop-filter: blur(6px);
}
.sheet-backdrop.open { display: flex; }
.sheet {
  width: min(100%, 620px);
  max-height: min(84vh, 760px);
  overflow: auto;
  border-radius: 26px 26px 20px 20px;
  background: white;
  box-shadow: 0 24px 80px rgba(0,0,0,.34);
  animation: sheet-up 180ms ease-out;
}
.sheet-handle {
  width: 46px;
  height: 5px;
  margin: 9px auto 0;
  border-radius: 999px;
  background: #d7dfd9;
}
.sheet-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 17px 12px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
}
.sheet-header small { display: block; color: var(--leaf); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.sheet-header h2 { margin: 2px 0 0; font-size: 20px; line-height: 1.2; }
.sheet-close {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 13px;
  background: #eef3ef;
  cursor: pointer;
}
.sheet-body { padding: 0 17px 20px; }
.sheet-body p { color: var(--muted); }
.sheet-list { display: grid; gap: 9px; margin-top: 13px; }
.sheet-list article {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fbfdfb;
}
.sheet-list strong, .sheet-list small { display: block; }
.sheet-list small { margin-top: 3px; color: var(--muted); }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 15px; }
.sheet-actions a, .sheet-actions button {
  min-height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 13px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}
.sheet-actions .primary { color: white; background: var(--forest-800); }
.sheet-actions .secondary { color: var(--forest-800); background: var(--mint); }
.sheet-form { display: grid; gap: 11px; margin-top: 14px; }
.sheet-form label span { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 800; }
.sheet-form input, .sheet-form textarea, .sheet-form select {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid rgba(20,81,58,.20);
  border-radius: 13px;
  background: white;
}
.sheet-form textarea { min-height: 108px; resize: vertical; }
.helper-note {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 13px;
  color: #6b5b2d;
  background: #fff5d8;
  font-size: 11px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(82px + var(--safe-bottom));
  z-index: 120;
  max-width: calc(100% - 28px);
  padding: 11px 14px;
  border-radius: 13px;
  color: white;
  background: var(--forest-950);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 18px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.search-panel {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  padding: max(16px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  background: rgba(238, 244, 239, .98);
}
.search-panel.open { display: block; }
.search-shell { width: min(100%, 720px); margin: 0 auto; }
.search-head { display: flex; gap: 8px; align-items: center; }
.search-box {
  min-height: 50px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
}
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; }
.search-head button { width: 48px; height: 48px; border: 0; border-radius: 14px; background: white; cursor: pointer; }
.search-results { display: grid; gap: 9px; margin-top: 14px; }
.search-result {
  display: block;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  text-decoration: none;
}
.search-result strong, .search-result small { display: block; }
.search-result small { margin-top: 3px; color: var(--muted); }

@keyframes sheet-up { from { transform: translateY(18px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (min-width: 680px) {
  .shell { width: min(100% - 40px, 820px); }
  .hero { padding: 34px 0 42px; }
  .hero-stats { width: 520px; }
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
  .notice-list, .activity-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notice-list .notice-card:last-child:nth-child(odd), .activity-list .activity-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .map-teaser { min-height: 290px; }
  .bottom-nav { left: 50%; right: auto; width: min(760px, calc(100% - 24px)); transform: translateX(-50%); bottom: 8px; border: 1px solid var(--line); border-radius: 22px; }
  .site-footer { padding-bottom: 116px; }
}

@media (min-width: 980px) {
  .shell { width: min(100% - 56px, 1080px); }
  .header-row { min-height: 82px; }
  .brand-copy strong { font-size: 18px; }
  .hero-content { padding-right: 280px; }
  .main-content { padding-bottom: 130px; }
  .desktop-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 18px; align-items: start; }
  .desktop-grid .section { margin-top: 0; }
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
  .bottom-nav { width: 720px; }
}

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