:root {
  --primary: #6d28d9;
  --primary-dark: #5b21b6;
  --accent: #f59e0b;
  --bg: #f4f5fb;
  --card: #ffffff;
  --text: #1f2330;
  --muted: #6b7280;
  --border: #e5e7eb;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #2563eb;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, 'Noto Sans Tamil', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top bar ---------- */
.topbar {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.topbar .brand {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar nav a {
  color: #fff;
  margin-left: 16px;
  font-weight: 500;
  opacity: 0.92;
}
.topbar nav a:hover { opacity: 1; text-decoration: underline; }
.topbar .role-tag {
  background: rgba(255,255,255,0.18);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  margin-left: 14px;
}

/* ---------- Layout ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}
.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.page-subtitle {
  color: var(--muted);
  margin-bottom: 22px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 2px 10px rgba(20,20,43,0.05);
  margin-bottom: 20px;
}
.card h2, .card h3 { margin-top: 0; }

/* ---------- Forms ---------- */
label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.92rem;
}
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=tel], input[type=file],
select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  margin-bottom: 16px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(109,40,217,0.12);
}
textarea { resize: vertical; min-height: 90px; }

.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 200px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--warning); }
.btn-warning:hover { background: #b45309; }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover { background: rgba(109,40,217,0.06); }
.btn-block { display: block; width: 100%; }

/* ---------- Alerts ---------- */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.92rem;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-primary { background: #ede9fe; color: #5b21b6; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
th { background: #f9fafb; font-weight: 700; color: var(--muted); font-size: 0.82rem; text-transform: uppercase; }
tr:hover td { background: #fafaff; }

/* ---------- Misc ---------- */
.text-muted { color: var(--muted); font-size: 0.88rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.script-box {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  white-space: pre-wrap;
  font-size: 0.92rem;
  max-height: 420px;
  overflow-y: auto;
}
.video-box video, .video-box img { width: 100%; border-radius: 8px; background: #000; }
.thumb-img {
  width: 90px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border);
}
.login-wrap {
  max-width: 440px;
  margin: 50px auto;
  padding: 0 16px;
}
.login-wrap .card {
  text-align: center;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(109,40,217,0.12);
  border-top: 5px solid var(--primary);
}
.login-wrap .login-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #9333ea);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 14px;
  color: #fff;
  box-shadow: 0 6px 16px rgba(109,40,217,0.3);
}
.login-wrap h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--primary), #9333ea);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login-wrap p.text-muted { margin-bottom: 22px; }
.login-wrap .btn-block {
  background: linear-gradient(135deg, var(--primary), #9333ea);
  font-size: 1.02rem;
  padding: 13px 22px;
  letter-spacing: 0.3px;
}
.login-wrap .btn-block:hover {
  background: linear-gradient(135deg, var(--primary-dark), #7e22ce);
}

.footer {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Public landing */
.hero {
  background: linear-gradient(135deg, var(--primary), #9333ea);
  color: #fff;
  text-align: center;
  padding: 70px 20px;
}
.hero h1 { font-size: 2.2rem; margin-bottom: 10px; }
.hero p { font-size: 1.05rem; opacity: 0.94; max-width: 640px; margin: 0 auto 24px; }

/* Stats row under hero */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin: 28px auto 0;
  max-width: 700px;
}
.stat-item { text-align: center; }
.stat-item .stat-num { font-size: 1.9rem; font-weight: 800; display: block; }
.stat-item .stat-label { font-size: 0.85rem; opacity: 0.85; }

/* Feature cards grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.feature-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 2px 10px rgba(20,20,43,0.05);
  border-top: 4px solid var(--primary);
  text-align: center;
}
.feature-card .feature-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
}
.feature-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.feature-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* How it works timeline */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 9px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), #9333ea);
}
.timeline-step {
  position: relative;
  padding-bottom: 22px;
}
.timeline-step:last-child { padding-bottom: 0; }
.timeline-step .step-dot {
  position: absolute;
  left: -28px; top: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #9333ea);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.timeline-step h4 { margin: 0 0 4px; font-size: 1rem; }
.timeline-step p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* CTA banner */
.cta-banner {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  margin-bottom: 24px;
}
.cta-banner h2 { margin: 0 0 8px; color: #fff; }
.cta-banner p { margin: 0 0 18px; opacity: 0.95; }
.cta-banner .btn { background: #fff; color: #ef4444; font-size: 1.05rem; padding: 13px 30px; }
.cta-banner .btn:hover { background: #f3f4f6; }

@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .topbar nav { width: 100%; display: flex; flex-wrap: wrap; gap: 4px; }
  .topbar nav a { margin-left: 0; margin-right: 12px; }
}
