/* ============================================
   Forest Department Jharkhand — Stylesheet
   Aesthetic: Editorial · Government · Refined
   ============================================ */

:root {
  --forest-deep: #1a3a2e;
  --forest-mid: #2d5a3f;
  --forest-light: #4a7c5a;
  --moss: #8ba888;
  --cream: #f5f1e8;
  --paper: #fafaf5;
  --ink: #1c1c1a;
  --ink-soft: #4a4a45;
  --ink-faded: #8a8a82;
  --gold: #b8954a;
  --gold-deep: #8a6e2f;
  --rust: #a0421e;
  --line: #d4cfc0;
  --shadow: rgba(28,28,26,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}

/* Grain overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.7 0 0 0 0 0.65 0 0 0 0 0.55 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ Header ============ */
.site-header {
  background: var(--forest-deep);
  color: var(--cream);
  padding: 24px 48px;
  border-bottom: 3px double var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.emblem-wrap {
  display: flex;
  gap: 18px;
  align-items: center;
}

.emblem {
  width: 56px;
  height: 56px;
  color: var(--gold);
  flex-shrink: 0;
}

.emblem svg { width: 100%; height: 100%; }

.emblem-text .lang-hi {
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--moss);
  margin-bottom: 2px;
  font-weight: 400;
}

.emblem-text h1 {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 600;
  font-style: italic;
  letter-spacing: -0.01em;
}

.emblem-text .location {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 4px;
  font-weight: 500;
}

.main-nav {
  display: flex;
  gap: 4px;
}

.main-nav a {
  color: var(--cream);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 10px 16px;
  border-radius: 2px;
  transition: all 0.2s;
  position: relative;
}

.main-nav a:hover { color: var(--gold); }

.main-nav a.active {
  color: var(--gold);
}

.main-nav a.active::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 4px;
  height: 1px;
  background: var(--gold);
}

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: 100px 48px 80px;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 80px;
  align-items: center;
  min-height: 70vh;
}

.hero-bg {
  position: absolute;
  inset: 0;
  color: var(--forest-mid);
  pointer-events: none;
  opacity: 0.6;
}

.hero-bg svg { width: 100%; height: 100%; }

.hero-content { position: relative; z-index: 2; }

.ref-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Manrope', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold-deep);
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--cream);
  margin-bottom: 32px;
  font-weight: 500;
}

.ref-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rust);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.95;
  font-weight: 400;
  color: var(--forest-deep);
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}

.hero-title .line-1 { display: block; opacity: 0; animation: rise 0.8s 0.1s forwards; }
.hero-title .line-2 { display: block; padding-left: 80px; font-style: italic; color: var(--gold-deep); font-weight: 500; opacity: 0; animation: rise 0.8s 0.3s forwards; }
.hero-title .line-3 { display: block; opacity: 0; animation: rise 0.8s 0.5s forwards; }

.hero-title em {
  font-style: italic;
  font-weight: 500;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-sub {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 540px;
  line-height: 1.65;
  margin-bottom: 40px;
  opacity: 0;
  animation: rise 0.8s 0.7s forwards;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  animation: rise 0.8s 0.9s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  border-radius: 2px;
  transition: all 0.25s;
  cursor: pointer;
  border: none;
  font-family: 'Manrope', sans-serif;
}

.btn-primary {
  background: var(--forest-deep);
  color: var(--cream);
  border: 1px solid var(--forest-deep);
}

.btn-primary:hover {
  background: var(--forest-mid);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,58,46,0.25);
}

.btn-ghost {
  background: transparent;
  color: var(--forest-deep);
  border: 1px solid var(--forest-deep);
}

.btn-ghost:hover {
  background: var(--forest-deep);
  color: var(--cream);
}

.btn-gold {
  background: var(--gold);
  color: var(--ink);
  border: 1px solid var(--gold);
}

.btn-gold:hover {
  background: var(--gold-deep);
  color: var(--cream);
}

.btn-danger {
  background: var(--rust);
  color: var(--cream);
  border: 1px solid var(--rust);
}

/* Hero decoration */
.hero-decoration {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 16px;
}

.stat-card {
  background: var(--cream);
  border: 1px solid var(--line);
  padding: 28px 32px;
  position: relative;
  transition: all 0.3s;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--forest-deep);
}

.stat-card-2::before { background: var(--gold); }
.stat-card-3::before { background: var(--rust); }

.stat-card:hover {
  transform: translateX(8px);
  box-shadow: -8px 8px 0 var(--forest-deep);
}

.stat-card-2:hover { box-shadow: -8px 8px 0 var(--gold); }
.stat-card-3:hover { box-shadow: -8px 8px 0 var(--rust); }

.stat-num {
  font-family: 'Fraunces', serif;
  font-size: 48px;
  font-weight: 600;
  color: var(--forest-deep);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-faded);
  font-weight: 500;
}

/* ============ Features ============ */
.features {
  padding: 100px 48px;
  max-width: 1400px;
  margin: 0 auto;
}

.section-head {
  margin-bottom: 60px;
  text-align: center;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 600;
  display: block;
  margin-bottom: 12px;
}

.section-head h3 {
  font-family: 'Fraunces', serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 500;
  color: var(--forest-deep);
  letter-spacing: -0.02em;
  font-style: italic;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.feature-card {
  background: var(--paper);
  padding: 40px 32px;
  transition: background 0.3s;
}

.feature-card:hover {
  background: var(--cream);
}

.feature-num {
  font-family: 'Fraunces', serif;
  font-size: 14px;
  color: var(--gold-deep);
  letter-spacing: 2px;
  margin-bottom: 24px;
  font-weight: 600;
}

.feature-card h4 {
  font-family: 'Fraunces', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--forest-deep);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.feature-card p {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.65;
}

/* ============ Notice ============ */
.notice {
  background: var(--forest-deep);
  color: var(--cream);
  padding: 60px 48px;
  position: relative;
  overflow: hidden;
}

.notice::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent, transparent 30px, rgba(184,149,74,0.03) 30px, rgba(184,149,74,0.03) 31px);
}

.notice-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  gap: 32px;
  align-items: flex-start;
  position: relative;
}

.notice-icon {
  width: 56px;
  height: 56px;
  color: var(--gold);
  flex-shrink: 0;
}

.notice-icon svg { width: 100%; height: 100%; }

.notice-text h5 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-style: italic;
  color: var(--gold);
  margin-bottom: 12px;
}

.notice-text p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--moss);
}

/* ============ Footer ============ */
.site-footer {
  background: var(--ink);
  color: var(--cream);
  padding: 60px 48px 24px;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h6 {
  font-family: 'Fraunces', serif;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
  font-weight: 600;
}

.footer-col p {
  font-size: 13px;
  color: var(--ink-faded);
  line-height: 1.7;
}

.footer-col a {
  color: var(--moss);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--gold); }

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid #2a2a25;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-faded);
  flex-wrap: wrap;
  gap: 8px;
}

.ref-small {
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: var(--gold-deep);
}

/* ============ Forms (shared) ============ */
.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 48px 100px;
}

.page-header {
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--forest-deep);
}

.page-header .eyebrow { margin-bottom: 8px; }

.page-header h2 {
  font-family: 'Fraunces', serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 500;
  color: var(--forest-deep);
  letter-spacing: -0.02em;
  font-style: italic;
  margin-bottom: 8px;
}

.page-header p {
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 600px;
}

.form-card {
  background: var(--cream);
  border: 1px solid var(--line);
  padding: 48px;
  position: relative;
}

.form-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 80px;
  height: 4px;
  background: var(--gold);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.form-row.full { grid-template-columns: 1fr; }

.form-field { display: flex; flex-direction: column; gap: 8px; }

.form-field label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.form-field label .req { color: var(--rust); }

.form-field input,
.form-field select,
.form-field textarea {
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 2px;
  transition: all 0.2s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--forest-deep);
  background: white;
  box-shadow: 0 0 0 3px rgba(26,58,46,0.08);
}

.form-field textarea { resize: vertical; min-height: 80px; }

.form-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.photo-upload {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px;
  background: var(--paper);
  border: 1px dashed var(--line);
}

.photo-preview {
  width: 100px;
  height: 120px;
  background: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faded);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  overflow: hidden;
}

.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

.photo-upload-info { flex: 1; }
.photo-upload-info h6 {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  margin-bottom: 4px;
}
.photo-upload-info p { font-size: 12px; color: var(--ink-faded); }
.photo-upload input[type="file"] {
  font-size: 13px;
  margin-top: 8px;
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--forest-deep);
  color: var(--cream);
  padding: 16px 24px;
  border-radius: 2px;
  border-left: 4px solid var(--gold);
  font-size: 14px;
  z-index: 1500;
  transform: translateY(120%);
  transition: transform 0.3s;
  box-shadow: 0 12px 32px rgba(0,0,0,0.2);
  max-width: 380px;
}

.toast.show { transform: translateY(0); }
.toast.error { border-left-color: var(--rust); }

/* ============ Directory ============ */
.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.search-bar input,
.search-bar select {
  font-family: 'Manrope', sans-serif;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: var(--cream);
  font-size: 14px;
  flex: 1;
  min-width: 200px;
}

.search-bar input:focus,
.search-bar select:focus {
  outline: none;
  border-color: var(--forest-deep);
}

.directory-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--cream);
  border: 1px solid var(--line);
}

.directory-table th {
  text-align: left;
  padding: 16px 20px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--cream);
  font-weight: 600;
  background: var(--forest-deep);
}

.directory-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.directory-table tbody tr:hover { background: var(--paper); }

.directory-table tbody tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: 0.5px;
  font-weight: 600;
  border-radius: 2px;
  text-transform: uppercase;
}

.badge-active { background: rgba(74,124,90,0.15); color: var(--forest-mid); }
.badge-pending { background: rgba(184,149,74,0.15); color: var(--gold-deep); }

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--ink-faded);
}

.empty-state h5 {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

/* ============ ID Card ============ */
.id-card-search {
  background: var(--cream);
  padding: 32px;
  border: 1px solid var(--line);
  margin-bottom: 32px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.id-card-search .form-field { flex: 1; min-width: 240px; }

.id-card-display {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.id-card {
  width: 540px;
  background: var(--paper);
  border: 2px solid var(--forest-deep);
  font-family: 'Manrope', sans-serif;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  page-break-inside: avoid;
}

.id-card-header {
  background: var(--forest-deep);
  color: var(--cream);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 3px solid var(--gold);
}

.id-card-header .emblem { width: 44px; height: 44px; color: var(--gold); }

.id-card-header h3 {
  font-family: 'Fraunces', serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.id-card-header p {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--gold);
  text-transform: uppercase;
  margin-top: 2px;
}

.id-card-body {
  padding: 24px;
  display: grid;
  grid-template-columns: 120px 1fr 80px;
  gap: 20px;
  align-items: center;
}

.id-photo {
  width: 120px;
  height: 140px;
  background: var(--line);
  border: 2px solid var(--forest-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.id-photo img { width: 100%; height: 100%; object-fit: cover; }
.id-photo .placeholder { font-size: 10px; color: var(--ink-faded); letter-spacing: 1px; text-align: center; padding: 8px; }

.id-info { font-size: 12px; }
.id-info .id-name {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--forest-deep);
  margin-bottom: 4px;
}
.id-info .id-desig {
  font-size: 11px;
  color: var(--gold-deep);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 12px;
}
.id-info dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.id-info dt {
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-faded);
  font-weight: 600;
}
.id-info dd { font-size: 11px; color: var(--ink); font-weight: 500; }

.id-qr {
  width: 80px;
  height: 80px;
  background: var(--paper);
  border: 1px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

.id-qr svg { width: 100%; height: 100%; }

.id-card-footer {
  background: var(--cream);
  padding: 12px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  color: var(--ink-faded);
  letter-spacing: 0.5px;
}

.id-card-footer .signature {
  text-align: right;
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: var(--forest-deep);
  font-size: 10px;
}

.id-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

/* ============ Login ============ */
.login-wrap {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--cream);
  border: 1px solid var(--line);
  padding: 48px 40px;
  position: relative;
}

.login-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  background: var(--gold);
}

.login-card h3 {
  font-family: 'Fraunces', serif;
  font-size: 32px;
  font-style: italic;
  color: var(--forest-deep);
  margin-bottom: 8px;
  text-align: center;
}

.login-card .subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 32px;
}

/* ============ Print styles ============ */
@media print {
  .grain, .site-header, .site-footer, .id-actions, .id-card-search { display: none !important; }
  body { background: white; }
  .id-card { box-shadow: none; border-width: 1px; }
  .page-wrap { padding: 0; }
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 60px 24px; gap: 48px; }
  .hero-title .line-2 { padding-left: 32px; }
  .site-header { padding: 16px 24px; }
  .header-inner { gap: 16px; }
  .emblem-text h1 { font-size: 14px; }
  .main-nav { width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .main-nav a { padding: 8px 12px; font-size: 12px; white-space: nowrap; }
  .features, .notice, .page-wrap, .site-footer { padding-left: 24px; padding-right: 24px; }
  .form-row { grid-template-columns: 1fr; }
  .form-card { padding: 24px; }
  .notice-inner { flex-direction: column; gap: 16px; }
  .id-card { width: 100%; max-width: 540px; }
  .id-card-body { grid-template-columns: 100px 1fr; }
  .id-qr { grid-column: 1 / -1; justify-self: center; }
  .directory-table { font-size: 12px; }
  .directory-table th, .directory-table td { padding: 10px 12px; }
  .directory-table .hide-mobile { display: none; }
}
