/* =========================================================
   Sub-pages: legal (privacy / terms / sla) + village-map.php.
   Loaded after css/home.css, which supplies tokens, navbar, footer.
   ========================================================= */

/* ---------- Shared page hero ---------- */
.page-hero { position: relative; overflow: hidden; padding: 150px 0 56px; }
.page-hero::before {
  content: ""; position: absolute; width: 760px; height: 760px; right: -280px; top: -320px; pointer-events: none;
  background: radial-gradient(circle, rgba(201, 162, 75, 0.2), transparent 62%);
}

/* =========================================================
   LEGAL PAGES
   ========================================================= */
.legal-page .legal-hero { position: relative; overflow: hidden; padding: 150px 0 60px; text-align: center; }
.legal-page .legal-hero::before {
  content: ""; position: absolute; width: 760px; height: 760px; right: -260px; top: -320px; pointer-events: none;
  background: radial-gradient(circle, rgba(201, 162, 75, 0.2), transparent 62%);
}
.legal-page .legal-hero .container { position: relative; }
.legal-page .legal-hero h1 {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(36px, 5vw, 58px); letter-spacing: -0.02em; line-height: 1.08;
}
.legal-meta {
  display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; margin-top: 20px;
  padding: 8px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--divider);
  box-shadow: var(--shadow-sm); font-size: 13.5px; color: var(--muted);
}

.legal-body { padding: 0 0 20px; }
.legal-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; max-width: 880px; margin: 0 auto; }
.legal-layout.has-toc { grid-template-columns: 250px minmax(0, 1fr); max-width: 1140px; }

.legal-toc { position: sticky; top: 100px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; padding: 22px 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--divider); }
.legal-toc h4 { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-600); margin-bottom: 12px; }
.legal-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.legal-toc a {
  display: block; padding: 7px 10px; border-radius: 10px; font-size: 13.5px; line-height: 1.4; color: var(--muted);
  border-left: 2px solid transparent; transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.legal-toc a:hover { background: var(--bg); color: var(--text); }
.legal-toc a.is-active { color: var(--forest-deep); background: var(--forest-soft); border-left-color: var(--forest); font-weight: 600; }

.legal-card {
  background: var(--surface); border: 1px solid var(--divider); border-radius: 28px;
  padding: 56px 60px 60px; box-shadow: var(--shadow-sm); font-size: 16px; line-height: 1.75;
}
.legal-card > p { margin: 0 0 16px; color: #3d4841; }
.legal-card > p:first-child { font-size: 17.5px; color: var(--text); padding-bottom: 26px; border-bottom: 1px solid var(--divider); margin-bottom: 8px; }
.legal-card h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 25px; letter-spacing: -0.01em; line-height: 1.25;
  margin: 44px 0 14px; scroll-margin-top: 100px; color: var(--forest-deeper);
}
.legal-card h2::before { content: ""; display: block; width: 36px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-light)); margin-bottom: 16px; }
.legal-card h3 { font-size: 18px; margin: 24px 0 8px; }
.legal-card ul { list-style: none; margin: 8px 0 18px; padding: 0; display: grid; gap: 10px; }
.legal-card li { position: relative; padding-left: 28px; color: #3d4841; }
.legal-card li::before {
  content: ""; position: absolute; left: 4px; top: 0.62em; width: 10px; height: 10px; border-radius: 3px;
  background: var(--forest-soft); border: 2px solid var(--forest); transform: rotate(45deg);
}
.legal-card a { color: var(--forest); font-weight: 600; border-bottom: 1px solid rgba(201, 162, 75, 0.6); }
.legal-card a:hover { color: var(--forest-deep); border-bottom-color: var(--forest); }
.legal-card strong { color: var(--text); }

.legal-table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 16px 0 24px; font-size: 15px; border: 1px solid var(--divider); border-radius: 16px; overflow: hidden; }
.legal-table th, .legal-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--divider); vertical-align: top; }
.legal-table th { background: var(--forest-deeper); color: #fff; font-weight: 600; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.legal-table tr:last-child td { border-bottom: 0; }
.legal-table tr:nth-child(even) td { background: #f7faf6; }
.legal-table-wrap { overflow-x: auto; }

.legal-notice {
  margin-top: 40px; padding: 20px 22px; border-radius: 18px; font-size: 15px; line-height: 1.6;
  display: flex; gap: 14px; align-items: flex-start;
}
.legal-notice svg { flex-shrink: 0; margin-top: 2px; }
.legal-notice.warning { background: #fff8e6; border: 1px solid #f3d98f; color: #6d5410; }
.legal-notice.info { background: var(--forest-soft); border: 1px solid #c6dcc2; color: var(--forest-deep); }

/* =========================================================
   VILLAGE MAP PURCHASE PAGE  (body.vm-page)
   IDs/classes here are driven by js/village-map.js — keep them.
   ========================================================= */
.vm-page .wrap { position: relative; max-width: var(--container); margin: 0 auto; padding: 128px 24px 20px; }
.vm-page .wrap::before {
  content: ""; position: absolute; width: 760px; height: 760px; right: -300px; top: -300px; z-index: -1; pointer-events: none;
  background: radial-gradient(circle, rgba(201, 162, 75, 0.2), transparent 62%);
}
.vm-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 36px; align-items: start; }

.vm-page .card {
  background: var(--surface); border: 1px solid var(--divider); border-radius: 28px;
  padding: 40px 40px 36px; box-shadow: var(--shadow-md);
}
.vm-page .pill {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px;
  padding: 6px 14px; border-radius: 999px; background: var(--gold-soft); color: #6b5212;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.vm-page .card h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(30px, 3.6vw, 42px); letter-spacing: -0.02em; line-height: 1.1; color: var(--forest-deeper); margin-bottom: 12px; }
.vm-page .sub { color: var(--muted); font-size: 16px; margin-bottom: 24px; }

.vm-page label { display: block; font-weight: 600; font-size: 13.5px; color: var(--text); margin: 18px 0 7px; }
.vm-page select, .vm-page input {
  width: 100%; padding: 13px 14px; border: 1px solid #cfdccb; border-radius: 12px;
  font: inherit; font-size: 15px; color: var(--text); background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.vm-page select {
  -webkit-appearance: none; appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%232e7d32' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.vm-page select:focus, .vm-page input:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.14); }
.vm-page select:disabled { background-color: #f3f6f2; color: #9aa897; cursor: not-allowed; }
.vm-page .row { display: flex; gap: 14px; flex-wrap: wrap; }
.vm-page .row > div { flex: 1; min-width: 190px; }

.vm-page .quote {
  display: none; position: relative; overflow: hidden; margin-top: 22px; padding: 22px 24px; border-radius: 20px; color: #fff;
  background: radial-gradient(circle at 90% 0%, rgba(201, 162, 75, 0.45), transparent 50%), linear-gradient(140deg, var(--forest-deep), var(--forest-deeper));
}
.vm-page .quote.show { display: block; animation: quote-in 0.5s var(--ease); }
@keyframes quote-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.vm-page .quote .count { font-size: 14px; color: rgba(232, 239, 230, 0.8); }
.vm-page .quote .count span { color: #fff; font-weight: 700; }
.vm-page .quote .price { font-family: var(--font-display); font-size: 46px; font-weight: 600; line-height: 1.1; margin-top: 4px; color: var(--gold-light); }
.vm-page .quote .tier { font-size: 13px; color: rgba(232, 239, 230, 0.7); margin-top: 2px; }

.vm-page .email-note {
  font-size: 13.5px; line-height: 1.5; color: var(--forest-deep); margin-top: 10px;
  background: var(--forest-soft); border: 1px solid #c6dcc2; border-radius: 12px; padding: 11px 13px;
}
.vm-page .err { display: none; color: #b3261e; font-size: 14px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #fdecea; border: 1px solid #f5c2bd; }
.vm-page .err.show { display: block; }

.vm-page .btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 22px; padding: 16px;
  border: 0; border-radius: 14px; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; text-decoration: none;
  background: linear-gradient(135deg, var(--forest), var(--forest-deep)); color: #fff;
  box-shadow: 0 16px 32px -16px rgba(15, 51, 30, 0.7); transition: transform 0.3s var(--ease), box-shadow 0.3s, opacity 0.2s;
}
.vm-page .btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 20px 36px -14px rgba(15, 51, 30, 0.75); }
.vm-page .btn:disabled { background: #b9cdb6; box-shadow: none; cursor: not-allowed; }
.vm-page .btn.secondary { background: #fff; color: var(--forest-deep); border: 1.5px solid var(--forest); box-shadow: none; }
.vm-page .btn.secondary:hover { background: var(--forest-soft); }
.vm-page #btnBuy:not(:disabled) { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #2b2105; box-shadow: 0 16px 34px -14px rgba(201, 162, 75, 0.9); }
.vm-page .sample-hint { font-size: 13px; color: var(--muted); margin: 8px 0 6px; text-align: center; }
.vm-page .refund-note { font-size: 13.5px; line-height: 1.5; color: #7a3413; background: #fff4e6; border: 1px solid #f3cf97; border-radius: 12px; padding: 11px 13px; margin-top: 12px; }
.vm-page .pay-note { background: var(--forest-soft); border: 1px solid #c6dcc2; border-radius: 12px; padding: 11px; font-size: 13px; color: var(--forest-deep); margin-top: 14px; text-align: center; }

.vm-page .pricing-block { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--divider); }
.vm-page .pricing-block h3 { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--forest-deeper); display: flex; align-items: center; gap: 8px; }
.vm-page .pricing-block h3::before { content: "🏷️"; font-size: 18px; }
.vm-page .pricing-sub { font-size: 14px; color: var(--muted); margin: 4px 0 14px; }
.vm-page .pricing-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--divider); border-radius: 16px; overflow: hidden; }
.vm-page .pricing-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: #fff; background: var(--forest-deeper); padding: 12px 16px; }
.vm-page .pricing-table th.amt, .vm-page .pricing-table td.amt { text-align: right; }
.vm-page .pricing-table td { padding: 13px 16px; border-bottom: 1px solid var(--divider); font-size: 15px; transition: background-color 0.3s; }
.vm-page .pricing-table tr:last-child td { border-bottom: 0; }
.vm-page .pricing-table td.amt { font-weight: 700; color: var(--forest-deep); font-variant-numeric: tabular-nums; }
.vm-page .pricing-table tr.active td { background: var(--gold-soft); }
.vm-page .pricing-table tr.active td:first-child { font-weight: 700; color: var(--forest-deeper); box-shadow: inset 4px 0 0 var(--gold); }

.vm-page .disclaimer-big { font-size: 14px; line-height: 1.65; color: var(--muted); margin-top: 24px; background: #f7faf6; border: 1px solid var(--divider); border-radius: 14px; padding: 16px 18px; }

/* Aside: preview + what's included */
.vm-aside { position: sticky; top: 100px; display: grid; gap: 20px; }
.vm-preview {
  position: relative; overflow: hidden; border-radius: 28px; padding: 34px 30px 30px; text-align: center; color: #e8efe6;
  background: radial-gradient(circle at 85% 8%, rgba(201, 162, 75, 0.32), transparent 45%), linear-gradient(145deg, var(--forest-deep), var(--forest-deeper));
}
.vm-preview .grid-bg {
  background-image: linear-gradient(rgba(226, 193, 122, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(226, 193, 122, 0.08) 1px, transparent 1px);
  -webkit-mask-image: none; mask-image: none;
}
.vm-preview-sheet { position: relative; width: 210px; margin: 0 auto 22px; border: 7px solid #fff; border-radius: 10px; background: #fff; box-shadow: 0 30px 50px -18px rgba(0, 0, 0, 0.6); transform: rotate(-3deg); transition: transform 0.5s var(--ease); }
.vm-preview:hover .vm-preview-sheet { transform: rotate(0) scale(1.03); }
.vm-preview-sheet::after { content: "A3 · PDF"; position: absolute; right: -14px; top: 18px; padding: 5px 10px; border-radius: 999px; background: var(--gold); color: #2b2105; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; box-shadow: 0 8px 16px -6px rgba(0,0,0,0.4); }
.vm-preview strong { position: relative; display: block; font-family: var(--font-display); font-size: 22px; font-weight: 600; color: #fff; }
.vm-preview span { position: relative; display: block; font-size: 14px; color: rgba(232, 239, 230, 0.75); margin-top: 4px; }
.vm-perks { background: var(--surface); border: 1px solid var(--divider); border-radius: 24px; padding: 24px 24px 20px; }
.vm-perks-title { font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-600); margin-bottom: 14px; }
.vm-perks ul { display: grid; gap: 14px; }
.vm-perks li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; line-height: 1.45; }
.vm-perks li strong { display: block; font-size: 15px; }
.vm-perks li span { color: var(--muted); font-size: 13.5px; }
.vm-perks .fc-icon { width: 38px; height: 38px; }
.vm-trust { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 13px; color: var(--muted); }
.vm-trust svg { width: 16px; height: 16px; color: var(--forest); }

/* Processing / success overlay (content injected by village-map.js) */
.vm-page .overlay {
  position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px;
  background: rgba(10, 30, 18, 0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.vm-page .overlay.show { display: flex; animation: fade-in 0.25s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.vm-page .modal {
  background: #fff; border-radius: 26px; max-width: 440px; width: 100%; padding: 34px 30px 28px; text-align: center;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.55); animation: modal-in 0.4s var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
.vm-page .modal h3 { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--forest-deeper); margin-bottom: 10px; }
.vm-page .modal p { font-size: 15px; color: var(--muted); margin-bottom: 14px; line-height: 1.55; }
.vm-page .modal .btn { margin-top: 12px; }
.vm-page .spin { width: 46px; height: 46px; margin: 0 auto 18px; border-radius: 50%; border: 4px solid var(--forest-soft); border-top-color: var(--forest); border-right-color: var(--gold); animation: sp 0.9s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .legal-layout.has-toc { grid-template-columns: minmax(0, 1fr); max-width: 880px; }
  .legal-toc { display: none; }
  .vm-layout { grid-template-columns: minmax(0, 1fr); }
  .vm-aside { position: static; grid-template-columns: 1fr 1fr; order: -1; }
  .vm-preview { padding: 26px 20px 22px; }
  .vm-preview-sheet { width: 150px; }
}
@media (max-width: 640px) {
  .legal-page .legal-hero { padding: 120px 0 40px; }
  .legal-meta { border-radius: 16px; font-size: 12.5px; }
  .legal-card { padding: 30px 20px 34px; border-radius: 22px; font-size: 15.5px; }
  .legal-card > p:first-child { font-size: 16px; }
  .legal-card h2 { font-size: 21px; margin-top: 36px; }
  .legal-table { font-size: 13.5px; display: block; overflow-x: auto; }
  .legal-table th, .legal-table td { padding: 10px 12px; }
  .vm-page .wrap { padding: 104px 16px 10px; }
  .vm-page .card { padding: 26px 18px 24px; border-radius: 22px; }
  .vm-aside { grid-template-columns: 1fr; }
  .vm-perks { display: none; }
  .vm-preview { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; text-align: left; padding: 18px; border-radius: 22px; }
  .vm-preview-sheet { width: 96px; margin: 0; border-width: 4px; }
  .vm-preview-sheet::after { display: none; }
  .vm-preview strong { font-size: 18px; }
  .vm-page .quote .price { font-size: 38px; }
  .vm-page .pricing-table td, .vm-page .pricing-table th { padding: 11px 12px; }
}
.vm-page .card a[href*="razorpay"] img { display: inline-block; }
