/* Farmey earthy-minimalist tokens - from farmey-app/src/theme/tokens.ts */

:root {
  --pearl: #f8f9fa;
  --slate: #2a3b36;
  --sage: #b8c5ab;
  --mustard: #e9b949;
  --mint: #b9e4c1;
  --surface: #ffffff;
  --slate-raised: #395047;
  --mist: #eff1ee;
  --ash: #e4e8e0;
  --text: #2a3b36;
  --text-secondary: rgba(42, 59, 54, 0.55);
  --text-body: rgba(42, 59, 54, 0.65);
  --text-muted: rgba(42, 59, 54, 0.45);
  --text-on-slate: #f8f9fa;
  --border: rgba(42, 59, 54, 0.1);
  --border-strong: rgba(42, 59, 54, 0.25);
  --up: #3e7a55;
  --accent: #c99a2e;
  --on-mint: #26493a;
  --on-amber: #6e5410;
  --amber: #f5dfa3;
  --gutter: 26px;
  --radius-pill: 999px;
  --tap: 48px;
  --latin: "Inter", system-ui, sans-serif;
  --display: "Manrope", "Inter", system-ui, sans-serif;
  --sinhala: "Abhaya Libre", "Inter", sans-serif;
  --tamil: "Tiro Tamil", "Inter", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--surface);
  color: var(--text);
}

body {
  font-family: var(--latin);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

html[lang="si"] body {
  font-family: var(--sinhala);
  line-height: 1.75;
}

html[lang="ta"] body {
  font-family: var(--tamil);
  line-height: 1.75;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--mustard);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip:focus {
  left: var(--gutter);
  top: 8px;
  z-index: 20;
  background: var(--surface);
  padding: 8px 12px;
}

/* --- Language switcher (globe) --- */

.lang-switch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px var(--gutter) 0;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--mist);
  color: var(--slate);
  cursor: pointer;
}

.lang-globe {
  display: block;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: var(--gutter);
  z-index: 40;
  min-width: 148px;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(7, 61, 49, 0.12);
}

.lang-menu .lang-btn {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.lang-menu .lang-btn:hover {
  background: var(--mist);
}

.lang-menu .lang-btn[aria-pressed="true"],
.lang-menu .lang-btn[aria-selected="true"] {
  background: var(--mist);
  color: var(--slate);
  font-weight: 600;
}

/* Marketing header overrides site padding */
.m-header .lang-switch {
  padding: 0;
}

/* --- Marketing chrome: landing, standalone browser only --- */

.site-header {
  display: none;
  padding: 22px var(--gutter) 8px;
}

.page-home:not(.is-embed) .site-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--slate);
  text-decoration: none;
}

.brand:hover,
.brand:focus-visible {
  text-decoration: none;
}

.brand img,
.brand svg {
  width: 40px;
  height: 40px;
}

.brand-name {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.wrap {
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 8px var(--gutter) 48px;
}

.page-home .wrap {
  padding-top: 18px;
}

/* --- Type --- */

.eyebrow {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

html[lang="si"] h1,
html[lang="ta"] h1 {
  font-family: inherit;
  letter-spacing: 0;
}

.lede {
  margin: 0 0 28px;
  color: var(--text-body);
  font-size: 16px;
  line-height: 1.55;
}

.note {
  margin: 0 0 20px;
  padding: 12px 14px;
  background: var(--pearl);
  border-radius: 8px;
  color: var(--text-body);
  font-size: 14px;
}

.note strong {
  color: var(--slate);
  font-weight: 600;
}

/* --- Landing --- */

.hero-pitch {
  margin: 0 0 32px;
  color: var(--text-body);
  font-size: 18px;
  line-height: 1.5;
}

.links {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--tap);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  color: var(--slate);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.links a::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--slate);
  border-bottom: 1.5px solid var(--slate);
  transform: rotate(-45deg);
  opacity: 0.45;
}

.contact {
  margin-top: 36px;
}

.contact a {
  color: var(--slate);
  font-weight: 500;
}

.site-footer {
  display: none;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

.page-home:not(.is-embed) .site-footer {
  display: block;
}

/* --- Tabs (CSS-only, works with JS off) --- */

.shelf-switch {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 22px;
}

.tabs label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 8px 10px;
  border-radius: var(--radius-pill);
  background: var(--mist);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
  cursor: pointer;
}

#tab-learn:checked ~ .tabs label[for="tab-learn"],
#tab-rules:checked ~ .tabs label[for="tab-rules"] {
  background: var(--slate);
  color: var(--text-on-slate);
}

.panel {
  display: none;
}

#tab-learn:checked ~ .panel-learn,
#tab-rules:checked ~ .panel-rules {
  display: block;
}

.section-intro {
  margin: 0 0 18px;
  color: var(--text-body);
}

/* --- Entries --- */

.entry {
  border-top: 1px solid var(--border);
}

.entry:last-child {
  border-bottom: 1px solid var(--border);
}

.entry details {
  padding: 4px 0 8px;
}

.entry summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 28px 14px 0;
  position: relative;
}

.entry summary::-webkit-details-marker {
  display: none;
}

.entry summary::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 22px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg);
}

.entry details[open] summary::after {
  top: 26px;
  transform: rotate(-135deg);
}

.entry h2 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.35;
}

.summary {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.45;
}

.entry-body {
  padding: 0 0 16px;
  color: var(--text-body);
}

.entry-body p {
  margin: 0 0 12px;
}

.entry-body ul {
  margin: 0 0 12px;
  padding-left: 1.15em;
}

.entry-body li {
  margin: 0 0 6px;
}

.entry-body li::marker {
  color: var(--sage);
}

/* --- Government facts --- */

.scheme {
  padding: 22px 0;
  border-top: 1px solid var(--border);
}

.scheme:last-of-type {
  border-bottom: 1px solid var(--border);
}

.scheme h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.badge {
  display: inline-block;
  margin: 0 0 14px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--amber);
  color: var(--on-amber);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}

.facts {
  margin: 0 0 16px;
  padding: 0;
}

.facts div {
  display: grid;
  grid-template-columns: 38% 1fr;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.facts div:last-child {
  border-bottom: 1px solid var(--border);
}

.facts dt {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.facts dd {
  margin: 0;
  color: var(--slate);
  font-size: 14.5px;
  font-weight: 400;
}

@media (max-width: 400px) {
  .facts div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.prose p {
  margin: 0 0 12px;
  color: var(--text-body);
}

.prose p:last-child {
  margin-bottom: 0;
}

/* --- Experts --- */

.steps {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}

.steps li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.steps li:last-child {
  border-bottom: 1px solid var(--border);
}

.step-n {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--on-mint);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
}

.step-body strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

.step-body span {
  color: var(--text-body);
  font-size: 14.5px;
}

.pill {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--mint);
  color: var(--on-mint);
  font-size: 12px;
  font-weight: 600;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  background: var(--slate);
  color: var(--text-on-slate);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.cta:hover,
.cta:focus-visible {
  color: var(--text-on-slate);
  text-decoration: none;
}

.cta-wrap {
  margin: 8px 0 28px;
}

/* --- Privacy --- */

.policy h2 {
  margin: 28px 0 10px;
  font-size: 18px;
  font-weight: 600;
}

.policy h3 {
  margin: 20px 0 8px;
  font-size: 16px;
  font-weight: 500;
}

.policy p,
.policy li {
  color: var(--text-body);
}

.policy ul {
  margin: 0 0 12px;
  padding-left: 1.15em;
}

.policy li {
  margin: 0 0 6px;
}

.updated {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.lang-summary {
  margin: 0 0 24px;
  padding: 14px 16px;
  background: var(--pearl);
  border-radius: 8px;
}

.lang-summary p {
  margin: 0 0 10px;
  color: var(--text-body);
  font-size: 14.5px;
}

.lang-summary p:last-child {
  margin-bottom: 0;
}

html[lang="en"] .lang-summary .si,
html[lang="en"] .lang-summary .ta,
html[lang="si"] .lang-summary .en,
html[lang="si"] .lang-summary .ta,
html[lang="ta"] .lang-summary .en,
html[lang="ta"] .lang-summary .si {
  display: none;
}

/* Forms on legal pages (delete-account) and hub pages */

.form {
  display: grid;
  gap: 14px;
  max-width: 520px;
  margin: 20px 0 28px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  font-size: 14px;
  font-weight: 500;
}

.field input,
.field select,
.field textarea {
  min-height: 48px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--border-input);
  background: var(--surface);
  color: var(--slate);
  font-family: inherit;
  font-size: 16px;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--text-body);
}

.check input {
  margin-top: 4px;
}

.hp {
  position: absolute;
  left: -9999px;
}

.form .cta,
.form .btn-primary {
  justify-self: start;
}
