/* ============================================================
   Taxy Platform — Brand CSS
   Colors: Midnight Blue #0A1F44 | Teal #00C2A8 | Gray #6C757D | Violet #5F4B8B
   ============================================================ */

/* ── Tier gate / upgrade teaser ───────────────────────────────────────────── */
.tier-gate {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
}
.tier-gate-blur {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
  opacity: 0.55;
}
.tier-gate-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 31, 68, 0.72);
  backdrop-filter: blur(2px);
  border-radius: 10px;
  padding: 24px 20px;
  text-align: center;
  color: #fff;
  z-index: 10;
}
.tier-gate-overlay .tg-lock  { font-size: 2rem; margin-bottom: 8px; }
.tier-gate-overlay .tg-title { font-family: 'Montserrat', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.tier-gate-overlay .tg-sub   { font-size: 0.78rem; opacity: 0.85; margin-bottom: 14px; }
.tier-gate-overlay .tg-features { list-style: none; padding: 0; margin: 0 0 16px; font-size: 0.78rem; opacity: 0.9; }
.tier-gate-overlay .tg-features li::before { content: "✓ "; }
.tier-gate-overlay .tg-btn {
  display: inline-block;
  padding: 8px 22px;
  background: var(--brand-teal);
  color: var(--brand-midnight);
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
  transition: opacity 0.15s;
}
.tier-gate-overlay .tg-btn:hover { opacity: 0.88; color: var(--brand-midnight); text-decoration: none; }
/* Locked nav tab pill */
.nav-tab-locked {
  opacity: 0.55;
  cursor: default;
  position: relative;
}
.nav-tab-locked .lock-badge {
  font-size: 0.6rem;
  background: var(--brand-violet);
  color: #fff;
  border-radius: 10px;
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: middle;
}
/* Upgrade interest page */
.upgrade-tier-card {
  border: 2px solid var(--brand-border);
  border-radius: 12px;
  padding: 24px 20px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  height: 100%;
}
.upgrade-tier-card.current-plan { border-color: var(--brand-teal); }
.upgrade-tier-card.highlight     { border-color: var(--brand-midnight); box-shadow: 0 4px 18px rgba(10,31,68,0.12); }
.upgrade-tier-card .tier-name    { font-family: 'Montserrat', sans-serif; font-size: 1.1rem; font-weight: 700; }
.upgrade-tier-card .tier-price   { font-size: 1.6rem; font-weight: 700; color: var(--brand-midnight); }
.upgrade-tier-card .tier-features { list-style: none; padding: 0; margin: 12px 0 0; font-size: 0.82rem; color: var(--brand-gray); }
.upgrade-tier-card .tier-features li { padding: 4px 0; border-bottom: 1px solid var(--brand-border); }
.upgrade-tier-card .tier-features li::before { content: "✓  "; color: var(--brand-teal-a11y); font-weight: 700; }

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700&family=Roboto:wght@400;500&display=swap');

:root {
  --brand-midnight : #0A1F44;
  --brand-teal     : #00C2A8;         /* decorative only — do not use as text on white */
  --brand-teal-a11y: #006B60;         /* 508-compliant teal for text/interactive elements */
  --brand-gray     : #545B64;         /* was #6C757D (4.36:1 fail) — now 6.87:1 on white */
  --brand-violet   : #5F4B8B;
  --brand-light    : #F4F7FB;
  --brand-border   : #E2E8F0;
}

body { font-family: 'Roboto', sans-serif; background: var(--brand-light); color: #1a2233; }

/* ── Topbar ── */
.taxy-topbar {
  background: var(--brand-midnight);
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.taxy-brand {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.5px;
}
.taxy-brand span { color: var(--brand-teal); }
.taxy-brand:hover { color: #fff; text-decoration: none; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.btn-nav {
  color: rgba(255,255,255,0.75);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.btn-nav:hover { background: rgba(255,255,255,0.1); color: #fff; }
.btn-nav.active { background: var(--brand-teal-a11y); color: #fff; }
.btn-nav.btn-logout { color: rgba(255,255,255,0.5); }
.btn-nav.btn-logout:hover { background: rgba(255,0,0,0.15); color: #f88; }

/* ── Page wrapper ── */
.page-wrap { max-width: 1200px; margin: 0 auto; padding: 2rem 1.25rem; }

/* ── Section cards ── */
.section-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--brand-border);
  border-left: 4px solid var(--brand-midnight);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand-midnight);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.section-sub { font-size: 0.78rem; color: var(--brand-gray); }

/* ── KPI cards ── */
.kpi-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--brand-border);
  padding: 1.1rem 1.25rem;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.kpi-card:hover { border-color: var(--brand-teal); box-shadow: 0 2px 12px rgba(0,194,168,0.08); }
.kpi-value { font-size: 1.6rem; font-weight: 700; color: var(--brand-midnight); line-height: 1.1; }
.kpi-label { font-size: 0.72rem; color: var(--brand-gray); text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }

/* ── Small command-center KPI cards ── */
.kpi-card-sm { padding: 0.65rem 0.9rem; text-align: left; }
.kpi-value-sm { font-size: 1.35rem; font-weight: 800; font-family: 'Montserrat', sans-serif; line-height: 1.1; }
.kpi-sub { font-size: 0.68rem; color: var(--brand-gray); margin-top: 2px; }
.kpi-alert { border-color: #ef9a9a !important; background: #fff8f8; }
.kpi-warm  { border-color: #ffcc80 !important; background: #fffbf5; }

/* ── Tier badges ── */
.badge-ledger  { background: #e8f4f8; color: #1565c0; }
.badge-advisor { background: #f3f0fa; color: var(--brand-violet); }
.badge-partner { background: #e8faf6; color: #00796b; }

/* ── Status badges ── */
.status-not_started       { background: #f5f5f5;  color: #545B64; } /* was #777 (4.11:1 fail) */
.status-in_progress       { background: #e3f2fd;  color: #1565c0; }
.status-ready_for_review  { background: #fff9c4;  color: #7a5200; } /* was #f57f17 (2.47:1 fail) */
.status-changes_requested { background: #fce4ec;  color: #c62828; }
.status-finalized         { background: #e8f5e9;  color: #2e7d32; }

/* ── Progress bar ── */
.progress { height: 8px; border-radius: 4px; background: var(--brand-border); }
.progress-bar { background: var(--brand-teal); border-radius: 4px; transition: width 0.4s ease; }

/* ── CPA disclaimer ── */
.cpa-disclaimer {
  background: #fffbea;
  border-left: 4px solid #f9a825;
  border-radius: 4px;
  padding: 10px 16px;
  font-size: 0.78rem;
  color: #7a6000;
  margin-bottom: 1rem;
}

/* ── Tables ── */
.taxy-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.taxy-table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-gray); border-bottom: 2px solid var(--brand-border); padding: 8px 12px; text-align: left; }
.taxy-table td { padding: 10px 12px; border-bottom: 1px solid var(--brand-border); vertical-align: middle; }
.taxy-table tr:last-child td { border-bottom: none; }
.taxy-table tr:hover td { background: #f8fafc; }

/* ── Kanban ── */
.kanban-board { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; }
.kanban-col { min-width: 200px; flex: 1; background: #f4f7fb; border-radius: 8px; padding: 12px; }
.kanban-col-header { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-gray); margin-bottom: 10px; }
.kanban-card {
  background: #fff;
  border-radius: 6px;
  border: 1px solid var(--brand-border);
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.kanban-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

/* ── Onboarding steps ── */
.step-indicator { display: flex; gap: 8px; margin-bottom: 2rem; }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-border); color: var(--brand-gray);
  font-size: 0.78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.step-dot.active { background: var(--brand-teal); color: #fff; }
.step-dot.done   { background: var(--brand-midnight); color: #fff; }
.step-line { flex: 1; height: 2px; background: var(--brand-border); align-self: center; }

/* ── Flag modal ── */
.flag-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--brand-midnight);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 10px 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(10,31,68,0.25);
  z-index: 999;
  transition: background 0.15s;
}
.flag-btn:hover { background: var(--brand-violet); }

/* ── Utilities ── */
.text-teal   { color: var(--brand-teal-a11y) !important; } /* accessible teal, not decorative */
.text-violet { color: var(--brand-violet) !important; }
.text-midnight { color: var(--brand-midnight) !important; }
.bg-teal-soft   { background: rgba(0,194,168,0.08); }
.bg-violet-soft { background: rgba(95,75,139,0.07); }
.border-teal    { border-color: var(--brand-teal) !important; }

.src-row { border-bottom: 1px solid var(--brand-border); padding: 8px 0; }
.src-row:last-child { border-bottom: none; }

/* ── Mobile nav ── */
.taxy-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 6px;
}
.taxy-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
  transition: background 0.15s;
}
.taxy-hamburger:hover span { background: #fff; }
@media (max-width: 767.98px) {
  .taxy-hamburger { display: flex; }
  .taxy-topbar { flex-wrap: wrap; height: auto; min-height: 56px; padding: 0 1rem; }
  .taxy-topbar > .taxy-brand { padding: 14px 0; }

  /* ── Touch targets: ensure minimum 44px on mobile (WCAG 2.5.5) ── */
  .btn-sm {
    padding: 10px 14px !important;
    min-height: 44px !important;
    font-size: 0.82rem !important;
  }
  .nav-link {
    padding: 12px 16px !important;
    min-height: 44px !important;
  }
  /* Pill-style year/filter buttons that use custom inline padding */
  .btn[style*="padding:3px"],
  .btn[style*="padding: 3px"],
  .btn[style*="padding:5px"],
  .btn[style*="padding: 5px"],
  .btn[style*="padding:6px"],
  .btn[style*="padding: 6px"] {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    min-height: 44px !important;
  }

  /* ── iOS zoom prevention: inputs must be 16px+ to prevent auto-zoom ── */
  input,
  textarea,
  select,
  .form-control,
  .form-select,
  .form-control-sm,
  .form-select-sm {
    font-size: 16px !important;
  }

  /* ── Page padding: tighter on small phones ── */
  .page-wrap { padding: 1rem 0.75rem; }

  /* ── Section cards: reduce side padding on mobile ── */
  .section-card { padding: 1rem 1rem; }

  /* ── Modal: anchor to top so soft keyboard doesn't push it off-screen ── */
  .modal-dialog-centered {
    align-items: flex-start !important;
    min-height: auto !important;
    margin-top: 1rem !important;
  }

  /* ── Charts: cap height so they don't dominate small screens ── */
  canvas[id$="Chart"] {
    max-height: 180px !important;
  }

  /* ── Font size floor: 14px body, 13px labels ── */
  body { font-size: 14px; }
  .section-card,
  .section-card p,
  .section-card li,
  .page-wrap p,
  .page-wrap li { font-size: 0.875rem; }
  /* Inline tiny labels (badges, table headers, helper text) — floor at 13px */
  .badge { font-size: 0.8125rem !important; }
  /* Small helper / metadata text — floor at 13px */
  [style*="font-size:0.6"],
  [style*="font-size: 0.6"],
  [style*="font-size:0.7"],
  [style*="font-size: 0.7"] {
    font-size: 0.8125rem !important;
  }
}
.taxy-mobile-nav {
  background: var(--brand-midnight);
  display: flex;
  flex-direction: column;
  padding: 6px 0 10px;
  position: sticky;
  top: 56px;
  z-index: 999;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.taxy-mobile-link {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 11px 20px;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.taxy-mobile-link:hover { background: rgba(255,255,255,0.07); color: #fff; }
.taxy-mobile-link.active { color: #fff; background: rgba(0,194,168,0.18); border-left: 3px solid var(--brand-teal); padding-left: 17px; }
.taxy-mobile-link.btn-logout { color: rgba(255,100,100,0.75); }
.taxy-mobile-link.btn-logout:hover { background: rgba(255,0,0,0.1); color: #f88; }

/* ── 508: Bootstrap overrides ── */
.text-muted { color: var(--brand-gray) !important; } /* overrides Bootstrap #6c757d (4.36:1 fail) */

/* ── Help icon ── */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #dff3f0; /* soft teal wash — visible without being distracting */
  color: var(--brand-teal-a11y);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid var(--brand-teal-a11y);
  padding: 0;
  vertical-align: middle;
  margin-left: 6px;
  transition: background 0.15s, color 0.15s;
}
.help-icon:hover {
  background: var(--brand-teal-a11y); /* 6.42:1 white on #006B60 */
  color: #fff;
}
.help-icon:focus-visible {
  background: var(--brand-teal-a11y);
  color: #fff;
  outline: 2px solid var(--brand-teal-a11y);
  outline-offset: 2px;
}

/* ── Milestone Stepper ── */
.milestone-stepper {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.milestone-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}
.milestone-dot {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  z-index: 1;
}
.milestone-done .milestone-dot {
  background: var(--brand-teal-a11y);  /* 6.42:1 white on #006B60 */
  color: #fff;
  border: 2px solid var(--brand-teal-a11y);
}
.milestone-active .milestone-dot {
  background: #fff;
  color: var(--brand-teal-a11y);       /* 6.42:1 on white */
  border: 2.5px solid var(--brand-teal-a11y);
  box-shadow: 0 0 0 4px rgba(0,107,96,0.12);
}
.milestone-upcoming .milestone-dot {
  background: #e9ecef;
  color: #5a5a5a;   /* 5.74:1 on #e9ecef — passes AA */
  border: 2px solid #c8cdd3;
}
.milestone-body {
  padding-bottom: 4px;
  padding-top: 4px;
}
.milestone-label {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
}
.milestone-done .milestone-label    { color: var(--brand-teal-a11y); } /* 6.42:1 on white */
.milestone-active .milestone-label  { color: var(--brand-midnight); }
.milestone-upcoming .milestone-label { color: #717171; } /* 4.88:1 on white — passes AA */
.milestone-desc {
  font-size: 0.75rem;
  color: var(--brand-gray);
  margin-top: 2px;
}
.milestone-connector {
  width: 2px;
  height: 18px;
  background: #e0e0e0;
  margin-left: 13px;
}
.milestone-connector-done {
  background: var(--brand-teal-a11y);  /* matches updated milestone dot */
}

/* ── Skip to main content (WCAG 2.4.1 / 508) ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 9999;
  background: var(--brand-midnight);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 0 0 6px 6px;
  text-decoration: none;
}
.skip-link:focus {
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  height: auto;
}

/* ── Accordion chevron rotation ── */
.acc-chevron {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--brand-gray);
  transition: transform 0.2s ease;
  line-height: 1;
}
[aria-expanded="true"] .acc-chevron {
  transform: rotate(180deg);
}

/* ── Accordion card header button variants ── */
.acc-btn-teal {
  background: #f0fdfc;
  border-left: 4px solid var(--brand-teal-a11y) !important;
  cursor: pointer;
}
.acc-btn-violet {
  background: #faf5ff;
  border-left: 4px solid var(--brand-violet) !important;
  cursor: pointer;
}

/* ── Milestone stepper — violet variant (Tax Summary) ── */
.milestone-stepper--violet .milestone-done .milestone-dot {
  background: var(--brand-violet);
  color: #fff;
  border-color: var(--brand-violet);
}
.milestone-stepper--violet .milestone-active .milestone-dot {
  background: #fff;
  color: var(--brand-violet);   /* #5F4B8B — 7.24:1 on white, passes AA */
  border-color: var(--brand-violet);
  box-shadow: 0 0 0 4px rgba(95,75,139,0.12);
}
.milestone-stepper--violet .milestone-done .milestone-label {
  color: var(--brand-violet);
}
.milestone-stepper--violet .milestone-active .milestone-label {
  color: var(--brand-midnight);
}
.milestone-stepper--violet .milestone-connector-done {
  background: var(--brand-violet);
}

/* ── Reports tab nav: horizontal scroll on mobile instead of wrapping ── */
@media (max-width: 767.98px) {
  ul.taxy-tab-nav {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  ul.taxy-tab-nav::-webkit-scrollbar { display: none; }
  ul.taxy-tab-nav .nav-item { flex-shrink: 0; }
  ul.taxy-tab-nav .nav-link { white-space: nowrap; font-size: 0.875rem !important; padding: 10px 14px !important; min-height: 44px !important; }
}

/* ── Month chips grid ── */
.month-chips-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 1rem;
}
@media (max-width: 767.98px) {
  .month-chips-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .month-chips-grid > div {
    min-width: 0;
  }
  .month-chips-grid button {
    width: 100%;
    min-height: 44px !important;
    font-size: 0.8125rem !important;
  }
  .month-chips-grid span {
    font-size: 0.8125rem !important;
  }
}

/* ── Mobile stacked table (compliance deadlines) ── */
/* On mobile, each row becomes a card; headers are hidden; td::before shows the label */
@media (max-width: 767.98px) {
  table.taxy-table-stacked,
  .taxy-table-stacked tbody,
  .taxy-table-stacked thead,
  .taxy-table-stacked tr,
  .taxy-table-stacked td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .taxy-table-stacked thead { display: none; }
  .taxy-table-stacked tbody tr {
    border: 1px solid var(--brand-border);
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #fff;
  }
  .taxy-table-stacked tbody tr:hover td { background: transparent; }
  .taxy-table-stacked td {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: none !important;
    padding: 4px 0;
    font-size: 0.875rem;
    width: 100%;
  }
  .taxy-table-stacked td::before {
    content: attr(data-label);
    font-size: 0.65rem;
    color: var(--brand-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    min-width: 68px;
    padding-top: 2px;
    font-weight: 600;
  }
  /* Hide columns that aren't useful on mobile (Notes) */
  .taxy-table-stacked td.col-hide-mobile { display: none; }
  /* Actions cell — full width, no label */
  .taxy-table-stacked td.col-actions::before { display: none; }
  .taxy-table-stacked td.col-actions { padding-top: 8px; border-top: 1px solid var(--brand-border) !important; margin-top: 4px; }
}

/* ── Workstream section dividers ── */
.ws-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand-gray);
  border-bottom: 1px solid var(--brand-border);
  padding-bottom: 5px;
  margin-bottom: 12px;
  margin-top: 20px;
}
.ws-section-label:first-child { margin-top: 0; }
