/* ============================================================
   FUCCForms — Global Stylesheet
   Family Unity and Connection Center | Forest Green + White
   ============================================================ */

:root {
  --green:       #1E5631;
  --green-dark:  #163f24;
  --green-mid:   #2E7D45;
  --green-light: #4CAF71;
  --green-pale:  #f0f7f3;
  --green-border:#c3deca;
  --white:       #ffffff;
  --gray-50:     #f9fafb;
  --gray-100:    #f3f4f6;
  --gray-200:    #e5e7eb;
  --gray-400:    #9ca3af;
  --gray-600:    #4b5563;
  --gray-800:    #1f2937;
  --red:         #dc2626;
  --red-light:   #fef2f2;
  --amber:       #d97706;
  --amber-light: #fffbeb;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow:      0 4px 12px rgba(0,0,0,.1);
  --shadow-lg:   0 10px 30px rgba(0,0,0,.15);
  --radius:      8px;
  --radius-lg:   12px;
  --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--gray-800);
  background: var(--gray-100);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--green-mid); }
img { max-width: 100%; height: auto; }

/* ── Layout ─────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  background: var(--green);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.sidebar-logo h1 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}
.sidebar-logo p {
  font-size: 12px;
  opacity: .7;
  margin-top: 2px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-user .avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.sidebar-user .name  { font-size: 14px; font-weight: 600; }
.sidebar-user .role  { font-size: 11px; opacity: .7; text-transform: uppercase; letter-spacing: .5px; }

.sidebar-nav { padding: 12px 0; flex: 1; }
.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: .55;
  padding: 8px 20px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,.85);
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}
.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,.15);
  color: #fff;
  text-decoration: none;
}
.nav-item svg { width: 18px; height: 18px; opacity: .8; }
.nav-item .badge {
  margin-left: auto;
  background: var(--green-light);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-footer a {
  color: rgba(255,255,255,.7);
  font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
.sidebar-footer a:hover { color: #fff; }

/* ── Main Content ──────────────────────────────────────── */
.main-content {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 18px; font-weight: 600; color: var(--gray-800); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.page-body { padding: 28px 32px; flex: 1; }
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h2 { font-size: 22px; font-weight: 700; color: var(--gray-800); }
.page-header p  { font-size: 14px; color: var(--gray-600); margin-top: 2px; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 16px; font-weight: 600; }
.card-body { padding: 20px; }
.card-footer {
  padding: 14px 20px;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
}

/* ── Stats ──────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--green);
}
.stat-card.amber { border-left-color: var(--amber); }
.stat-card.red   { border-left-color: var(--red); }
.stat-number { font-size: 32px; font-weight: 700; color: var(--green); line-height: 1; }
.stat-card.amber .stat-number { color: var(--amber); }
.stat-card.red   .stat-number { color: var(--red); }
.stat-label  { font-size: 13px; color: var(--gray-600); margin-top: 6px; }

/* ── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table thead th {
  background: var(--green);
  color: #fff;
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}
.data-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--green-pale); }

/* ── Badges / Pills ─────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-green  { background: #dcfce7; color: #166534; }
.badge-amber  { background: #fef9c3; color: #854d0e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-gray   { background: var(--gray-200); color: var(--gray-600); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, transform .1s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary  { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-mid); color: #fff; text-decoration: none; }
.btn-outline  { background: transparent; color: var(--green); border: 2px solid var(--green); }
.btn-outline:hover { background: var(--green-pale); text-decoration: none; }
.btn-danger   { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; text-decoration: none; }
.btn-ghost    { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); text-decoration: none; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700, #374151);
  margin-bottom: 6px;
}
.form-group .hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

input[type=text], input[type=email], input[type=password],
input[type=date], input[type=tel], input[type=number],
select, textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font);
  color: var(--gray-800);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30,86,49,.12);
}
input.error, select.error, textarea.error { border-color: var(--red); }
textarea { resize: vertical; min-height: 80px; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.17l3.71-3.94a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 36px; }

.checkbox-group { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-group input[type=checkbox] { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; accent-color: var(--green); }
.checkbox-group label { font-size: 14px; font-weight: 400; margin-bottom: 0; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
  border-left: 4px solid;
}
.alert-success { background: #dcfce7; border-color: #16a34a; color: #166534; }
.alert-error   { background: #fee2e2; border-color: var(--red);  color: #991b1b; }
.alert-warning { background: var(--amber-light); border-color: var(--amber); color: #92400e; }
.alert-info    { background: #dbeafe; border-color: #3b82f6; color: #1e40af; }

/* ── Auth Pages ──────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}
.auth-card .auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-card .auth-logo h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--green);
  line-height: 1.3;
}
.auth-card .auth-logo p {
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 4px;
}
.auth-card h2 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.auth-card p.subtitle { font-size: 14px; color: var(--gray-600); margin-bottom: 24px; }

/* ── Form Fill Page ──────────────────────────────────────── */
.form-fill-page { max-width: 860px; margin: 0 auto; }
.form-section {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}
.form-section-header {
  background: var(--green);
  color: #fff;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 15px;
}
.form-section-body { padding: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.sig-box {
  border: 2px dashed var(--green-border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.sig-box:hover { background: var(--green-pale); border-color: var(--green); }
.sig-box canvas { display: block; margin: 0 auto; border: 1px solid var(--gray-200); border-radius: 4px; touch-action: none; }

/* ── Progress Bar ────────────────────────────────────────── */
.progress-bar { height: 6px; background: var(--gray-200); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 99px; transition: width .4s; }

/* ── Packet Progress ─────────────────────────────────────── */
.packet-steps {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
}
.packet-step {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
}
.packet-step::after {
  content: '';
  position: absolute;
  right: 0; top: 50%;
  width: calc(100% - 32px);
  height: 2px;
  background: var(--gray-200);
  transform: translateY(-50%);
  z-index: 0;
  margin-left: 32px;
}
.packet-step:last-child::after { display: none; }
.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--gray-400);
  z-index: 1;
  flex-shrink: 0;
}
.packet-step.done .step-dot  { background: var(--green); border-color: var(--green); color: #fff; }
.packet-step.active .step-dot { border-color: var(--green); color: var(--green); }
.packet-step.done::after { background: var(--green); }

/* ── Mobile ──────────────────────────────────────────────── */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-260px); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .page-body { padding: 16px; }
  .hamburger { display: flex; align-items: center; }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 99;
  }
  .sidebar-overlay.show { display: block; }
}

/* ── Utilities ───────────────────────────────────────────── */
.text-green { color: var(--green); }
.text-muted { color: var(--gray-600); }
.text-sm    { font-size: 13px; }
.text-xs    { font-size: 12px; }
.fw-600     { font-weight: 600; }
.fw-700     { font-weight: 700; }
.mt-4  { margin-top: 4px;  }
.mt-8  { margin-top: 8px;  }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0  { margin-bottom: 0; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.justify-end { justify-content: flex-end; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }
