/* ===========================================================
   Pidikili — Telugu Community Super-App
   Hand-written stylesheet (replaces inlined Tailwind build)
   =========================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Brand — Pidikili red (#E03E3E) */
  --pidikili-200: #f5b5b5;
  --pidikili-300: #ef8b8b;
  --pidikili-400: #e96363;
  --pidikili-500: #e03e3e;
  --pidikili-600: #c62f2f;
  --pidikili-700: #a52323;
  --pidikili-900: #6e1414;

  /* Leaf green */
  --leaf-50:  #f1faf0;
  --leaf-100: #dcf3d9;
  --leaf-500: #3f9142;
  --leaf-600: #317536;
  --leaf-700: #295e2d;

  /* Stone neutrals */
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;

  /* Brand tints (backgrounds / borders) */
  --orange-50:  #fef2f2;
  --orange-100: #fde2e2;
  --orange-200: #f7c9c9;
  --red-50:  #fef2f2;
  --red-100: #fee2e2;
  --red-200: #fecaca;
  --red-600: #dc2626;
  --red-800: #991b1b;

  --page-bg: #fffaf5;
  --ink: #2b1a10;

  --shadow-card: 0 4px 24px -6px rgba(122, 44, 16, .12);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,.25);

  --header-h: 64px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: 'Poppins', ui-sans-serif, system-ui, sans-serif;
  background: var(--page-bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
input { font: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.font-display { font-family: 'Baloo Tamma 2', 'Poppins', ui-sans-serif, sans-serif; }
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #fff1e6; }
::-webkit-scrollbar-thumb { background: #f2b088; border-radius: 8px; }

/* ---------- Layout ---------- */
.container {
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 640px) {
  .container { padding-inline: 1.5rem; }
}
.section { padding-block: 4rem; scroll-margin-top: 5rem; }
.band { background: #fff; border-top: 1px solid var(--orange-100); border-bottom: 1px solid var(--orange-100); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-weight: 600;
  border-radius: .75rem;
  padding: .5rem 1rem;
  font-size: .875rem;
  transition: background-color .15s, color .15s, transform .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }

.btn-primary { background: var(--pidikili-500); color: #fff; }
.btn-primary:hover { background: var(--pidikili-600); }

.btn-outline {
  background: #fff;
  color: var(--pidikili-700);
  border: 1px solid var(--pidikili-200);
}
.btn-outline:hover { background: var(--orange-50); }

.btn-danger { background: #fff; color: #b91c1c; border: 1px solid #fca5a5; }
.btn-danger:hover { background: #fef2f2; }
.btn-danger:disabled { opacity: .6; cursor: default; }

body.is-authed .js-login-btn { display: none !important; }

/* Profile icon + dropdown (logged-in header) */
.profile-menu { position: relative; }
.profile-icon {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--pidikili-200); background: #fff;
  font-size: 1.25rem; line-height: 1; cursor: pointer;
}
.profile-icon:hover { background: var(--orange-50); }
.profile-dropdown {
  position: absolute; right: 0; top: 52px;
  min-width: 210px; padding: .4rem; z-index: 60;
  background: #fff; border: 1px solid var(--pidikili-200);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14);
  display: flex; flex-direction: column;
}
.profile-name { margin: 0 0 .25rem; padding: .5rem .75rem; font-size: .9rem;
  color: var(--pidikili-700); border-bottom: 1px solid var(--orange-50); }
.profile-item { text-align: left; background: none; border: 0; cursor: pointer;
  padding: .6rem .75rem; border-radius: 8px; font: inherit; color: #333; }
.profile-item:hover { background: var(--orange-50); }
.profile-item-danger { color: #b91c1c; }
.profile-item-danger:hover { background: #fef2f2; }

/* Legal / policy pages */
.legal { max-width: 820px; }
.legal h3 { margin: 2rem 0 .5rem; color: var(--pidikili-700); font-size: 1.15rem; }
.legal .legal-meta { color: #666; margin: .15rem 0; font-size: .95rem; }
.legal p { line-height: 1.6; margin: .5rem 0; }
.legal ul { margin: .5rem 0 .5rem 1.25rem; line-height: 1.6; }
.legal li { margin: .3rem 0; }
.legal a { color: var(--pidikili-700); }

.btn-white { background: #fff; color: var(--pidikili-700); padding: .75rem 1.5rem; font-size: 1rem; }
.btn-ghost {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.4);
  color: #fff;
  padding: .75rem 1.5rem;
  font-size: 1rem;
}
.btn-ghost:hover { background: rgba(255,255,255,.2); }

.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--orange-100);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: 'Baloo Tamma 2', 'Poppins', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--pidikili-600);
}
.brand-mark { width: 1.9rem; height: 1.9rem; }
img.brand-mark { display: inline-block; }
.hero-logo { width: 100%; max-width: 24rem; height: auto; display: block; }

.main-nav { display: none; align-items: center; gap: .25rem; font-size: .875rem; }
.main-nav a {
  padding: .375rem .75rem;
  border-radius: .5rem;
  color: var(--pidikili-700);
  font-weight: 500;
  transition: background-color .15s;
}
.main-nav a:hover { background: var(--orange-50); }

.header-actions { display: none; align-items: center; gap: .75rem; }

.menu-btn { font-size: 1.5rem; padding-inline: .5rem; }

.mobile-menu {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding-bottom: 1rem;
  font-size: .875rem;
}
.mobile-menu a { padding: .5rem .75rem; border-radius: .5rem; transition: background-color .15s; }
.mobile-menu a:hover { background: var(--orange-50); }
.mobile-login { margin-top: .5rem; }

@media (min-width: 1024px) {
  .main-nav, .header-actions { display: flex; }
  .menu-btn, .mobile-menu { display: none; }
}

/* Auth area greeting (rendered by JS after login) */
.auth-greeting { font-size: .875rem; color: var(--stone-600); }
.auth-greeting strong { color: var(--stone-800); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(to bottom, var(--orange-50), #fff 60%, #fff);
}
.hero-blobs { position: absolute; inset: 0; pointer-events: none; opacity: .4; }
.blob {
  position: absolute;
  width: 24rem;
  height: 24rem;
  border-radius: 9999px;
  filter: blur(64px);
}
.blob-orange { top: -6rem; left: -6rem; background: var(--pidikili-300); }
.blob-leaf { top: 10rem; right: -6rem; background: var(--leaf-500); opacity: .2; }

.hero-grid {
  position: relative;
  display: grid;
  gap: 3rem;
  align-items: center;
  padding-top: 3.5rem;
  padding-bottom: 4rem;
}
@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr 1fr; padding-top: 5rem; padding-bottom: 6rem; }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .375rem .875rem;
  border-radius: 9999px;
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid var(--orange-200);
  background: #fff;
  margin-bottom: 1.25rem;
}
.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--stone-900);
  line-height: 1.25;
}
.hero-title .accent { color: var(--pidikili-500); }
.hero-subtitle { margin-top: .75rem; font-size: 1.125rem; font-weight: 500; color: var(--stone-600); }
.hero-lead { margin-top: 1.25rem; color: var(--stone-600); max-width: 32rem; }

.hero-cta { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }

.hero-stats {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: .875rem;
  color: var(--stone-500);
}
.stat-num { display: block; font-size: 1.5rem; font-weight: 700; color: var(--stone-800); }

@media (min-width: 640px) {
  .hero-title { font-size: 3rem; }
  .hero-subtitle { font-size: 1.25rem; }
}
@media (min-width: 1024px) {
  .hero-title { font-size: 3.75rem; }
}

/* Hero phone mockup */
.hero-phone-wrap { display: flex; justify-content: center; }
@media (min-width: 1024px) { .hero-phone-wrap { justify-content: flex-end; } }

.phone {
  position: relative;
  width: 16rem;
  border: 10px solid var(--stone-900);
  border-radius: 2.5rem;
  background: var(--stone-900);
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
  aspect-ratio: 9 / 19;
}
@media (min-width: 640px) { .phone { width: 18rem; } }

.phone-screen {
  height: 100%;
  width: 100%;
  background: linear-gradient(to bottom, var(--pidikili-500), var(--pidikili-700));
  display: flex;
  flex-direction: column;
  color: #fff;
}
/* Code-drawn app splash inside the phone frame (no image file needed) */
.splash-screen { position: relative; align-items: center; justify-content: center; overflow: hidden; }
.splash-blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,.09); }
.splash-blob-1 { width: 65%; aspect-ratio: 1; top: -12%; right: -12%; }
.splash-blob-2 { width: 55%; aspect-ratio: 1; bottom: -14%; left: -18%; }
.splash-card {
  position: relative; z-index: 1; text-align: center;
  padding: 2rem 1.5rem; border-radius: 1.5rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
}
/* Real logo pieces stacked on the red splash (all white artwork) */
.splash-fist { width: 5rem; height: auto; display: block; margin: 0 auto; }
.splash-word { width: 8.5rem; height: auto; display: block; margin: .9rem auto 0; }
.splash-tag  { width: 12rem; height: auto; display: block; margin: .7rem auto 0; }
.phone-statusbar {
  display: flex;
  justify-content: space-between;
  padding: .75rem 1rem 0;
  font-size: 10px;
  opacity: .8;
}
.phone-head { padding: 1.5rem 1.25rem 0; }
.phone-logo { font-size: 1.5rem; }
.phone-name { font-weight: 800; font-size: 1.25rem; margin-top: .25rem; }
.phone-greeting { font-size: .75rem; opacity: .8; margin-top: .125rem; }

.phone-cards {
  margin: 1.25rem 1rem 0;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  border-radius: 1rem;
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.phone-card {
  background: rgba(255,255,255,.95);
  color: var(--stone-800);
  border-radius: .75rem;
  padding: .5rem .75rem;
  font-size: .75rem;
  font-weight: 500;
  box-shadow: 0 1px 3px 0 rgba(0,0,0,.1);
}
.phone-tabbar {
  margin: auto 1rem .75rem;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .25rem;
  background: rgba(255,255,255,.1);
  border-radius: 1rem;
  padding: .5rem;
}
.phone-tabbar > div {
  text-align: center;
  font-size: .875rem;
  padding-block: .25rem;
  border-radius: .5rem;
}

/* ---------- Section heads ---------- */
.section-head { max-width: 42rem; margin-bottom: 2.5rem; }
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pidikili-900);
}
@media (min-width: 640px) { .section-title { font-size: 1.875rem; } }
.section-lead { color: var(--stone-600); margin-top: .5rem; max-width: 32rem; }

.split {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 1024px) { .split { grid-template-columns: 1fr 1fr; } }

.icon-tile {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: rgba(242, 96, 12, .1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* ---------- Generic card ---------- */
.card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--orange-100);
  padding: 1.25rem;
}
.card-title { font-weight: 600; color: var(--stone-800); font-size: .875rem; }
.card-note { font-size: .75rem; color: var(--stone-500); margin-top: .25rem; }

/* ---------- Feature grid ---------- */
.feature-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }

.feature-card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--orange-100);
  padding: 1.25rem;
  transition: transform .15s, box-shadow .15s;
}
.feature-card:hover { transform: translateY(-.125rem); box-shadow: var(--shadow-lg); }
.feature-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: .75rem;
  background: rgba(242, 96, 12, .1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: .75rem;
}
.feature-title { font-weight: 600; color: var(--stone-800); }
.feature-desc { font-size: .875rem; color: var(--stone-500); margin-top: .375rem; }

/* ---------- Blood spotlight ---------- */
.check-list { margin-top: 1.25rem; display: flex; flex-direction: column; gap: .5rem; font-size: .875rem; color: var(--stone-600); }
.check-list li { display: flex; align-items: center; gap: .5rem; }
.check { color: var(--leaf-600); }

.blood-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.blood-card {
  border-radius: 1rem;
  background: var(--red-50);
  border: 1px solid var(--red-100);
  padding: 1.25rem;
  text-align: center;
}
.blood-card-wide { grid-column: span 2; }
.blood-type { font-size: 1.875rem; font-family: 'Baloo Tamma 2', sans-serif; font-weight: 700; color: var(--red-600); }
.blood-note { font-size: .75rem; color: var(--stone-500); margin-top: .25rem; }
.blood-alert { font-size: .875rem; font-weight: 600; color: var(--stone-700); }

/* ---------- Popular People ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.chip {
  padding: .375rem .875rem;
  border-radius: 9999px;
  font-size: .875rem;
  font-weight: 500;
  background: #fff;
  border: 1px solid var(--orange-200);
  color: var(--stone-600);
}
.chip-active { background: var(--pidikili-500); color: #fff; border-color: var(--pidikili-500); }

.people-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .people-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .people-grid { grid-template-columns: repeat(3, 1fr); } }
.avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background: var(--pidikili-500);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-bottom: .75rem;
}

/* ---------- Groups ---------- */
.groups-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.group-card {
  border-radius: 1rem;
  background: var(--leaf-50);
  border: 1px solid var(--leaf-100);
  padding: 1.25rem;
}
.order-first { order: 2; }
.order-last { order: 1; }
@media (min-width: 1024px) {
  .order-first { order: 1; }
  .order-last { order: 2; }
}

/* ---------- Support ---------- */
.support-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .support-grid { grid-template-columns: repeat(3, 1fr); } }
.support-card { padding: 1.5rem; text-align: center; }
.support-emoji { font-size: 1.875rem; }
.support-card .card-title { margin-top: .5rem; }
.support-card .card-note { margin-top: .25rem; }

/* ---------- CTA ---------- */
.cta {
  background: linear-gradient(to bottom right, var(--pidikili-500), var(--pidikili-700));
  color: #fff;
}
.cta-inner { text-align: center; }
.cta .section-title { color: #fff; }
.cta-lead { margin: .75rem auto 0; max-width: 36rem; color: rgba(255,255,255,.9); }
.cta-actions { margin-top: 1.75rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .75rem; }
.cta code { background: rgba(255,255,255,.15); padding: .05rem .35rem; border-radius: .3rem; }

/* ---------- CORS banner ---------- */
.cors-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--red-600);
  color: #fff;
  font-size: .875rem;
}
.cors-inner { display: flex; align-items: center; gap: .75rem; padding-block: .625rem; }
.cors-icon { font-size: 1rem; }
.cors-text { flex: 1; }
.cors-close { flex-shrink: 0; border-radius: .5rem; padding: .25rem .5rem; font-weight: 600; }
.cors-close:hover { background: rgba(255,255,255,.1); }

/* ---------- Login modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay { position: absolute; inset: 0; background: rgba(28,25,23,.6); backdrop-filter: blur(4px); }
.modal-box {
  position: relative;
  background: #fff;
  border-radius: 1rem;
  box-shadow: var(--shadow-2xl);
  max-width: 24rem;
  width: 100%;
  padding: 1.5rem;
}
.modal-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  color: var(--stone-400);
  font-size: 1.25rem;
  padding-inline: .5rem;
}
.modal-close:hover { color: var(--stone-700); }
.modal-head { text-align: center; margin-bottom: 1.25rem; }
.modal-logo { font-size: 1.875rem; }
.modal-title { font-size: 1.25rem; font-weight: 700; color: var(--stone-900); margin-top: .25rem; }
.modal-endpoint { font-size: .875rem; color: var(--stone-500); margin-top: .25rem; }

.login-form { display: flex; flex-direction: column; gap: .75rem; }
.field label { font-size: .75rem; font-weight: 500; color: var(--stone-600); margin-bottom: .25rem; display: block; }
.link-btn { display: block; margin: .4rem 0 0 auto; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: .8rem; color: var(--pidikili-600); }
.link-btn:hover { text-decoration: underline; }
.field input {
  width: 100%;
  border-radius: .75rem;
  border: 1px solid var(--orange-200);
  padding: .625rem .875rem;
  font-size: .875rem;
  background: #fff;
}
.field input:focus {
  outline: none;
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--pidikili-400);
}
.login-form .btn-block { margin-top: .5rem; }

.alert { border-radius: .75rem; padding: .75rem 1rem; font-size: .875rem; }
.alert-error { border: 1px solid var(--red-200); background: var(--red-50); color: var(--red-800); }
.alert-success { border: 1px solid var(--leaf-100); background: var(--leaf-50); color: var(--leaf-700); }
.alert-warn { border: 1px solid #fcd34d; background: #fffbeb; color: #92400e; line-height: 1.5; margin-bottom: 1rem; }

.modal-foot { font-size: .75rem; color: var(--stone-400); margin-top: 1rem; text-align: center; }

/* ---------- Footer ---------- */
.site-footer { background: var(--stone-900); color: var(--stone-300); }
.footer-grid {
  display: grid;
  gap: 2.5rem;
  padding-block: 3.5rem 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; } }
.footer-brand-col { max-width: 24rem; }
.footer-brand {
  font-size: 1.375rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.footer-tag { font-size: .9rem; margin-top: .35rem; color: var(--stone-400); }
.footer-desc { font-size: .875rem; margin-top: 1rem; color: var(--stone-400); line-height: 1.6; }
.footer-social { display: flex; gap: .625rem; margin-top: 1.5rem; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08); color: var(--stone-300);
  font-size: 1rem; text-decoration: none; transition: background .15s, color .15s;
}
.footer-social a:hover { background: rgba(255,255,255,.16); color: #fff; }
.footer-heading {
  font-weight: 700; color: #fff; font-size: .8rem;
  letter-spacing: .08em; text-transform: uppercase; margin-bottom: 1rem;
}
.footer-list { font-size: .9rem; color: var(--stone-400); display: flex; flex-direction: column; gap: .7rem; list-style: none; }
.footer-list a { color: var(--stone-400); text-decoration: none; transition: color .15s; }
.footer-list a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding-block: 1.5rem; }
.footer-copy { font-size: .85rem; color: var(--stone-400); }
