/* ── Variables ── */
:root {
  --blue:        #00A1DE;
  --blue-dark:   #0080B3;
  --blue-light:  #E6F6FD;
  --yellow:      #FAD201;
  --green:       #008751;
  --bg:          #FFFFFF;
  --surface:     #F7F9FA;
  --text:        #1A1A1A;
  --muted:       #555555;
  --border:      #E5E5E5;
  --error:       #C0001A;
  --radius:      6px;
  --max-w:       1100px;
  --chat-max-w:  720px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}
img, svg { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

/* ── Layout ── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); text-decoration: none; color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}
.btn-outline:hover { background: var(--blue-light); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  padding: 0 20px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.nav-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  margin-right: auto;
}
.nav-brand:hover { text-decoration: none; color: var(--blue-dark); }
.nav-cta {
  padding: 8px 18px;
  font-size: 0.92rem;
}
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-menu {
  display: none;
  flex-direction: column;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  gap: 4px;
}
.nav-menu.open { display: flex; }
.nav-link {
  display: block;
  padding: 8px 4px;
  color: var(--text);
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: var(--radius);
}
.nav-link:hover { color: var(--blue); text-decoration: none; }
.nav-link.active { color: var(--blue); font-weight: 600; }

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}
.lang-active {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}
.lang-sep { color: var(--border); }
.lang-inactive {
  color: #bbb;
  cursor: not-allowed;
  user-select: none;
}

@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .nav-menu {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    padding: 0;
    border-top: none;
    gap: 4px;
  }
  .nav-link { padding: 6px 10px; font-size: 0.9rem; }
  .lang-toggle {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    margin-left: 8px;
    padding-left: 12px;
    border-left: 1px solid var(--border);
  }
}

/* ── Footer ── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 32px 20px;
  margin-top: 60px;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.footer-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 12px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 16px;
}
.footer-links a {
  font-size: 0.88rem;
  color: var(--muted);
}
.footer-links a:hover { color: var(--blue); }
.footer-legal {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 8px;
}
.footer-copy {
  font-size: 0.82rem;
  color: #999;
}

/* ── Hero (Home) ── */
.hero {
  background: var(--surface);
  padding: 52px 20px 48px;
  text-align: center;
}
.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  max-width: 600px;
  margin: 0 auto 14px;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 28px;
}
.hero-ctas {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
@media (min-width: 480px) {
  .hero h1 { font-size: 2.4rem; }
  .hero-ctas { flex-direction: row; justify-content: center; }
}

/* ── Section headings ── */
.section { padding: 48px 20px; }
.section-alt { background: var(--surface); }
.section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 28px;
  color: var(--text);
}

/* ── Channel cards ── */
.channel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 480px) { .channel-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .channel-grid { grid-template-columns: repeat(5, 1fr); } }

.channel-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 16px;
  text-align: center;
}
.channel-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue);
}
.channel-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.channel-card p { font-size: 0.88rem; color: var(--muted); line-height: 1.4; }
.channel-card .placeholder {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.8rem;
  color: #aaa;
  font-style: italic;
}

/* ── Features (3 statements) ── */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 640px) { .features-grid { grid-template-columns: repeat(3, 1fr); } }
.feature-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.feature-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: 8px;
}
.feature-item p { font-size: 0.95rem; line-height: 1.55; }

/* ── Topic cards (Rights) ── */
.topic-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) { .topic-grid { grid-template-columns: 1fr 1fr; } }

.topic-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.topic-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.topic-card p  { font-size: 0.9rem; color: var(--muted); flex: 1; margin-bottom: 14px; }
.topic-card a  { font-size: 0.9rem; font-weight: 600; color: var(--blue); }

/* ── Topic page ── */
.topic-page { max-width: 700px; margin: 0 auto; padding: 40px 20px; }
.topic-page h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 6px; }
.topic-page .subtitle { color: var(--muted); margin-bottom: 24px; }
.topic-page .summary {
  background: var(--blue-light);
  border-left: 4px solid var(--blue);
  padding: 14px 18px;
  border-radius: 4px;
  margin-bottom: 28px;
  font-size: 1rem;
  line-height: 1.6;
}
.topic-page h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 14px; margin-top: 28px; }
.topic-page ul { display: flex; flex-direction: column; gap: 10px; }
.topic-page ul li {
  padding-left: 16px;
  position: relative;
  font-size: 0.95rem;
  line-height: 1.6;
}
.topic-page ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}
.actions-list { counter-reset: action; }
.actions-list li {
  padding-left: 36px;
  counter-increment: action;
}
.actions-list li::before {
  content: counter(action);
  width: 22px;
  height: 22px;
  background: var(--blue);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 6px;
}
.topic-cta {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
@media (min-width: 480px) { .topic-cta { flex-direction: row; } }

/* ── Complaint page ── */
.steps-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px; }
.step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.step p { font-size: 0.95rem; line-height: 1.55; }

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.search-bar input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
}
.search-bar input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(0,161,222,0.15); }

.district-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.district-table th {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.district-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.district-table tr:last-child td { border-bottom: none; }
.district-row[hidden] { display: none; }
.no-results { padding: 20px 0; color: var(--muted); font-size: 0.92rem; display: none; }
.pending { color: #aaa; font-style: italic; font-size: 0.88rem; }

.mifotra-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-top: 8px;
}
.mifotra-box p { margin-bottom: 6px; font-size: 0.95rem; }
.mifotra-box a { color: var(--blue); }

.print-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius);
}
.print-btn:hover { background: var(--surface); }

/* ── Partners cards ── */
.partner-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 32px;
}
@media (min-width: 640px) { .partner-grid { grid-template-columns: repeat(3, 1fr); } }
.partner-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}
.partner-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; color: var(--blue); }
.partner-card p { font-size: 0.9rem; color: var(--muted); line-height: 1.5; }

/* ── Privacy / About prose ── */
.prose-page { max-width: 700px; margin: 0 auto; padding: 40px 20px; }
.prose-page h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 28px; }
.prose-page h2 { font-size: 1.1rem; font-weight: 700; margin-top: 28px; margin-bottom: 10px; color: var(--text); }
.prose-page p { font-size: 0.95rem; line-height: 1.65; margin-bottom: 14px; }
.prose-page ul { padding-left: 20px; list-style: disc; display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.prose-page ul li { font-size: 0.95rem; line-height: 1.6; }
.prose-page .highlight {
  background: var(--blue-light);
  border-left: 4px solid var(--blue);
  padding: 14px 18px;
  border-radius: 4px;
  font-size: 0.95rem;
  margin-bottom: 14px;
}

/* ── Language picker ── */
.lang-pick-card {
  background: #fff;
  width: 100%;
  max-width: 540px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 40px 24px 44px;
  text-align: center;
}
.lang-pick-prompt {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--muted);
  margin-bottom: 32px;
}
.lang-pick-prompt strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}
.lang-pick-btns {
  display: flex;
  gap: 12px;
}
.lang-btn {
  flex: 1;
  padding: 18px 8px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  line-height: 1.2;
}
.lang-btn:hover,
.lang-btn:focus {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
  outline: none;
}

/* ── Chat & Profile (/talk) ── */
.talk-wrap {
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 48px;
}

/* Profile screen */
.profile-card {
  background: #fff;
  width: 100%;
  max-width: 540px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 28px 24px 32px;
}
.profile-card h1 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.profile-card .sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 20px;
}
.privacy-notice {
  background: var(--blue-light);
  border-left: 4px solid var(--blue);
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 22px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #1a3a5c;
}
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}
.req { color: var(--error); margin-left: 2px; }
.opt { font-weight: 400; color: #999; font-size: 0.82rem; margin-left: 4px; }
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  appearance: auto;
}
.form-group select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(0,161,222,0.15); }
.form-group.error label { color: var(--error); }
.form-group.error select { border-color: var(--error); background: #fff8f8; }
.form-divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.optional-label { font-size: 0.8rem; color: #999; margin-bottom: 12px; margin-top: -4px; }
#startBtn { width: 100%; margin-top: 22px; }

/* Chat window */
.chat-page {
  width: 100%;
  max-width: var(--chat-max-w);
}
.chat-header { margin-bottom: 16px; }
.chat-header h1 { font-size: 1.35rem; font-weight: 700; }
.chat-header p  { font-size: 0.9rem; color: var(--muted); margin-top: 4px; }
.privacy-line {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 6px;
}

.chat-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.messages {
  height: 440px;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.msg {
  max-width: 84%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.93rem;
  line-height: 1.6;
}
.msg.rislii {
  background: var(--surface);
  align-self: flex-start;
  border-bottom-left-radius: 3px;
}
.msg.user {
  background: var(--blue);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}
.msg .citation {
  font-size: 0.78rem;
  color: #1a5276;
  background: #eaf4fb;
  border: 1px solid #aed6f1;
  border-radius: 6px;
  margin-top: 10px;
  padding: 7px 10px;
}
.msg .citation .citation-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 0.68rem;
  display: block;
  margin-bottom: 3px;
  color: #1a5276;
}
.msg .citation-none {
  font-size: 0.75rem;
  color: #888;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-top: 10px;
  padding: 6px 10px;
  font-style: italic;
}
.typing-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  height: 20px;
}
.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aaa;
  animation: dot-bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-6px); }
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.chat-input-area input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.93rem;
  font-family: inherit;
}
.chat-input-area input:focus { outline: none; border-color: var(--blue); }
.chat-input-area button { padding: 10px 20px; font-size: 0.93rem; }
.chat-disclaimer {
  font-size: 0.78rem;
  color: #aaa;
  margin-top: 10px;
  text-align: center;
}

/* ── About page specific ── */
.about-section { margin-bottom: 32px; }
.about-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--blue);
}

/* ── Utility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-header {
  padding: 36px 20px 0;
  max-width: var(--max-w);
  margin: 0 auto;
}
.page-header h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 6px; }
.page-header p   { font-size: 1rem; color: var(--muted); margin-bottom: 28px; }

.note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 12px;
}

@media (max-width: 479px) {
  .hero h1  { font-size: 1.65rem; }
  .messages { height: 360px; }
}
