/* Modern reset + design tokens */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root{
  --bg: #f0f4ff;
  --bg-mesh: radial-gradient(900px 500px at 15% 0%, rgba(79, 70, 229, 0.12), transparent 55%),
    radial-gradient(800px 480px at 90% 10%, rgba(217, 119, 6, 0.08), transparent 50%),
    radial-gradient(600px 400px at 50% 100%, rgba(13, 148, 136, 0.09), transparent 45%);
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --muted: #475569;
  --border: rgba(15, 23, 42, 0.12);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.10);
  --radius: 14px;
  --radius-sm: 10px;

  --primary: #4f46e5;
  --primary-2: #6d28d9;
  --primary-hover: #4338ca;
  --accent-teal: #0d9488;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --nav-bg: linear-gradient(105deg, #1e1b4b 0%, #312e81 42%, #4c1d95 100%);
  --nav-border: rgba(255, 255, 255, 0.12);
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --focus: rgba(79, 70, 229, 0.18);
}

html { color-scheme: light; }

body{
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: var(--bg-mesh), var(--bg);
  min-height: 100vh;
  color: var(--text);
  line-height: 1.5;
}

.page{
  width: min(1180px, calc(100% - 32px));
  margin: 26px auto 60px;
}

/* Navigation — grid layout so brand + links stay aligned on all widths */
.site-nav{
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.18);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.nav-inner{
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 0;
  padding: 12px 0;
  min-height: 56px;
}

.nav-brand{
  grid-column: 1;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff !important;
  font-weight: 800;
  letter-spacing: 0.02em;
  min-width: 0;
}
.nav-brand:hover{
  opacity: 0.92;
}
.nav-brand-mark{
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 900;
  color: #1e1b4b;
  background: linear-gradient(145deg, #fde68a 0%, #fbbf24 45%, #f59e0b 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.nav-brand-text{
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.nav-brand-title{
  font-size: 1.05rem;
  text-transform: none;
  letter-spacing: 0;
}
.nav-brand-sub{
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.88;
}

.nav-toggle{
  display: none;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 12px;
  background: rgba(255,255,255,0.1);
  cursor: pointer;
  color: #fff;
  z-index: 2;
}
.nav-toggle:focus-visible{
  outline: 2px solid rgba(253, 224, 71, 0.9);
  outline-offset: 2px;
}
.nav-toggle-bar{
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.site-nav.is-open .nav-toggle-bar:nth-child(1){
  transform: translateY(7px) rotate(45deg);
}
.site-nav.is-open .nav-toggle-bar:nth-child(2){
  opacity: 0;
}
.site-nav.is-open .nav-toggle-bar:nth-child(3){
  transform: translateY(-7px) rotate(-45deg);
}

.nav-menu{
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.nav-links{
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-links--account{
  padding-left: 10px;
  margin-left: 4px;
  border-left: 1px solid rgba(255,255,255,0.22);
}

.site-nav .nav-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 650;
  font-size: 0.9375rem;
  line-height: 1.2;
  color: #f8fafc !important;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.site-nav .nav-link:hover{
  background: rgba(255,255,255,0.14);
  color: #fff !important;
}
.site-nav .nav-link--active{
  background: rgba(255,255,255,0.2);
  color: #fff !important;
  font-weight: 800;
}
.site-nav .nav-link--cta{
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #1e1b4b !important;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
  padding-left: 16px;
  padding-right: 16px;
}
.site-nav .nav-link--cta:hover{
  background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
  color: #1e1b4b !important;
}
.site-nav .nav-link--register{
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.06);
}
.site-nav .nav-link--register:hover{
  background: rgba(255,255,255,0.12);
  color: #fff !important;
}
.site-nav .nav-link--danger{
  color: #fecdd3 !important;
}
.site-nav .nav-link--danger:hover{
  background: rgba(220, 38, 38, 0.4) !important;
  color: #fff !important;
}
.site-nav a.nav-link:focus-visible{
  outline: 2px solid rgba(253, 224, 71, 0.95);
  outline-offset: 2px;
}

@media (max-width: 900px){
  .nav-inner{
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: start;
  }
  .nav-brand{
    grid-column: 1;
    grid-row: 1;
    padding-right: 8px;
  }
  .nav-toggle{
    display: flex;
  }
  .nav-menu{
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 14px 0 6px;
    margin-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.18);
    max-width: none;
  }
  .site-nav.is-open .nav-menu{
    display: flex;
  }
  .nav-links{
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 2px;
  }
  .nav-links .nav-link{
    justify-content: flex-start;
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    white-space: normal;
  }
  .nav-links--account{
    padding-left: 0;
    margin-left: 0;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 10px;
    margin-top: 8px;
  }
}

/* Legacy popup login (if still present in older templates) */
#topbar.nav-links li a,
#topbar li a{
  color: rgba(255,255,255,0.92);
}

/* Typography */
h1, h2, h3, h4 { color: var(--text); }
h1{ font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 14px; }
h2{ font-size: 1.25rem; font-weight: 800; margin: 0 0 10px; }
h3{ font-size: 1.05rem; font-weight: 800; margin: 0 0 8px; }
h4{ font-size: 0.98rem; font-weight: 750; margin: 0 0 8px; }

.page-title{
  margin: 0 0 18px;
  font-size: 1.9rem;
}

.muted, .cell-muted{ color: var(--muted); }

/* Section Styles */
section {
  background: var(--surface);
  padding: 26px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  box-sizing: border-box;
  max-width: 100%;
  overflow-x: hidden;
}

/* Popup Styles */
.showPopup {
  visibility: visible !important;
}

.popuptext {
  display: none;
  width: 380px;
  border-radius: 14px;
  position: absolute;
  background: var(--surface);
  color: var(--text);
  padding: 18px;
  top: 54px;
  right: 0;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  border: 1px solid var(--border);
  z-index: 1001;
}

.popuptext a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.popuptext a:hover {
  text-decoration: underline;
}

.popup {
  position: relative;
}

.popup-title{
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 850;
}
.popup-helper{
  margin: 6px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
}

/* Form Styles */
form{ display: flex; flex-direction: column; gap: 12px; }

.auth-wrap{
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
}

.auth-card{
  width: min(560px, 100%);
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
  padding: 24px;
}

.auth-header{
  margin-bottom: 14px;
}

.auth-header h1{
  margin-bottom: 6px;
}

.auth-header p{
  margin: 0;
}

.auth-form{
  gap: 14px;
}

.auth-field{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label{
  font-weight: 700;
  color: var(--text);
}

.auth-field small{
  color: var(--muted);
}

.field-errors p,
.form-error-box p{
  margin: 0;
}

.field-errors{
  color: #b91c1c;
  font-size: 0.92rem;
}

.form-error-box{
  border: 1px solid rgba(185, 28, 28, 0.25);
  background: rgba(254, 226, 226, 0.9);
  color: #991b1b;
  border-radius: 12px;
  padding: 10px 12px;
}

.auth-footer{
  text-align: center;
  margin: 4px 0 0;
  font-size: 0.95rem;
}

.auth-footer a{
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.auth-footer a:hover{
  text-decoration: underline;
}

.label{
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-weight: 750;
  font-size: 0.92rem;
}

input, select, textarea{
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  width: 100%;
}

textarea{ min-height: 110px; resize: vertical; }

input:focus, select:focus, textarea:focus{
  outline: none;
  border-color: rgba(79, 70, 229, 0.55);
  box-shadow: 0 0 0 4px var(--focus);
}

.form-group{ margin: 0; }
.loginform{ gap: 12px; }

.loginform {
  display: flex;
  flex-direction: column;
}

.form-group {
  margin-bottom: 1rem;
}

/* Button Styles */
button, .buttonASmall, .buttonMed, .btn{
  appearance: none;
  border: 1px solid transparent;
  padding: 11px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.98rem;
  font-weight: 750;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:hover, .buttonASmall:hover, .buttonMed:hover, .btn:hover{
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--primary-hover) 0%, #5b21b6 100%);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14);
}

.btn{ margin: 0; }
.btn-block{ width: 100%; }
.btn-secondary{
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover{
  background: var(--surface-2);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10);
}
.btn-danger{
  background: linear-gradient(135deg, var(--danger) 0%, #ef4444 100%);
}
.btn-danger:hover{
  background: linear-gradient(135deg, var(--danger-hover) 0%, #dc2626 100%);
}

.buttonA {
  padding: 80px 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border: 0;
  margin: 20px;
  font-size: 1.8rem;
  display: inline-block;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  text-align: center;
  min-width: 300px;
}

.buttonA:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
}

.linkbutton {
  padding: 0;
  border-radius: 12px;
  background: transparent;
  width: fit-content;
  display: inline-block;
  box-shadow: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.linkbutton:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.linkbutton a {
  color: #fff;
  text-decoration: none;
  justify-content: center;
  display: inline-flex;
  font-weight: 750;
  padding: 11px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
}

/* Table Styles */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 20px 0;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.results table th, .results table td {
  border: 1px solid #e0e0e0;
  padding: 15px 20px;
  text-align: left;
}

table th {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

table td {
  border-bottom: 1px solid #f0f0f0;
}

table tr:hover {
  background-color: rgba(79, 70, 229, 0.05);
  transition: background-color 0.2s ease;
}

table tr a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

table tr a:hover {
  text-decoration: underline;
}

/* Revamped Results Tables (shared) */
.table-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin: 20px 0;
  border: 1px solid var(--border);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.06) 0%, rgba(109, 40, 217, 0.06) 100%);
}

.table-toolbar .left,
.table-toolbar .right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.table-toolbar input[type="text"],
.table-toolbar select {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 1rem;
  min-width: 220px;
}

.table-toolbar input[type="text"]:focus,
.table-toolbar select:focus {
  border-color: rgba(79, 70, 229, 0.55);
  box-shadow: 0 0 0 4px var(--focus);
  outline: none;
}

.table-toolbar .meta {
  color: var(--muted);
  font-weight: 750;
  font-size: 0.95rem;
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  box-shadow: none;
  border-radius: 0;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.6px;
  padding: 14px 16px;
  white-space: nowrap;
}

.data-table thead th.sortable a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.data-table thead th.sortable a:hover {
  text-decoration: underline;
}

.data-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}

.data-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  vertical-align: middle;
}

.data-table tbody tr:nth-child(odd) {
  background: rgba(79, 70, 229, 0.03);
}

.data-table tbody tr:hover {
  background: rgba(79, 70, 229, 0.07);
}

.data-table a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.data-table a:hover {
  text-decoration: underline;
}

.cell-muted {
  color: var(--muted);
  font-weight: 550;
  font-size: 0.93rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(79, 70, 229, 0.12);
  color: #3730a3;
}

.badge--gray {
  background: rgba(15, 23, 42, 0.08);
  color: #334155;
}

.badge--green {
  background: rgba(46, 204, 113, 0.15);
  color: #1f8a4c;
}

.badge--red {
  background: rgba(231, 76, 60, 0.15);
  color: #b23b30;
}

/* Clickable table rows */
.clickable-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.clickable-row:hover {
  background-color: #f1f4ff !important;
}

/* Alert Styles */
.alert {
  display: flex;
  justify-content: center;
  margin: 8px 0;
  padding: 12px 14px;
  background: rgba(79, 70, 229, 0.10);
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: 12px;
  color: #3730a3;
}

.alert button {
  padding: 10px 15px;
}

.alert strong {
  margin-top: 0;
}

/* Utility Styles */
#boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

#boxes p {
  width: 20px;
  height: 20px;
}

.input {
  display: grid;
  grid-template-columns: auto auto;
  gap: 15px;
}

.sectionw2 {
  display: flex;
  justify-content: center;
}

#fedtaxpopup {
  position: absolute;
  top: 300px;
  width: 200px;
}

.w2btn {
  margin: 20px;
}

/* List Navigation Styles */
.listNav {
  background-color: transparent;
  float: none;
  margin: 30px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.listNav a:hover {
  background-color: transparent;
  color: white;
}

.listNavLi {
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  margin: 0;
  width: fit-content;
  min-width: 200px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.listNavLi:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.listNav li {
  float: none;
  list-style: none;
}

.listNav p {
  margin: 15px 20px;
  color: white;
}

.listNav a {
  text-decoration: none;
  display: block;
}

/* Additional improvements */
p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

a {
  transition: color 0.15s ease, background-color 0.15s ease;
}

/* Honeypot field (contact form) — hidden from users */
.contact-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Improve focus states for accessibility */
button:focus,
input:focus,
a:focus {
  outline: 2px solid rgba(79, 70, 229, 0.65);
  outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
  #topbar {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
  }
  
  #topbar li a {
    padding: 10px 12px;
    font-size: 0.95rem;
  }
  
  .page{ width: calc(100% - 16px) !important; margin: 10px auto 20px !important; max-width: 100% !important; box-sizing: border-box !important; }
  section { 
    padding: 8px !important; 
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }
  
  .buttonA {
    padding: 50px 40px;
    font-size: 1.4rem;
    min-width: 250px;
  }
  
  h1 { font-size: 1.5rem; }
  
  .popuptext {
    width: 90%;
    right: 5%;
    left: 5%;
  }
  
  table {
    font-size: 0.9rem;
  }
  
  table th,
  table td {
    padding: 10px 8px;
  }

  .table-toolbar input[type="text"],
  .table-toolbar select {
    min-width: 160px;
    width: 100%;
  }

  .auth-card{
    padding: 16px;
    border-radius: 14px;
  }
}