/* =====================================================================
   HPIS TIRANGA ID 2026 — Main stylesheet
   Palette: saffron / white / india green, premium glass cards
   ===================================================================== */

:root {
  --saffron: #FF9933;
  --saffron-deep: #E8720C;
  --white: #FFFFFF;
  --india-green: #138808;
  --green-deep: #0B6B04;
  --navy: #0B1D3A;
  --chakra: #0B1D3A;
  --ink: #1A1A1A;
  --muted: #5C6470;
  --bg: #FBF9F6;
  --card-bg: rgba(255, 255, 255, 0.65);
  --card-border: rgba(255, 255, 255, 0.45);
  --radius-lg: 22px;
  --radius-md: 14px;
  --shadow-soft: 0 10px 30px rgba(11, 29, 58, 0.10);
  --shadow-strong: 0 18px 50px rgba(11, 29, 58, 0.18);
  --font-head: 'Poppins', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 10% 0%, rgba(255,153,51,0.10), transparent 40%),
    radial-gradient(circle at 90% 10%, rgba(19,136,8,0.10), transparent 40%);
  line-height: 1.55;
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 640px; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--navy); color: #fff;
  padding: 10px 16px; z-index: 999; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

h1, h2, h3, h4 { font-family: var(--font-head); margin: 0 0 12px; color: var(--navy); }
p { margin: 0 0 12px; }
a { color: var(--green-deep); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(11,29,58,0.06);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.brand-logo { height: 40px; width: 40px; object-fit: contain; border-radius: 8px; }
.brand-text strong { display: block; font-family: var(--font-head); font-size: 0.95rem; }
.brand-text small { color: var(--muted); font-size: 0.72rem; }
.site-nav a { margin-left: 18px; text-decoration: none; color: var(--navy); font-weight: 500; font-size: 0.92rem; }
.site-nav a:hover { color: var(--saffron-deep); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 48px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255,153,51,0.10), transparent 60%);
}
.hero-flag-bar {
  height: 6px; width: 100%;
  background: linear-gradient(90deg, var(--saffron), var(--white) 33%, var(--white) 66%, var(--india-green));
  position: absolute; top: 0; left: 0;
}
.hero .eyebrow {
  display: inline-block; padding: 6px 16px; border-radius: 999px;
  background: rgba(19,136,8,0.10); color: var(--green-deep); font-weight: 600; font-size: 0.82rem;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  font-weight: 800;
  margin-bottom: 14px;
}
.hero p.sub { max-width: 620px; margin: 0 auto 28px; color: var(--muted); font-size: 1.05rem; }
.hero-mockup {
  max-width: 320px; margin: 0 auto 32px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-strong);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: 999px; font-weight: 700; font-size: 1rem;
  text-decoration: none; border: none; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
  font-family: var(--font-head);
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--saffron), var(--saffron-deep));
  color: #fff; box-shadow: 0 10px 24px rgba(232,114,12,0.35);
}
.btn-primary:hover { box-shadow: 0 14px 30px rgba(232,114,12,0.45); }
.btn-green { background: linear-gradient(135deg, var(--india-green), var(--green-deep)); color: #fff; box-shadow: 0 10px 24px rgba(19,136,8,0.3); }
.btn-outline { background: transparent; border: 2px solid var(--navy); color: var(--navy); padding: 12px 26px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.hero-badge {
  margin-top: 18px; color: var(--muted); font-size: 0.88rem; font-weight: 600;
}

/* ---------- Glass cards ---------- */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(14px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 28px;
}
.error-card { text-align: center; }
.error-card .btn { margin-top: 14px; }

/* ---------- Steps ---------- */
.steps-section { padding: 56px 0; }
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 30px; }
.step-card { text-align: center; padding: 26px 18px; }
.step-num {
  width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--saffron), var(--india-green));
}
.step-card h3 { font-size: 1rem; }
.step-card p { color: var(--muted); font-size: 0.9rem; margin: 0; }

/* ---------- Counter ---------- */
.counter-section { text-align: center; padding: 20px 0 56px; }
.counter-badge {
  display: inline-block; padding: 14px 26px; border-radius: 999px;
  background: rgba(11,29,58,0.05); font-weight: 700; color: var(--navy);
}
.counter-number { color: var(--saffron-deep); }

/* ---------- Forms ---------- */
.form-section { padding: 40px 0 70px; }
.form-grid { display: grid; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 0.9rem; color: var(--navy); }
.field .hint { font-size: 0.78rem; color: var(--muted); }
input[type=text], input[type=tel], select, textarea {
  padding: 13px 14px; border-radius: var(--radius-md); border: 1.5px solid rgba(11,29,58,0.14);
  font-size: 1rem; font-family: var(--font-body); background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(255,153,51,0.35); border-color: var(--saffron);
}
textarea { resize: vertical; min-height: 80px; }
.char-count { text-align: right; font-size: 0.78rem; color: var(--muted); }
.checkbox-field { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-field input { margin-top: 4px; }
.checkbox-field label { font-weight: 500; font-size: 0.9rem; }
.field-error { color: #B3261E; font-size: 0.82rem; }
.honeypot { position: absolute; left: -9999px; top: -9999px; }

fieldset { border: none; padding: 0; margin: 0; }

/* ---------- Photo capture ---------- */
.photo-tabs { display: flex; gap: 10px; margin-bottom: 16px; }
.photo-tab-btn {
  flex: 1; padding: 12px; border-radius: var(--radius-md); border: 1.5px solid rgba(11,29,58,0.14);
  background: #fff; font-weight: 700; cursor: pointer; font-family: var(--font-head);
}
.photo-tab-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.camera-wrap { position: relative; border-radius: var(--radius-md); overflow: hidden; background: #000; aspect-ratio: 3/4; max-width: 340px; margin: 0 auto; }
.camera-wrap video, .camera-wrap canvas, .camera-wrap img.preview-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-controls { display: flex; gap: 10px; margin-top: 14px; justify-content: center; flex-wrap: wrap; }
.photo-preview-circle {
  width: 160px; height: 160px; border-radius: 50%; overflow: hidden; margin: 0 auto 14px;
  border: 4px solid var(--saffron); box-shadow: var(--shadow-soft);
  background: #eee; display: flex; align-items: center; justify-content: center;
}
.photo-preview-circle img { width: 100%; height: 100%; object-fit: cover; }
.upload-drop {
  border: 2px dashed rgba(11,29,58,0.25); border-radius: var(--radius-md);
  padding: 28px; text-align: center; cursor: pointer; color: var(--muted);
}
.camera-error { color: #B3261E; font-size: 0.88rem; margin-top: 10px; text-align: center; }

/* ---------- Template selector ---------- */
.template-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.template-option { border-radius: var(--radius-md); border: 2px solid rgba(11,29,58,0.1); padding: 10px; cursor: pointer; text-align: center; background: #fff; }
.template-option.selected { border-color: var(--saffron-deep); box-shadow: 0 0 0 3px rgba(255,153,51,0.2); }
.template-swatch { height: 70px; border-radius: 10px; margin-bottom: 8px; }
.swatch-traditional { background: linear-gradient(180deg, var(--saffron), #fff 50%, var(--india-green)); }
.swatch-modern { background: linear-gradient(135deg, rgba(255,153,51,.5), rgba(19,136,8,.5)); backdrop-filter: blur(4px); }
.swatch-school { background: linear-gradient(180deg, var(--navy), var(--saffron)); }
.swatch-cinematic { background: linear-gradient(135deg, #111, var(--saffron-deep)); }
.template-option span { font-size: 0.8rem; font-weight: 600; }

/* ---------- Loading ---------- */
.loading-overlay {
  position: fixed; inset: 0; background: rgba(11,29,58,0.92); color: #fff;
  display: none; align-items: center; justify-content: center; flex-direction: column; z-index: 999; text-align: center; padding: 20px;
}
.loading-overlay.active { display: flex; }
.loading-flag { font-size: 3rem; animation: wave 1.4s ease-in-out infinite; }
.loading-step { margin-top: 14px; font-weight: 600; }
@keyframes wave { 0%,100% { transform: rotate(0deg); } 50% { transform: rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .loading-flag { animation: none; } }

/* ---------- Result page ---------- */
.result-card { text-align: center; }
.result-id-image { max-width: 380px; width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-strong); margin: 0 auto 20px; display: block; }
.result-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px; }
.result-actions .btn { flex: 1 1 200px; }

/* ---------- Verify page ---------- */
.verify-card { max-width: 420px; margin: 40px auto; text-align: center; }
.verify-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--green-deep); font-weight: 800; margin-bottom: 14px; }
.verify-photo { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; border: 4px solid var(--saffron); margin-bottom: 14px; }

/* ---------- Flash / errors ---------- */
.flash { padding: 14px 18px; border-radius: var(--radius-md); margin: 18px 0; font-weight: 600; }
.flash-success { background: rgba(19,136,8,0.12); color: var(--green-deep); }
.flash-error { background: rgba(179,38,30,0.10); color: #B3261E; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 60px; padding: 34px 0; text-align: center; background: var(--navy); color: rgba(255,255,255,0.85); }
.flag-strip { height: 4px; width: 90px; margin: 0 auto 18px; border-radius: 4px; background: linear-gradient(90deg, var(--saffron), #fff, var(--india-green)); }
.site-footer .tagline { font-style: italic; opacity: 0.75; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .copyright { font-size: 0.8rem; opacity: 0.6; margin-top: 10px; }

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gallery-item { border-radius: var(--radius-md); overflow: hidden; background: #fff; box-shadow: var(--shadow-soft); text-align: center; padding-bottom: 10px; }
.gallery-item img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.gallery-item .g-name { font-weight: 700; font-size: 0.85rem; margin-top: 8px; }
.gallery-item .g-id { font-size: 0.72rem; color: var(--muted); }

/* ---------- Admin ---------- */
.admin-body { background: #F2F4F7; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 230px; background: var(--navy); color: #fff; padding: 22px 16px; flex-shrink: 0; }
.admin-sidebar h2 { color: #fff; font-size: 1.05rem; }
.admin-sidebar nav a { display: block; color: rgba(255,255,255,0.8); text-decoration: none; padding: 10px 12px; border-radius: 10px; margin-bottom: 4px; font-size: 0.92rem; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: rgba(255,255,255,0.12); color: #fff; }
.admin-main { flex: 1; padding: 28px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat-card { background: #fff; border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-soft); }
.stat-card .num { font-size: 1.7rem; font-weight: 800; color: var(--navy); }
.stat-card .lbl { color: var(--muted); font-size: 0.85rem; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-soft); }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #EEF0F3; font-size: 0.9rem; }
.admin-table th { background: #F8F9FB; font-weight: 700; color: var(--navy); }
.badge { padding: 4px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; }
.badge-pending { background: #FFF3CD; color: #8A6D00; }
.badge-approved { background: #D8F3DC; color: var(--green-deep); }
.badge-rejected { background: #FBE0DE; color: #B3261E; }
.admin-login-wrap { max-width: 380px; margin: 90px auto; }
.filters-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.filters-bar select, .filters-bar input { padding: 9px 10px; border-radius: 8px; border: 1.5px solid rgba(11,29,58,0.14); }
.action-links a { margin-right: 8px; font-size: 0.85rem; }
.thumb-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

/* Focus visibility for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--saffron-deep); outline-offset: 2px;
}
