:root {
  --primary: #1a4d2e;
  --primary-hover: #133a22;
  --primary-accent: #2e7d32;
  --accent-gold: #e5a93c;
  --bg-gradient: linear-gradient(135deg, #0d2818 0%, #1a4d2e 50%, #0f3820 100%);
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
}

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

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.5;
}

.navbar {
  background: var(--primary);
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.nav-inner {
  max-width: 1050px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.nav-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--accent-gold);
  flex-shrink: 0;
}
.nav-name {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.nav-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  transition: all 0.2s;
  font-weight: 600;
  white-space: nowrap;
}
.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255,255,255,0.18);
}
.nav-admin-btn {
  color: var(--primary);
  background: var(--accent-gold);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  transition: all 0.2s;
  font-weight: 800;
  white-space: nowrap;
  display: inline-block;
}
.nav-admin-btn:hover {
  background: #f5b942;
  color: var(--primary-hover);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.25s;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .navbar { position: relative; z-index: 1000; }
  .nav-inner { position: static; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #133a22; /* High-contrast solid dark green */
    flex-direction: column;
    padding: 1rem 1.5rem 1.5rem;
    box-shadow: 0 12px 24px rgba(0,0,0,0.4);
    border-top: 2px solid var(--accent-gold);
    z-index: 1001;
    max-height: 80vh;
    overflow-y: auto;
  }
  .nav-links.open { display: flex !important; }
  .nav-link, .nav-admin-btn {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .nav-admin-btn {
    border-bottom: none;
    margin-top: 0.5rem;
    text-align: center;
  }
}

.container { max-width: 580px; margin: 0 auto; padding: 1.2rem; }

/* Hero / Home page */
.hero {
  text-align: center;
  padding: 2.2rem 1rem 1.8rem;
}
.hero-logo {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  padding: 4px;
  background: linear-gradient(135deg, var(--accent-gold), var(--primary-accent));
  box-shadow: 0 8px 20px rgba(26,77,46,0.2);
}
.hero h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}
.hero-tagline {
  font-size: 0.95rem;
  color: var(--accent-gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.home-actions {
  text-align: center;
  padding: 0 0 1.5rem;
}
.home-actions .primary-btn {
  max-width: 280px;
  margin: 0 auto;
}
.home-info {
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.6;
}

/* Header for registration page */
.header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 1rem 0;
}
.header-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  text-align: left;
}
.header-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--accent-gold);
}
.header h1 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.3;
}
.header h2 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-top: 0.2rem;
  letter-spacing: 0.05em;
}

.section-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.4rem 1.2rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #f1f5f9;
}
.section-subtitle {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin: 1.2rem 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field-group { margin-bottom: 0.95rem; }
.field-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.35rem;
}
.field-group label .hint {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.field-group input[type="text"],
.field-group input[type="tel"],
.field-group input[type="email"],
.field-group input[type="date"],
.field-group input[type="number"],
.field-group select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #f8fafc;
  transition: all 0.2s ease;
}
.field-group input:focus,
.field-group select:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 77, 46, 0.12);
}
.field-group input[type="file"] {
  font-size: 0.88rem;
}

.radio-group {
  display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.3rem;
}
.radio-group label {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.radio-group input[type="radio"] { width: 1.1rem; height: 1.1rem; accent-color: var(--primary); }

.preview {
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem 0 0;
  background: #f8fafc;
  overflow: hidden;
}
.preview img { max-width: 100%; max-height: 180px; object-fit: contain; }
.preview.passport { width: 140px; height: 180px; margin: 0 auto; }
.preview.passport img { max-height: 100%; object-fit: cover; }

.file-input-wrapper {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.file-input-wrapper input[type="file"] { flex: 1; min-width: 0; }

.signature-area { margin-top: 0.5rem; }
.signature-area canvas {
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  width: 100%;
  touch-action: none;
  background: #fff;
}

.checkbox-group { margin: 1rem 0; }
.checkbox-group label {
  display: flex; align-items: flex-start; gap: 0.6rem;
  font-size: 0.88rem; cursor: pointer; font-weight: 600; color: #334155;
}
.checkbox-group input[type="checkbox"] {
  width: 1.2rem; height: 1.2rem; margin-top: 0.15rem; accent-color: var(--primary); flex-shrink: 0;
}

.declaration-text {
  background: #f1f5f9;
  border-left: 4px solid var(--primary);
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.5;
  border-radius: 0 8px 8px 0;
}

.disabled { opacity: 0.5; pointer-events: none; }
.hidden { display: none !important; }

.primary-btn {
  width: 100%; padding: 0.95rem;
  background: var(--primary);
  color: #fff;
  border: none; border-radius: 10px;
  font-size: 1rem; font-weight: 800;
  cursor: pointer;
  margin-top: 1rem;
  box-shadow: 0 4px 12px rgba(26,77,46,0.25);
  transition: all 0.2s ease;
}
.primary-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
.primary-btn:disabled { background: #94a3b8; cursor: not-allowed; transform: none; box-shadow: none; }

.small-btn {
  padding: 0.4rem 0.85rem;
  background: #e2e8f0;
  color: #475569;
  border: none; border-radius: 6px;
  font-size: 0.82rem; font-weight: 700; cursor: pointer;
  margin-top: 0.4rem;
}

.status {
  padding: 0.85rem 1.1rem; border-radius: 8px;
  margin: 0.8rem 0; font-size: 0.9rem; font-weight: 600;
}
.status.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.status.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.status.info { background: #f0f9ff; color: #075985; border: 1px solid #bae6fd; }

.success-screen { text-align: center; padding: 2rem 1rem; }
.success-screen .checkmark { font-size: 3.2rem; color: var(--primary-accent); margin-bottom: 0.5rem; }
.success-screen h3 { font-size: 1.15rem; font-weight: 800; color: var(--primary); margin-bottom: 0.3rem; }
.success-screen .reference { font-size: 1.35rem; font-weight: 800; color: var(--accent-gold); margin: 0.8rem 0; }
.success-screen iframe { width: 100%; height: 400px; border: 1px solid #cbd5e1; margin: 1rem 0; border-radius: 8px; }

.progress-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(255,255,255,0.92);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 999;
}
.progress-overlay p { font-size: 1.1rem; font-weight: 700; margin-top: 1rem; color: var(--primary); }
.spinner {
  width: 44px; height: 44px;
  border: 4px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,0.9);
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 2.5rem;
}
.footer-inner {
  max-width: 580px;
  margin: 0 auto;
}
.footer-nav {
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-gold);
}
.footer-nav a {
  color: #ffffff;
  text-decoration: none;
  margin: 0 0.3rem;
  transition: color 0.2s;
}
.footer-nav a:hover {
  color: var(--accent-gold);
  text-decoration: underline;
}
.site-footer p {
  font-size: 0.85rem;
  font-weight: 600;
}
.footer-small {
  font-size: 0.75rem !important;
  opacity: 0.75;
  margin-top: 0.4rem;
}

/* Modal Popup Styles */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.55);
  display: flex; justify-content: center; align-items: center;
  z-index: 1000; visibility: hidden; opacity: 0;
  transition: all 0.25s ease;
}
.modal-overlay.open { visibility: visible; opacity: 1; }
.modal-content {
  background: #ffffff;
  border-radius: 16px;
  width: 90%; max-width: 540px;
  max-height: 85vh; overflow-y: auto;
  padding: 1.8rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.2rem; border-bottom: 2px solid #f1f5f9; padding-bottom: 0.6rem;
}
.modal-header h3 { color: var(--primary); font-size: 1.15rem; font-weight: 800; }
.close-modal { background: none; border: none; font-size: 1.6rem; cursor: pointer; color: #94a3b8; }
/* Button styled as an inline link for accessible policy references. */
.link-button {
  border: 0;
  padding: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}
.status-submitted { background: #3b82f6; color: #fff; }
.status-queried { background: #f59e0b; color: #fff; }
.status-approved { background: #22c55e; color: #fff; }
.status-rejected { background: #ef4444; color: #fff; }

/* View Modal Details */
.view-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.detail-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.2rem;
}
.detail-value {
  font-size: 0.95rem;
  color: #0f172a;
  font-weight: 500;
}

/* Table Action Buttons */
.action-btn-group {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.action-btn {
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  color: #fff;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.action-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.action-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.action-btn.view { background: #2563eb; }
.action-btn.approve { background: #22c55e; }
.action-btn.reject { background: #ef4444; }
.action-btn.query { background: #f59e0b; }
.action-btn.pdf { background: #64748b; }
.action-btn.edit { background: #f59e0b; }
.action-btn.delete { background: #ef4444; }

/* Copyable Text Block */
.copyable-text {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 1rem;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  margin-bottom: 1rem;
  color: #334155;
  position: relative;
}

/* Approval Info Block */
.approval-info {
  background: #f0fdf4;
  border-left: 4px solid #22c55e;
  padding: 1rem;
  margin-top: 1rem;
  border-radius: 0 8px 8px 0;
}
.approval-info h4 { color: #166534; margin-bottom: 0.5rem; font-size: 0.95rem; }

