/* ==========================================
   BFS Global Fingerprint System - Stylesheet
   ========================================== */

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

:root {
  --primary: #c8102e;          /* BFS red */
  --primary-dark: #9a0c23;
  --secondary: #1a3a6c;        /* navy */
  --bg: #f6f7fb;
  --card-bg: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,.06);
}

body {
  font-family: 'Hind Siliguri', 'SolaimanLipi', 'Noto Sans Bengali', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* ===== Header ===== */
.site-header, .admin-header {
  background: #fff;
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; gap: 12px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo img { height: 44px; width: auto; }
.logo strong { display: block; font-size: 16px; color: var(--secondary); }
.logo span { display: block; font-size: 12px; color: var(--muted); }

.admin-header { background: var(--secondary); }
.admin-header .logo strong { color: #fff; }
.admin-nav { display: flex; gap: 16px; align-items: center; }
.admin-nav a { color: #fff; text-decoration: none; font-weight: 500; }
.admin-nav a.btn { color: #fff; border-color: #fff; }

/* ===== Buttons ===== */
.btn {
  display: inline-block; padding: 10px 18px; border-radius: var(--radius);
  font-weight: 600; text-decoration: none; cursor: pointer; border: 2px solid transparent;
  font-size: 15px; transition: all .15s ease; text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { opacity: .9; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--bg); }
.btn-danger { background: var(--error); color: #fff; }
.btn-lg { padding: 14px 28px; font-size: 17px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #fff; padding: 60px 0; text-align: center;
}
.hero h1 { font-size: 32px; margin-bottom: 12px; }
.hero p { font-size: 17px; opacity: .95; max-width: 700px; margin: 0 auto 24px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== Card ===== */
.card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.card h2 { margin-bottom: 12px; color: var(--secondary); }
.card h3 { margin-bottom: 10px; color: var(--secondary); }
.card h4 { margin: 16px 0 8px; color: var(--text); font-size: 15px; }
.muted { color: var(--muted); font-size: 14px; }

/* ===== Track form ===== */
.track-section { padding: 40px 0; }
.track-form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.track-form input { flex: 1; min-width: 220px; padding: 12px 14px; border: 2px solid var(--border); border-radius: var(--radius); font-size: 15px; }
.track-form input:focus { outline: none; border-color: var(--primary); }

/* ===== Features ===== */
.features { padding: 40px 0 60px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.feature { background: #fff; padding: 24px; border-radius: var(--radius); text-align: center; box-shadow: var(--shadow); }
.feature-icon { font-size: 36px; margin-bottom: 10px; }
.feature h3 { color: var(--secondary); margin-bottom: 6px; }

/* ===== Footer ===== */
.site-footer { background: var(--secondary); color: #fff; padding: 24px 0; text-align: center; margin-top: 40px; }

/* ===== Submit form / Steps ===== */
.submit-page { padding: 30px 0 60px; }
.steps-bar { display: flex; justify-content: space-between; max-width: 600px; margin: 0 auto 30px; position: relative; }
.steps-bar::before { content: ''; position: absolute; top: 18px; left: 10%; right: 10%; height: 3px; background: var(--border); z-index: 0; }
.step-item { position: relative; z-index: 1; text-align: center; flex: 1; }
.step-item span { display: inline-flex; width: 36px; height: 36px; border-radius: 50%; background: var(--border); color: var(--muted); align-items: center; justify-content: center; font-weight: 700; }
.step-item label { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.step-item.active span { background: var(--primary); color: #fff; }
.step-item.active label { color: var(--text); font-weight: 600; }

.step-panel { display: none; }
.step-panel.active { display: block; }

form label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 14px; }
form input[type=text], form input[type=tel], form input[type=password], form select, form textarea {
  width: 100%; padding: 11px 14px; border: 2px solid var(--border); border-radius: var(--radius); font-size: 15px; font-family: inherit;
}
form input:focus, form select:focus, form textarea:focus { outline: none; border-color: var(--primary); }
.req { color: var(--error); }

.actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; justify-content: space-between; }
.actions.center { justify-content: center; }

/* ===== Capture block ===== */
.capture-block { border: 2px dashed var(--border); border-radius: var(--radius); padding: 16px; margin: 16px 0; }
.capture-block h3 { margin-bottom: 4px; }
.instruction { font-size: 14px; color: var(--muted); margin-bottom: 12px; padding: 10px; background: #fffbea; border-left: 3px solid var(--warning); border-radius: 6px; }
.capture-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.preview { margin-top: 12px; }
.preview img { max-width: 100%; max-height: 220px; border-radius: 8px; border: 1px solid var(--border); }
.preview .ok-tag { display: inline-block; background: var(--success); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 13px; margin-bottom: 8px; }

/* ===== Camera Modal ===== */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 100; align-items: center; justify-content: center; padding: 16px; }
.modal.open { display: flex; }
.modal-inner { background: #fff; border-radius: var(--radius); padding: 20px; max-width: 600px; width: 100%; max-height: 95vh; overflow: auto; }
.modal video { width: 100%; max-height: 60vh; background: #000; border-radius: 8px; margin: 12px 0; }

/* ===== Loading ===== */
.loading { display: none; position: fixed; inset: 0; background: rgba(255,255,255,.95); z-index: 200; flex-direction: column; align-items: center; justify-content: center; }
.loading.open { display: flex; }
.spinner { width: 50px; height: 50px; border: 5px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Success / Tracking ===== */
.success-card { text-align: center; }
.success-icon { font-size: 64px; margin-bottom: 10px; }
.tracking-box { background: var(--bg); border: 2px dashed var(--primary); border-radius: var(--radius); padding: 20px; margin: 20px 0; }
.tracking-box label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.tracking-number { font-size: 28px; font-weight: 700; color: var(--primary); letter-spacing: 1px; margin-bottom: 12px; word-break: break-all; }

/* ===== Track page ===== */
.track-page { padding: 30px 0; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.info-grid > div { background: var(--bg); padding: 12px; border-radius: 8px; }
.info-grid label { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; }
.info-grid strong { font-size: 15px; }

.progress-track { display: flex; justify-content: space-between; margin: 24px 0 16px; position: relative; flex-wrap: wrap; gap: 10px; }
.progress-step { flex: 1; min-width: 100px; text-align: center; position: relative; }
.progress-step .dot { width: 36px; height: 36px; border-radius: 50%; background: var(--border); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.progress-step .label { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.progress-step.done .dot { background: var(--success); color: #fff; }
.progress-step.current .dot { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(200,16,46,.2); }
.progress-step.done .label, .progress-step.current .label { color: var(--text); font-weight: 600; }

.status-current { background: var(--bg); padding: 12px; border-radius: 8px; text-align: center; font-size: 16px; }
.note-box { background: #fffbea; border-left: 3px solid var(--warning); padding: 12px; border-radius: 6px; margin-top: 12px; }
.note-box label { display: block; font-weight: 600; margin-bottom: 6px; }

.error-card { background: #fef2f2; border-left: 4px solid var(--error); }

/* ===== Admin ===== */
.admin-body { background: var(--bg); }
.admin-main { padding: 24px 0 60px; }
.admin-main h1 { color: var(--secondary); margin-bottom: 12px; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: linear-gradient(135deg, var(--secondary), var(--primary)); }
.login-card { max-width: 420px; width: 100%; }
.login-logo { text-align: center; margin-bottom: 20px; }
.login-logo img { height: 60px; margin-bottom: 10px; }
.center { text-align: center; }

.alert { padding: 12px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.alert-error { background: #fef2f2; color: var(--error); border-left: 3px solid var(--error); }
.alert-success { background: #ecfdf5; color: var(--success); border-left: 3px solid var(--success); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
.stat-num { font-size: 36px; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--muted); font-size: 14px; margin-top: 4px; }

.table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
.table th, .table td { padding: 10px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: var(--bg); font-weight: 600; color: var(--secondary); }
.table tbody tr:hover { background: #fafbff; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; background: var(--border); color: var(--text); }
.badge-submitted { background: #dbeafe; color: #1e40af; }
.badge-under_review { background: #fef3c7; color: #92400e; }
.badge-verified { background: #e0e7ff; color: #4338ca; }
.badge-sent_embassy { background: #fce7f3; color: #9d174d; }
.badge-completed { background: #d1fae5; color: #065f46; }

.filter-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-form input, .filter-form select { padding: 9px 12px; border: 2px solid var(--border); border-radius: 8px; }
.filter-form input { flex: 1; min-width: 200px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; } }
.thumb { max-width: 100%; max-height: 180px; border: 1px solid var(--border); border-radius: 8px; margin-top: 6px; background: #fff; }
.image-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.image-pair a { text-decoration: none; color: var(--text); text-align: center; }
.image-pair span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }

.danger-card { border-left: 4px solid var(--error); }
.back-link { color: var(--secondary); text-decoration: none; font-size: 14px; }

@media (max-width: 600px) {
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 15px; }
  .stat-num { font-size: 28px; }
  .step-item label { font-size: 11px; }
}
