/* =============================================
   FortifyEM — Main Stylesheet
   fortifyem.com
   ============================================= */

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

:root {
  --ch: #1C1F23;
  --ch2: #2A2E34;
  --ch3: #3A3F47;
  --red: #C0392B;
  --red2: #E03E2D;
  --red-bg: #FDECEA;
  --red-text: #7B1A13;
  --off: #F6F6F7;
  --white: #FFFFFF;
  --td: #1C1F23;
  --tm: #3D4148;
  --ts: #6B7280;
  --border: #E5E7EB;
  --ok: #1D9E75;
  --ok-bg: #ECFDF5;
  --ok-text: #065F46;
  --warn: #BA7517;
  --warn-bg: #FAEEDA;
  --warn-text: #633806;
  --info: #185FA5;
  --info-bg: #E6F1FB;
  --info-text: #0C447C;
  --purple: #534AB7;
  --purple-bg: #EEEDFE;
  --purple-text: #3C3489;
  --radius: 8px;
  --radius-lg: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--white);
  color: var(--td);
  font-size: 15px;
  line-height: 1.6;
}

/* ---- NAV ---- */
nav {
  background: var(--ch);
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo { display: flex; align-items: center; gap: 10px; cursor: default; }
.logo-mark {
  width: 32px; height: 32px;
  background: var(--red);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px;
}
.logo-name { font-size: 18px; font-weight: 600; color: #fff; letter-spacing: -0.3px; }
.logo-name span { color: var(--red2); }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-link {
  color: rgba(255,255,255,0.65);
  font-size: 13px; font-weight: 500;
  padding: 6px 12px; border-radius: 6px;
  cursor: pointer; border: none; background: none;
  transition: all 0.15s; text-decoration: none;
}
.nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-cta {
  background: var(--red); color: #fff;
  font-size: 13px; font-weight: 600;
  padding: 8px 18px; border-radius: 6px;
  border: none; cursor: pointer; margin-left: 6px;
  transition: background 0.15s;
}
.nav-cta:hover { background: var(--red2); }

/* ---- SECTIONS ---- */
section { display: none; }
section.active { display: block; }

/* ---- HERO ---- */
.hero {
  background: var(--ch);
  min-height: 90vh;
  display: flex; align-items: center;
  padding: 80px 36px;
  position: relative; overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; right: -60px; top: 50%;
  transform: translateY(-50%);
  width: 420px; height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(192,57,43,0.15);
  pointer-events: none;
}
.hero-content { max-width: 600px; position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(192,57,43,0.15);
  border: 1px solid rgba(192,57,43,0.35);
  color: #F5A49A;
  font-size: 11px; font-weight: 600;
  padding: 5px 12px; border-radius: 20px;
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 26px;
}
.hero-badge-dot { width: 6px; height: 6px; background: #F5A49A; border-radius: 50%; }
h1 { font-size: clamp(34px, 5vw, 54px); color: #fff; line-height: 1.1; margin-bottom: 18px; font-weight: 600; letter-spacing: -0.5px; }
h1 em { font-style: normal; color: var(--red2); }
.hero-sub { font-size: 17px; color: rgba(255,255,255,0.65); line-height: 1.7; margin-bottom: 36px; max-width: 500px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-primary {
  background: var(--red); color: #fff;
  font-weight: 600; font-size: 14px;
  padding: 12px 26px; border-radius: 8px;
  border: none; cursor: pointer; transition: background 0.15s;
  font-family: inherit;
}
.btn-primary:hover { background: var(--red2); }
.btn-outline {
  background: transparent; color: #fff;
  font-weight: 500; font-size: 14px;
  padding: 12px 26px; border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.3);
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.btn-outline:hover { border-color: rgba(255,255,255,0.65); background: rgba(255,255,255,0.06); }
.hero-stats { display: flex; gap: 36px; margin-top: 52px; padding-top: 36px; border-top: 1px solid rgba(255,255,255,0.1); }
.stat-num { font-size: 28px; font-weight: 600; color: #fff; }
.stat-label { font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 3px; }

/* ---- TYPOGRAPHY ---- */
.section-label { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--red); text-transform: uppercase; margin-bottom: 10px; }
.section-label.light { color: #F5A49A; }
h2 { font-size: clamp(26px, 4vw, 40px); color: var(--td); line-height: 1.2; margin-bottom: 14px; font-weight: 600; letter-spacing: -0.3px; }
h2.light { color: #fff; }
.section-sub { font-size: 16px; color: var(--ts); max-width: 500px; line-height: 1.65; margin-bottom: 48px; }
.section-sub.center { margin-left: auto; margin-right: auto; }

/* ---- LAYOUT ---- */
.container { max-width: 1060px; margin: 0 auto; }
.text-center { text-align: center; }
.text-center .section-sub { margin-left: auto; margin-right: auto; }

/* ---- WHY SECTION ---- */
.why-section { padding: 90px 36px; background: var(--white); }

/* ---- FEATURES ---- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px; max-width: 1060px; margin: 0 auto;
}
.feat-card {
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 26px;
  transition: border-color 0.15s;
}
.feat-card:hover { border-color: #d1d5db; }
.feat-icon { font-size: 24px; margin-bottom: 14px; }
.feat-title { font-size: 15px; font-weight: 600; color: var(--td); margin-bottom: 8px; }
.feat-desc { font-size: 13px; color: var(--ts); line-height: 1.65; }
.features-wrap { padding: 80px 36px; background: var(--off); }
.features-cta { padding: 56px 36px; background: var(--white); text-align: center; border-top: 1px solid var(--border); }
.features-cta h2 { margin-bottom: 12px; }
.features-cta p { color: var(--ts); margin-bottom: 24px; font-size: 15px; }

/* ---- CTA BAND ---- */
.cta-band { background: var(--ch); padding: 70px 36px; text-align: center; }
.cta-sub { color: rgba(255,255,255,0.55); font-size: 15px; margin-bottom: 28px; }

/* ---- PAGE HERO ---- */
.page-hero { background: var(--ch); padding: 80px 36px 60px; text-align: center; }
.page-hero-sub { color: rgba(255,255,255,0.55); font-size: 16px; max-width: 480px; margin: 0 auto; }

/* ---- PRICING ---- */
.pricing-wrap { padding: 90px 36px; background: var(--off); text-align: center; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px; max-width: 900px; margin: 0 auto;
}
.plan {
  border-radius: 16px; padding: 32px 28px;
  border: 1.5px solid var(--border);
  background: var(--white); position: relative;
  text-align: left;
}
.plan.featured { background: var(--ch); border-color: var(--ch); }
.plan-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 4px 12px; border-radius: 20px;
  letter-spacing: 0.06em; white-space: nowrap;
}
.plan-name { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ts); margin-bottom: 8px; }
.plan.featured .plan-name { color: rgba(255,255,255,0.5); }
.plan-price { font-size: 20px; font-weight: 700; color: var(--td); letter-spacing: -0.3px; line-height: 1.2; }
.plan.featured .plan-price { color: #fff; }
.plan-period { font-size: 13px; color: var(--ts); margin-top: 4px; margin-bottom: 24px; }
.plan.featured .plan-period { color: rgba(255,255,255,0.45); }
.plan-features { list-style: none; margin-bottom: 28px; }
.plan-features li { font-size: 13px; color: var(--tm); padding: 7px 0; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.plan.featured .plan-features li { color: rgba(255,255,255,0.75); border-bottom-color: rgba(255,255,255,0.08); }
.plan-features li::before { content: '✓'; color: var(--ok); font-weight: 700; font-size: 12px; flex-shrink: 0; }
.plan.featured .plan-features li::before { color: #F5A49A; }
.plan-btn {
  width: 100%; padding: 12px; border-radius: 8px;
  font-weight: 600; font-size: 14px; cursor: pointer;
  transition: all 0.15s;
  border: 1.5px solid var(--ch); background: transparent; color: var(--ch);
  font-family: inherit;
}
.plan-btn:hover { background: var(--ch); color: #fff; }
.plan.featured .plan-btn { background: var(--red); color: #fff; border-color: var(--red); }
.plan.featured .plan-btn:hover { background: var(--red2); border-color: var(--red2); }
.pricing-note { color: var(--ts); font-size: 13px; margin-top: 28px; padding-bottom: 40px; }

/* ---- PORTAL / FORMS ---- */
.portal-wrap {
  padding: 70px 36px; background: var(--off);
  min-height: 92vh; display: flex; align-items: center; justify-content: center;
}
.portal-box { max-width: 420px; width: 100%; }
.portal-box.wide { max-width: 540px; width: 100%; }
.portal-card {
  background: var(--white); border-radius: 18px;
  border: 1px solid var(--border); padding: 36px 32px;
}
.form-group { margin-bottom: 16px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--td); margin-bottom: 6px; letter-spacing: 0.02em; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], select, textarea {
  width: 100%; padding: 11px 13px;
  font-size: 14px; border: 1.5px solid var(--border);
  border-radius: 8px; background: var(--white);
  color: var(--td); transition: border-color 0.15s;
  outline: none; font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--red); }
textarea { resize: vertical; line-height: 1.5; min-height: 80px; }
.form-btn {
  width: 100%; padding: 12px;
  background: var(--ch); color: #fff;
  font-weight: 600; font-size: 14px;
  border: none; border-radius: 8px;
  cursor: pointer; transition: background 0.15s;
  margin-top: 6px; font-family: inherit;
}
.form-btn:hover { background: var(--ch2); }
.success-msg {
  background: var(--ok-bg); border: 1px solid #A7F3D0;
  color: var(--ok-text); border-radius: 8px;
  padding: 10px 14px; font-size: 13px;
  margin-bottom: 16px; display: none;
}
.success-msg.show { display: block; }
.tabs { display: flex; background: var(--off); border-radius: 8px; padding: 3px; gap: 3px; margin-bottom: 28px; }
.tab {
  flex: 1; padding: 8px; text-align: center;
  font-size: 13px; font-weight: 500;
  color: var(--ts); border-radius: 6px;
  cursor: pointer; border: none; background: none;
  transition: all 0.15s; font-family: inherit;
}
.tab.active { background: var(--white); color: var(--td); font-weight: 600; }

/* ---- FOOTER ---- */
footer { background: var(--ch); padding: 56px 36px 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px; max-width: 1060px; margin: 0 auto 44px; }
.footer-brand p { color: rgba(255,255,255,0.45); font-size: 13px; line-height: 1.65; margin-top: 12px; max-width: 260px; }
.footer-col h4 { color: rgba(255,255,255,0.4); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 14px; }
.footer-col a { display: block; color: rgba(255,255,255,0.65); font-size: 13px; text-decoration: none; margin-bottom: 9px; cursor: pointer; transition: color 0.15s; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 22px; display: flex; justify-content: space-between; align-items: center; max-width: 1060px; margin: 0 auto; font-size: 12px; color: rgba(255,255,255,0.35); }

/* ---- APP SHELL (app.html) ---- */
.app-shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 200px; flex-shrink: 0;
  background: var(--ch); display: flex;
  flex-direction: column; padding: 14px 0;
  overflow-y: auto;
}
.sidebar-logo { padding: 0 14px 14px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.sidebar-logo .logo-mark { width: 26px; height: 26px; font-size: 13px; }
.sidebar-logo .logo-name { font-size: 13px; }
.sb-county { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 1px; }
.nav-section { font-size: 9px; font-weight: 700; letter-spacing: 0.12em; color: rgba(255,255,255,0.3); text-transform: uppercase; padding: 10px 14px 3px; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 7px 14px; font-size: 12px; color: rgba(255,255,255,0.55); cursor: pointer; transition: all 0.12s; text-decoration: none; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(192,57,43,0.2); color: #fff; border-left: 2px solid var(--red); }
.nav-badge { background: var(--red); color: #fff; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 10px; margin-left: auto; }
.app-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--off); }
.app-topbar { height: 48px; background: var(--white); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 16px; gap: 10px; flex-shrink: 0; }
.app-topbar-title { font-size: 13px; font-weight: 600; flex: 1; }
.app-content { flex: 1; overflow-y: auto; padding: 14px; }

/* ---- SHARED COMPONENTS ---- */
.btn-sm {
  padding: 5px 10px; font-size: 11px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--white);
  color: var(--td); cursor: pointer; display: inline-flex;
  align-items: center; gap: 4px; transition: background 0.12s; font-family: inherit;
}
.btn-sm:hover { background: var(--off); }
.btn-sm.red { background: var(--red); color: #fff; border-color: var(--red); }
.btn-sm.red:hover { background: var(--red2); }
.btn-sm.ok { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok); }
.btn-sm.warn { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn); }
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.b-red { background: var(--red-bg); color: var(--red-text); }
.b-warn { background: var(--warn-bg); color: var(--warn-text); }
.b-info { background: var(--info-bg); color: var(--info-text); }
.b-ok { background: var(--ok-bg); color: var(--ok-text); }
.b-gray { background: var(--off); color: var(--ts); border: 1px solid var(--border); }
.b-purple { background: var(--purple-bg); color: var(--purple-text); }
.card { background: var(--white); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.card.editing { border: 1.5px solid var(--red); }
.card.pending { border-left: 3px solid var(--purple); }
.card-hd { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--off); }
.card-title { font-size: 13px; font-weight: 600; flex: 1; }
.card-body { padding: 12px 14px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-top: 1px solid var(--border); background: var(--off); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.stat-card .label { font-size: 11px; color: var(--ts); margin-bottom: 3px; }
.stat-card .value { font-size: 20px; font-weight: 600; }
.info-banner { background: var(--info-bg); border: 1px solid #B5D4F4; border-radius: 8px; padding: 9px 12px; font-size: 12px; color: var(--info-text); margin-bottom: 12px; }
.section-hd { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ts); margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.pills { display: flex; gap: 5px; }
.pill { padding: 3px 10px; border-radius: 20px; font-size: 11px; border: 1px solid var(--border); cursor: pointer; color: var(--ts); background: var(--white); transition: all 0.12s; font-family: inherit; }
.pill.active { background: var(--red); color: #fff; border-color: var(--red); }
.prog-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 5px; }
.prog-fill { height: 100%; border-radius: 2px; }
.pf-red { background: var(--red); }
.pf-ok { background: var(--ok); }
.pf-info { background: var(--info); }
.toast { background: var(--ch); color: #fff; border-radius: 8px; padding: 9px 13px; font-size: 12px; margin-bottom: 10px; display: none; align-items: center; gap: 8px; border-left: 3px solid var(--red); }
.toast.show { display: flex; }
.diff-wrap { background: var(--off); border-radius: 6px; padding: 9px; margin-bottom: 9px; font-size: 11px; line-height: 1.6; }
.diff-old { color: #991B1B; text-decoration: line-through; background: #FEE2E2; padding: 1px 3px; border-radius: 3px; }
.diff-new { color: #065F46; background: #D1FAE5; padding: 1px 3px; border-radius: 3px; font-weight: 500; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  nav { padding: 0 16px; }
  .nav-links .nav-link { display: none; }
  .hero { padding: 60px 20px; min-height: auto; }
  h1 { font-size: 32px; }
  .hero-stats { gap: 20px; }
  .features-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2,1fr); }
  .sidebar { width: 160px; }
}
