/* =======================================================================
   WARD SURVEY — Modern theme
   Palette:
     --primary      : #4F46E5  (indigo)
     --primary-dark : #3B32B0
     --violet       : #7C3AED
     --pink         : #DB2777
     --cyan         : #06B6D4
     --amber        : #F59E0B
     --bg           : #F4F5FB
     --surface      : #FFFFFF
     --text         : #1C1B29
     --muted        : #6B7280
   Type:
     Heading/body : 'Inter'
     Hindi text   : 'Noto Sans Devanagari'
   Signature element: soft gradient top-accent cards, glow buttons,
   a vivid gradient hero band for the public survey.
   ======================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+Devanagari:wght@400;500;600;700&display=swap');

:root {
  --primary: #4F46E5;
  --primary-dark: #3B32B0;
  --violet: #7C3AED;
  --pink: #DB2777;
  --cyan: #06B6D4;
  --amber: #F59E0B;
  --amber-light: #FCD34D;
  --bg: #F4F5FB;
  --surface: #FFFFFF;
  --surface-alt: #F8F8FD;
  --text: #1C1B29;
  --muted: #6B7280;
  --border: #E7E7F3;
  --success: #16A34A;
  --success-bg: #E9F9EF;
  --danger: #DC2626;
  --danger-bg: #FDECEC;
  --shadow-sm: 0 2px 8px rgba(31, 27, 71, 0.06);
  --shadow: 0 12px 32px rgba(43, 33, 110, 0.12);
  --shadow-lg: 0 20px 48px rgba(43, 33, 110, 0.18);
  --radius: 18px;
  --radius-sm: 12px;
  --font-head: 'Inter', 'Noto Sans Devanagari', sans-serif;
  --font-body: 'Noto Sans Devanagari', 'Inter', sans-serif;
  --gradient-brand: linear-gradient(135deg, var(--primary) 0%, var(--violet) 55%, var(--pink) 100%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; color: var(--text); margin: 0 0 .5em; letter-spacing: -0.01em; }

/* ---------- Top gradient accent strip ---------- */
.mandana-strip {
  height: 5px;
  width: 100%;
  background: var(--gradient-brand);
}

/* ---------- Top navigation ---------- */
.topbar {
  background: #4F46E5;
  color: #fff;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.topbar .brand .brand-icon {
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: rgba(255,255,255,0.18);
  box-shadow: none;
}
.topbar .brand .brand-icon svg { width: 22px; height: 22px; }
.topbar .brand .brand-icon path { fill: #fff; }
.topbar .brand .brand-icon circle { fill: #fff; opacity: .55; }

.topbar nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.topbar nav a, .topbar nav .who {
  color: rgba(255,255,255,0.85);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 10px;
  transition: background .15s, color .15s;
}
.topbar nav a:hover { background: rgba(255,255,255,0.16); color: #fff; }
.topbar nav .who { color: #fff; background: rgba(255,255,255,0.14); }
.topbar nav a.logout { background: #fff; color: #4F46E5; font-weight: 700; }
.topbar nav a.logout:hover { background: #F4F5FB; color: #3B32B0; }

/* ---------- Page shell ---------- */
.page-wrap { max-width: 1180px; margin: 0 auto; padding: 40px 20px 60px; }
.page-wrap.narrow { max-width: 760px; }

.page-head { margin-bottom: 32px; text-align: center; }
.page-head .eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 12.5px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #EEF0FF, #FCE7F3);
  padding: 5px 14px;
  border-radius: 999px;
}
.page-head h1 { font-size: 32px; }
.page-head p.sub { color: var(--muted); margin-top: 8px; font-size: 15.5px; }

/* ---------- Main card (used for forms / dashboards) ---------- */
.jharokha {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 38px 36px;
  position: relative;
  overflow: hidden;
}
.jharokha::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--gradient-brand);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 26px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14.5px;
  border: none;
  border-radius: 11px;
  padding: 13px 24px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .2s, filter .15s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--gradient-brand); color: #fff; box-shadow: 0 8px 20px rgba(79,70,229,0.35); }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 10px 26px rgba(79,70,229,0.45); color: #fff; }
.btn-gold { background: linear-gradient(135deg, var(--amber-light), var(--amber)); color: #4A2E00; box-shadow: 0 8px 20px rgba(245,158,11,0.3); }
.btn-gold:hover { filter: brightness(1.05); color: #4A2E00; }
.btn-outline { background: var(--surface); color: var(--primary); border: 2px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); background: var(--surface-alt); color: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; color: #fff; }
.btn-sm { padding: 8px 15px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; margin-bottom: 7px; font-size: 14.5px; color: var(--text); }
.field { margin-bottom: 20px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

input[type=text], input[type=tel], input[type=password], input[type=number], textarea, select {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font-body);
  background: var(--surface-alt);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79,70,229,0.12);
  background: #fff;
}
textarea { resize: vertical; min-height: 90px; }

fieldset { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 20px 20px 8px; margin: 0 0 22px; background: var(--surface-alt); }
legend { font-family: var(--font-head); font-weight: 700; color: var(--primary); padding: 0 10px; font-size: 15px; }

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.checkbox-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.checkbox-item input { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }
.checkbox-item.checked { border-color: var(--primary); background: #EEF0FF; }

.filled-by-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #EEF0FF, #FCE7F3);
  border: 1.5px solid var(--primary);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  margin-bottom: 24px;
}

/* ---------- Tables / list ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  background: var(--surface-alt);
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 700;
  text-align: left;
  padding: 14px 16px;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:hover { background: var(--surface-alt); }
.tag { display: inline-block; background: var(--surface-alt); color: var(--text); font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; margin: 2px 3px 0 0; border: 1px solid var(--border); }
.tag.pink { background: #FDF2F8; color: var(--pink); border-color: #FBCFE8; }
.badge-source { font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: 999px; text-transform: uppercase; letter-spacing: .5px; }
.badge-source.employee { background: var(--success-bg); color: var(--success); }
.badge-source.public { background: #FDF2F8; color: var(--pink); }

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 24px; border: 1px solid var(--border); text-align: center; position: relative; overflow: hidden;
}
.stat-card::before { content:""; position:absolute; top:0; left:0; right:0; height:4px; background: var(--gradient-brand); }
.stat-card .num { font-family: var(--font-head); font-size: 36px; font-weight: 800; background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-card .lbl { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 6px; }

/* ---------- Alerts ---------- */
.alert { padding: 15px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 14.5px; font-weight: 500; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #BBF0CE; }
.alert-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #F5C2C2; }

/* ---------- Login screen ---------- */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 15% 15%, rgba(79,70,229,0.14), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(219,39,119,0.14), transparent 45%),
    var(--bg);
  padding: 20px;
}
.login-card { width: 100%; max-width: 400px; }
.login-card .logo-arch {
 width: 74px;
    height: 74px;
    margin: 0 auto 16px;
    background-color: #ffffff;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
    box-shadow: 0 2px 7px rgba(79, 70, 229, 0.4);
}
.login-card h1 { text-align: center; font-size: 22px; }
.login-card p.sub { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 28px; }

/* ---------- Public survey hero ---------- */
.hero-band {
  background: var(--gradient-brand);
  color: #fff;
  text-align: center;
  padding: 58px 20px 100px;
  position: relative;
  overflow: hidden;
}
.hero-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.16), transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(255,255,255,0.12), transparent 40%);
}
.hero-band .eyebrow { position: relative; color: #fff; letter-spacing: 3px; font-weight: 700; font-size: 12.5px; text-transform: uppercase; background: rgba(255,255,255,0.18); padding: 6px 16px; border-radius: 999px; }
.hero-band h1 { position: relative; color: #fff; font-family: var(--font-head); font-size: 38px; font-weight: 800; margin-top: 14px; letter-spacing: -0.02em; }
.hero-band p { position: relative; color: rgba(255,255,255,0.88); max-width: 560px; margin: 14px auto 0; }
.hero-band .form-shell { margin-top: -66px; position: relative; }

.footer-note { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 44px; padding-bottom: 24px; }

@media (max-width: 640px) {
  .topbar { flex-direction: column; gap: 12px; align-items: flex-start; padding: 14px 20px; }
  .jharokha { padding: 26px 20px; border-radius: 16px; }
  .page-head h1 { font-size: 24px; }
  .hero-band h1 { font-size: 28px; }
  .hero-band { padding: 46px 18px 84px; }
}
