/* Public homepage. Meta ka App Review reviewer sabse pehle YAHI dekhta hai —
   isliye product ka kaam aur permissions ka justification saaf dikhna chahiye,
   bina login ke. */

:root {
  --bg: #ffffff;
  --ink: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft: #f8fafc;
  --accent: #1877f2;
  --accent-dark: #145dbf;
  --ok: #16a34a;
  --bad: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 16px/1.7 ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--ink); }

/* ── Nav ────────────────────────────────────────────────── */

.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: #fffffff2;
  backdrop-filter: blur(8px); z-index: 10;
}
.logo { font-weight: 800; font-size: 19px; color: var(--ink); text-decoration: none; letter-spacing: -.3px; }
.nav nav { display: flex; align-items: center; gap: 22px; }
.nav nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav nav a:hover { color: var(--ink); }
.btn-sm {
  background: var(--accent); color: #fff !important; padding: 8px 18px;
  border-radius: 8px; font-weight: 600;
}
.btn-sm:hover { background: var(--accent-dark); }

/* ── Hero ───────────────────────────────────────────────── */

.hero { max-width: 780px; margin: 0 auto; padding: 76px 24px 60px; text-align: center; }
.hero h1 { font-size: 46px; line-height: 1.15; margin: 0 0 20px; letter-spacing: -1.2px; }
.lead { font-size: 19px; color: var(--body); margin: 0 auto 30px; max-width: 620px; }

.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.btn {
  display: inline-block; padding: 13px 30px; border-radius: 10px;
  font-weight: 600; text-decoration: none;
  background: var(--accent); color: #fff;
}
.btn:hover { background: var(--accent-dark); }
.btn.ghost { background: var(--soft); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #eef2f7; }

.note {
  font-size: 14.5px; color: var(--muted);
  max-width: 560px; margin: 0 auto; padding: 14px 18px;
  background: var(--soft); border: 1px solid var(--line); border-radius: 10px;
}

/* ── Sections ───────────────────────────────────────────── */

section { padding: 56px 24px; }

/* Operating-company block. Meta ki Tech Provider verification maangti hai
   ki service dene wali company site par hi saaf dikhe. */
.company { background: var(--soft); border-top: 1px solid var(--line); }
.company .box {
  max-width: 720px; margin: 0 auto; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; padding: 26px 24px;
}
.company .box p { margin: 0 0 20px; font-size: 15px; }
.company dl {
  margin: 0; display: grid; grid-template-columns: 140px 1fr;
  gap: 10px 18px; font-size: 15px;
}
.company dt { color: var(--muted); }
.company dd { margin: 0; }
@media (max-width: 560px) {
  .company dl { grid-template-columns: 1fr; gap: 2px 0; }
  .company dt { margin-top: 12px; }
}
section > h2 { font-size: 28px; text-align: center; margin: 0 0 40px; letter-spacing: -.5px; }

.flow { background: var(--soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; max-width: 1020px; margin: 0 auto; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

.step { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px 24px; }
.step .num {
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; background: var(--accent); color: #fff;
  font-weight: 700; font-size: 15px; margin-bottom: 14px;
}
.step h3 { font-size: 17px; margin: 0 0 8px; }
.step p { margin: 0; font-size: 15px; }

/* ── Does / does not ────────────────────────────────────── */

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 1020px; margin: 0 auto; }
@media (max-width: 800px) { .cols { grid-template-columns: 1fr; } }

.col { border: 1px solid var(--line); border-radius: 14px; padding: 26px 24px; }
.col h3 { font-size: 17px; margin: 0 0 14px; display: flex; align-items: center; gap: 9px; }
.col h3::before {
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  font-size: 14px; font-weight: 700; color: #fff;
}
.col.yes h3::before { content: '✓'; background: var(--ok); }
.col.no  h3::before { content: '✕'; background: var(--bad); }
.col.yes { background: #f6fdf8; border-color: #bbf7d0; }
.col.no  { background: #fef7f7; border-color: #fecaca; }
.col ul { margin: 0; padding-left: 20px; }
.col li { margin-bottom: 8px; font-size: 15px; }

/* ── Who ────────────────────────────────────────────────── */

.who { max-width: 780px; margin: 0 auto; }
.who > p { font-size: 16.5px; }

.callout {
  margin-top: 26px; padding: 20px 22px;
  background: #fffbeb; border: 1px solid #fde68a;
  border-left: 3px solid #d97706; border-radius: 10px;
}
.callout strong { color: #92400e; display: block; margin-bottom: 6px; }
.callout p { margin: 0; font-size: 15px; }

/* ── Permissions ────────────────────────────────────────── */

.perms { background: var(--soft); border-top: 1px solid var(--line); }
.perms table {
  width: 100%; max-width: 900px; margin: 0 auto 20px;
  border-collapse: collapse; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.perms th, .perms td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 15px; }
.perms th { background: #f1f5f9; font-weight: 600; color: var(--ink); }
.perms tr:last-child td { border-bottom: none; }
.perms code { background: #eef2f7; padding: 3px 8px; border-radius: 5px; font-size: 13.5px; white-space: nowrap; }
.perms .note { max-width: 900px; }

/* ── Footer ─────────────────────────────────────────────── */

footer { border-top: 1px solid var(--line); padding: 26px 24px; }
.foot-in {
  max-width: 1020px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  color: var(--muted); font-size: 14.5px;
}
.foot-in nav { display: flex; gap: 20px; flex-wrap: wrap; }
.foot-in a { color: var(--muted); text-decoration: none; }
.foot-in a:hover { color: var(--ink); }

/* ── About page ─────────────────────────────────────────── */

.hero.narrow { padding: 56px 24px 32px; }
.hero.narrow h1 { font-size: 38px; }

.prose { max-width: 760px; margin: 0 auto; padding: 40px 24px; }
.prose h2 { font-size: 25px; margin: 40px 0 14px; letter-spacing: -.4px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 17.5px; margin: 28px 0 8px; }
.prose p { font-size: 16.5px; margin: 0 0 14px; }
.prose > .muted { font-size: 14.5px; color: var(--muted); }

.rules { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 14px; }
.rules li {
  padding: 16px 18px; background: var(--soft);
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 10px; font-size: 15.5px;
}
.rules b { color: var(--ink); }

.callout.warn { background: #fffbeb; border-color: #fde68a; border-left-color: #d97706; }
.callout.warn strong { color: #92400e; }

table.cmp {
  width: 100%; border-collapse: collapse; margin: 0 0 16px;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  font-size: 15px;
}
table.cmp th, table.cmp td { text-align: left; padding: 12px 15px; border-bottom: 1px solid var(--line); }
table.cmp th { background: #f1f5f9; font-weight: 600; color: var(--ink); width: 50%; }
table.cmp td:first-child { border-right: 1px solid var(--line); }
table.cmp tr:last-child td { border-bottom: none; }

/* Diagrams */
.figure-band { background: var(--soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.figure-band.alt { background: #fff; }
.figure { max-width: 960px; margin: 0 auto; }
.figure svg {
  width: 100%; height: auto; display: block;
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 14px;
}
.figure-band.alt .figure svg { background: var(--soft); }
.fig-cap {
  text-align: center; font-size: 14px; color: var(--muted);
  margin: 14px auto 0; max-width: 620px;
}

@media (max-width: 640px) {
  .hero.narrow h1 { font-size: 29px; }
  .prose { padding: 28px 18px; }
  .prose h2 { font-size: 21px; }
  .prose p { font-size: 15.5px; }
  table.cmp { font-size: 13.5px; }
  table.cmp th, table.cmp td { padding: 9px 10px; }
}

/* ── Signup modal ───────────────────────────────────────────
   Shown only when homepage signup is switched on for an
   organisation; the buttons stay hidden otherwise. */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .55);
  overflow-y: auto;
}
.modal[hidden] { display: none; }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  border-radius: 16px;
  padding: 32px 28px 24px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .3);
  margin: auto;
}
.modal-card h2 { margin: 0 0 6px; font-size: 24px; color: var(--ink); }
.modal-sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }

.modal-x {
  position: absolute;
  top: 12px; right: 14px;
  background: none; border: 0;
  font-size: 28px; line-height: 1;
  color: var(--muted); cursor: pointer;
  padding: 4px 8px; border-radius: 8px;
}
.modal-x:hover { background: var(--soft); color: var(--ink); }

.modal-card label {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.modal-card input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 13px;
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.modal-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, .15);
}
.modal-card .hint {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

#su-submit {
  width: 100%;
  margin-top: 6px;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}
#su-submit:hover { background: var(--accent-dark); }
#su-submit:disabled { opacity: .6; cursor: default; }

.su-msg { display: none; margin: 0 0 16px; padding: 10px 13px; border-radius: 9px; font-size: 14px; }
.su-msg.show { display: block; }
.su-msg.err  { background: #fef2f2; color: var(--bad); }
.su-msg.ok   { background: #f0fdf4; color: var(--ok); }
.su-msg.info { background: var(--soft); color: var(--muted); }

.modal-foot {
  margin: 18px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  text-align: center;
}
.modal-foot a { color: var(--accent); text-decoration: none; }
.modal-foot a:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .modal { padding: 0; }
  .modal-card { max-width: none; min-height: 100%; border-radius: 0; padding-top: 48px; }
}
