/* =========================================================
   YNC Association — Shared design system
   ========================================================= */

:root {
  /* Palette drawn from the official YNC (Yadaiah Nagar Colony Welfare
     Association) emblem: navy ink, deep & sky blue, teal, orange, crimson. */
  --brand: #1b5fa8;
  --brand-dark: #142e4a;
  --brand-light: #2ea7d9;
  --brand-tint: #e8f1fa;
  --accent: #ef7a2e;
  --accent-dark: #c25c1a;
  --accent-tint: #fdf0e2;
  --teal: #14a488;
  --teal-tint: #e4f6f1;
  --bg: #f6f8f9;
  --surface: #ffffff;
  --text: #1c2b3d;
  --text-muted: #5b6b7a;
  --border: #e1e6e9;
  --border-strong: #c9d2d8;
  --danger: #d1443b;
  --danger-tint: #fbeae8;
  --success: #14a488;
  --success-tint: #e4f6f1;
  --warning: #b7791f;
  --warning-tint: #fdf3e0;
  --info: #2ea7d9;
  --info-tint: #e7f2fa;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(15, 40, 35, 0.08);
  --shadow: 0 6px 20px rgba(15, 40, 35, 0.10);
  --shadow-lg: 0 16px 40px rgba(15, 40, 35, 0.16);
  --maxw: 1180px;
  font-size: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: "Poppins", "Inter", sans-serif;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--brand-dark);
}
h1 { font-size: clamp(1.9rem, 3vw, 2.6rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; color: var(--text); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul { padding-left: 1.2em; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--maxw);
  margin: 0 auto;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--brand-dark);
}
.brand .logo-badge {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.brand small { display: block; font-weight: 500; font-size: 0.7rem; letter-spacing: .03em; color: var(--accent-dark); text-transform: uppercase; }
.footer-brand-logo { width: 44px; height: 44px; border-radius: 50%; background: #fff; padding: 2px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.94rem;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
}
.nav-links a:hover, .nav-links a.active { background: var(--brand-tint); color: var(--brand-dark); }

.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 110%; left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  min-width: 200px;
  padding: 6px;
  z-index: 50;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a { display: block; padding: 8px 10px; border-radius: 6px; }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--border); border-radius: 8px;
  width: 40px; height: 40px; font-size: 1.2rem; cursor: pointer;
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding: 8px 0;
    border-top: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-dropdown-menu { position: static; box-shadow: none; border: none; display: none; padding-left: 12px; }
  .nav-dropdown.open .nav-dropdown-menu { display: block; }
  .nav-bar { flex-wrap: wrap; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .06s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn-outline:hover { background: var(--brand-tint); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: #f1efe6; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(circle at 15% 20%, rgba(239,122,46,0.14), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(27,95,168,0.14), transparent 40%),
    linear-gradient(180deg, #fff 0%, var(--bg) 100%);
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
}
.hero .eyebrow {
  display: inline-block;
  background: var(--accent-tint); color: var(--accent-dark);
  font-weight: 700; font-size: 0.78rem; letter-spacing: .04em; text-transform: uppercase;
  padding: 6px 14px; border-radius: 999px; margin-bottom: 16px;
}
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
.hero p.lead { font-size: 1.1rem; color: var(--text-muted); max-width: 46ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.hero-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; box-shadow: var(--shadow);
}

/* ---------- Sections / Cards ---------- */
section.section { padding: 56px 0; }
section.section.tight { padding: 32px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head p { margin: 4px 0 0; color: var(--text-muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card-hover { transition: transform .15s ease, box-shadow .15s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stat-card { text-align: center; padding: 24px; }
.stat-card .num { font-family: "Poppins", sans-serif; font-size: 2.1rem; font-weight: 800; color: var(--brand); }
.stat-card .label { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }

/* ---------- Badges / tags ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.76rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
}
.badge-open, .badge-pending { background: var(--warning-tint); color: var(--warning); }
.badge-in_progress { background: var(--info-tint); color: var(--info); }
.badge-resolved, .badge-approved { background: var(--success-tint); color: var(--success); }
.badge-closed, .badge-rejected { background: #efece2; color: var(--text-muted); }
.badge-cat { background: var(--brand-tint); color: var(--brand-dark); }
.badge-priority-high { background: var(--danger-tint); color: var(--danger); }
.badge-priority-medium { background: var(--warning-tint); color: var(--warning); }
.badge-priority-low { background: #eef2ee; color: var(--text-muted); }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; color: var(--text); }
.field { margin-bottom: 18px; }
.field-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="number"], input[type="date"], input[type="url"], select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint);
}
.radio-group, .check-group { display: flex; gap: 18px; flex-wrap: wrap; }
.radio-group label, .check-group label { font-weight: 500; display: flex; align-items: center; gap: 6px; }
fieldset { border: none; padding: 0; margin: 0; }

/* ---------- Alerts / toast ---------- */
.alert {
  padding: 13px 16px; border-radius: var(--radius-sm); font-size: 0.92rem; margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-success { background: var(--success-tint); color: var(--success); border-color: #c9ecd6; }
.alert-error { background: var(--danger-tint); color: var(--danger); border-color: #f4d3ce; }
.alert-info { background: var(--info-tint); color: var(--info); border-color: #cbe4f3; }
.alert[hidden] { display: none; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 560px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #f4f1e9; font-weight: 700; color: var(--brand-dark); font-size: 0.8rem; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-dark); color: #d9e8e4; padding: 44px 0 24px; margin-top: 64px; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { color: #fff; font-size: 0.95rem; margin-bottom: 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; font-size: 0.9rem; }
.footer-bottom { text-align: center; margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.14); font-size: 0.82rem; color: #a9c4be; }

/* ---------- Misc utility ---------- */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; }
.pill-tab {
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border); background: #fff;
  font-weight: 600; font-size: 0.88rem; cursor: pointer; color: var(--text);
}
.pill-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 2.4rem; margin-bottom: 10px; }
.avatar-circle {
  width: 46px; height: 46px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
}
.divider { height: 1px; background: var(--border); margin: 24px 0; border: none; }
.skeleton { background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Login gate card shown to logged-out users on protected pages */
.gate-card { max-width: 440px; margin: 60px auto; text-align: center; }
.gate-card .icon { font-size: 2.6rem; margin-bottom: 12px; }

/* Photo gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gallery-grid img { width: 100%; height: 150px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.gallery-caption { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,25,22,0.5); display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius); max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto; padding: 26px; box-shadow: var(--shadow-lg); }
