﻿/* =========================================================
   File Organizer — Donate page
   Theme tokens follow DESIGN.md (light + dark).
   ========================================================= */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, svg { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---------- Tokens ---------- */
:root {
  --bg: #eaf1fc;
  --surface: #ffffff;
  --surface-2: #f4f8fe;
  --fg: #101828;
  --muted: #5e6f86;
  --faint: #93a5be;
  --border: #d7e2f2;
  --accent: #087ff5;
  --accent-hover: #0668cc;
  --accent-ink: #ffffff;
  --accent-soft: #e6f1fe;
  --header-bg: #263b59;
  --header-fg: #ffffff;
  --header-muted: rgba(255, 255, 255, .78);
  --success: #1a9e6a;
  --shadow-float: 0 24px 60px rgba(16, 24, 40, .22);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1120px;
  --sans: 'Inter', 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
html[data-theme="dark"] {
  --bg: #101827;
  --surface: #1b2a41;
  --surface-2: #14243a;
  --fg: #f5f8ff;
  --muted: #a9b8cc;
  --faint: #6f83a0;
  --border: #30445f;
  --accent: #1687f8;
  --accent-hover: #3a9bff;
  --accent-soft: #16304f;
  --header-bg: #14243a;
  --header-fg: #f5f8ff;
  --header-muted: rgba(245, 248, 255, .74);
  --shadow-float: 0 24px 60px rgba(0, 0, 0, .5);
}
html[lang="fa"] { --sans: 'Vazirmatn', 'Inter', system-ui, sans-serif; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
  overflow-x: hidden;
}
body.modal-open { overflow: hidden; }
::selection { background: var(--accent); color: #fff; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: 24px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--header-bg);
  color: var(--header-fg);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
}
.nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 9px;
  color: var(--header-muted); font-size: 14px; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.nav-link:hover { background: rgba(255, 255, 255, .09); color: var(--header-fg); }
.nav-link.is-active { color: var(--header-fg); font-weight: 600; background: rgba(255, 255, 255, .1); }
.nav-icon { padding: 8px; }
.lang-btn { min-width: 40px; justify-content: center; font-weight: 600; border: 1px solid rgba(255, 255, 255, .16); }
#themeBtn .ico-moon { display: none; }
html[data-theme="dark"] #themeBtn .ico-sun { display: none; }
html[data-theme="dark"] #themeBtn .ico-moon { display: block; }

/* ---------- Hero ---------- */
.hero { padding: clamp(48px, 7vw, 84px) 0 clamp(20px, 3vw, 32px); text-align: center; }
.hero-title {
  font-size: clamp(40px, 7vw, 68px);
  font-weight: 800; letter-spacing: -.03em; line-height: 1.02;
  margin-bottom: 20px;
}
.hero-lead {
  max-width: 640px; margin: 0 auto 30px;
  font-size: clamp(18px, 2.2vw, 23px); font-weight: 500;
  line-height: 1.45; color: var(--fg);
}
.hero-intro {
  max-width: 740px; margin: 0 auto;
  text-align: start;
  display: grid; gap: 14px;
  font-size: clamp(16px, 1.8vw, 18px);
  line-height: 1.75; color: var(--muted);
}
.hero-intro strong { color: var(--fg); font-weight: 700; }

/* ---------- Support / Why ---------- */
.support { padding: clamp(24px, 4vw, 40px) 0 clamp(56px, 8vw, 88px); }
.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: start; }
.section-title { font-size: clamp(20px, 2.4vw, 24px); font-weight: 700; letter-spacing: -.01em; margin-bottom: 16px; }
.support-list { display: grid; gap: 12px; }
.support-list li {
  position: relative; padding-inline-start: 26px;
  font-size: 15px; color: var(--muted); line-height: 1.6;
}
.support-list li::before {
  content: ""; position: absolute; inset-inline-start: 4px; top: 9px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.support-col p { font-size: 15px; color: var(--muted); line-height: 1.75; margin-bottom: 14px; }
.thanks { color: var(--fg) !important; font-weight: 600; }
.signature { display: flex; flex-direction: column; gap: 2px; margin-top: 20px; }
.signature-name { font-weight: 700; font-size: 15px; }
.signature-tagline { font-style: italic; font-size: 13.5px; color: var(--faint); }

/* ---------- Donation methods ---------- */
.methods { padding-bottom: clamp(20px, 3vw, 32px); }
.methods-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  max-width: 780px;
}
.method {
  display: flex; align-items: center; gap: 16px;
  text-align: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.method:hover { transform: translateY(-3px); border-color: var(--accent); }
.method:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.method:active { transform: translateY(-1px); }
.method-icon {
  flex: 0 0 48px; width: 48px; height: 48px; border-radius: 13px;
  display: grid; place-items: center;
  font-size: 24px; font-weight: 700; color: #fff;
  background: var(--coin, var(--accent));
}
.method-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.method-name { font-size: 16.5px; font-weight: 600; }
.method-sub { font-size: 13.5px; color: var(--muted); }
.method-arrow { margin-inline-start: auto; color: var(--faint); transition: transform .16s ease, color .16s ease; }
.method:hover .method-arrow { color: var(--accent); transform: translateX(3px); }
html[dir="rtl"] .method-arrow { transform: scaleX(-1); }
html[dir="rtl"] .method:hover .method-arrow { transform: scaleX(-1) translateX(3px); }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: clamp(48px, 6vw, 72px) 0 40px; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.footer-col h3 { font-size: 17px; font-weight: 700; margin-bottom: 18px; }
.footer-col li { margin-bottom: 12px; }
.footer-col a, .linklike { color: var(--muted); font-size: 14.5px; transition: color .15s ease; padding: 0; }
.footer-col a:hover, .linklike:hover { color: var(--accent); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px;
  margin-top: clamp(40px, 5vw, 64px); padding-top: 28px; border-top: 1px solid var(--border);
}
.made { font-size: 15px; color: var(--fg); }
.made .heart { color: #e11d48; }
.legal { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--faint); }
.legal a { color: var(--accent); font-weight: 500; }
.legal .dot { color: var(--faint); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.modal[hidden] { display: none; }
[hidden] { display: none !important; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(9, 16, 28, .55);
  opacity: 0; transition: opacity .18s ease;
}
.modal.is-open .modal-backdrop { opacity: 1; }
.modal-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-float);
  padding: 28px;
  opacity: 0; transform: translateY(12px) scale(.98);
  transition: opacity .18s ease, transform .18s ease;
}
.modal.is-open .modal-card { opacity: 1; transform: none; }
.modal-close {
  position: absolute; top: 14px; inset-inline-end: 14px;
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.modal-close:hover { background: var(--surface-2); color: var(--fg); }

/* donation modal specifics */
.dm-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; padding-inline-end: 30px; }
.dm-icon {
  flex: 0 0 52px; width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center; font-size: 26px; font-weight: 700; color: #fff;
  background: var(--coin, var(--accent));
}
.dm-title { font-size: 20px; font-weight: 700; }
.dm-network { font-size: 13px; color: var(--muted); }
.dm-qr {
  display: grid; place-items: center;
  background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 18px;
}
.dm-qr svg { width: 100%; max-width: 220px; height: auto; }
.dm-address {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 16px; overflow-x: auto;
}
.dm-addr {
  font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  font-size: 12.5px; line-height: 1.5; color: var(--fg);
  word-break: break-all; white-space: pre-wrap; direction: ltr; display: block;
}
.dm-actions { display: flex; gap: 10px; }
.dm-actions .btn { flex: 1; }
.dm-note { margin-top: 14px; font-size: 13px; color: var(--muted); text-align: center; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 11px; font-size: 14.5px; font-weight: 600;
  transition: background .15s ease, color .15s ease, transform .1s ease;
  border: 1px solid transparent;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary.is-done { background: var(--success); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: var(--surface-2); color: var(--fg); border-color: var(--border); }
.btn-ghost:hover { background: var(--border); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* docs modal */
.modal-docs {
  max-width: 620px; max-height: 86vh;
  display: flex; flex-direction: column;
  padding: 0; overflow: hidden;
}
.modal-docs .docs-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 24px 24px 12px;
  border-bottom: 1px solid var(--border);
}
.modal-docs .modal-close { position: static; flex: none; }
.docs-scroll {
  overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 24px 24px;
  scrollbar-width: thin;
}
.docs-title { flex: 1; font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 0; padding-top: 4px; }
.docs-lead { font-size: 15.5px; color: var(--muted); margin-bottom: 26px; }
.docs-block { margin-bottom: 24px; }
.docs-block h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.docs-block p { font-size: 14.5px; color: var(--muted); line-height: 1.7; }
.docs-features { display: grid; gap: 10px; }
.docs-features li {
  position: relative; padding-inline-start: 28px; font-size: 14.5px; color: var(--fg);
}
.docs-features li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 4px;
  width: 16px; height: 16px; border-radius: 5px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.docs-features li::after {
  content: ""; position: absolute; inset-inline-start: 4px; top: 8px;
  width: 6px; height: 3px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.docs-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin: 0; flex: none;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0 0 18px 18px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; inset-inline: 0; bottom: 24px; margin: 0 auto;
  width: fit-content; max-width: calc(100% - 32px);
  background: var(--fg); color: var(--bg);
  padding: 11px 18px; border-radius: 11px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-float); z-index: 120;
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-on { opacity: 1; transform: none; }
.toast.is-error { background: #b91c1c; color: #fff; }

/* ---------- Reveal ---------- */
[data-animate] { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
[data-animate].is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .header-inner { height: 56px; }
  .nav-link:not(.nav-icon):not(.lang-btn) { display: none; }
  .methods-grid { grid-template-columns: 1fr; }
  .support-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid .footer-col:first-child { grid-column: 1 / -1; }
}
@media (max-width: 460px) {
  .footer-grid { grid-template-columns: 1fr; }
  .modal { padding: 14px; }
  .modal-card:not(.modal-docs) { padding: 22px; }
  .modal-docs .docs-head { padding: 18px 16px 10px; }
  .docs-scroll { padding: 14px 16px 18px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  [data-animate] { opacity: 1; transform: none; }
}