/* Tax module styles — scoped under .tax-app to avoid leaking into the
   Airbnb app's global CSS. Brand colors are passed in via CSS vars from
   the community record (--tax-brand-primary, --tax-brand-secondary). */

.tax-app {
  --tax-brand-primary: #1d3a6d;
  --tax-brand-secondary: #d62027;
  --tax-text: #0f172a;
  --tax-muted: #64748b;
  --tax-bg: #ffffff;
  --tax-bg-alt: #f8fafc;
  --tax-border: #e2e8f0;
  --tax-success: #047857;
  --tax-error: #b91c1c;
  --tax-radius: 12px;
  --tax-shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --tax-shadow-md: 0 4px 12px rgba(15, 23, 42, .08);

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--tax-text);
  background: var(--tax-bg);
  min-height: 100vh;
  line-height: 1.5;
}

.tax-app *, .tax-app *::before, .tax-app *::after { box-sizing: border-box; }

.tax-container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.tax-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.95);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--tax-border);
}
.tax-header__row {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.tax-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.tax-brand__mark {
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--tax-brand-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; letter-spacing: .5px;
}
.tax-brand__name { font-weight: 700; font-size: 16px; }
.tax-brand__logo { height: 40px; width: auto; max-width: 220px; display: block; }
.tax-nav { display: flex; align-items: center; gap: 18px; }
.tax-nav a { color: var(--tax-text); text-decoration: none; font-size: 14px; }
.tax-nav a:hover { color: var(--tax-brand-primary); }
.tax-locale { display: inline-flex; border: 1px solid var(--tax-border); border-radius: 8px; overflow: hidden; }
.tax-locale button {
  background: transparent; border: 0; padding: 6px 10px; font-size: 13px;
  cursor: pointer; color: var(--tax-muted);
}
.tax-locale button.active { background: var(--tax-brand-primary); color: #fff; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.tax-hero {
  background: linear-gradient(
    135deg,
    var(--tax-brand-primary) 0%,
    color-mix(in srgb, var(--tax-brand-primary) 75%, #000) 100%
  );
  color: #fff;
  padding: 72px 0 88px;
}
.tax-hero h1 {
  font-size: clamp(28px, 4vw, 44px); line-height: 1.15; margin: 0 0 16px;
  font-weight: 800; letter-spacing: -0.5px; text-transform: uppercase;
}
.tax-hero p { font-size: 18px; opacity: .9; max-width: 620px; margin: 0 0 32px; }
.tax-hero__ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.tax-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: var(--tax-radius);
  font-weight: 600; font-size: 15px; cursor: pointer;
  border: 1px solid transparent; text-decoration: none;
  transition: transform .08s ease, background .15s ease;
}
.tax-btn:active { transform: translateY(1px); }
.tax-btn--primary { background: var(--tax-brand-secondary); color: #fff; }
.tax-btn--primary:hover {
  background: color-mix(in srgb, var(--tax-brand-secondary) 88%, #000);
}
/* Default: dark text + light border for use on white card backgrounds. The
   white-text variant only applies inside the dark hero gradient (and the
   existing .tax-nav scope, kept for safety). */
.tax-btn--ghost { background: transparent; color: var(--tax-text); border-color: var(--tax-border); }
.tax-btn--ghost:hover { background: var(--tax-bg-alt); }
.tax-hero .tax-btn--ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.tax-hero .tax-btn--ghost:hover { background: rgba(255,255,255,.1); }
.tax-btn--block { width: 100%; }
.tax-btn--sm { padding: 8px 14px; font-size: 13px; }
.tax-btn[disabled] { opacity: .6; cursor: not-allowed; }
.tax-nav a.active { color: var(--tax-brand-primary); font-weight: 700; }
.tax-nav .tax-btn--ghost { color: var(--tax-text); border-color: var(--tax-border); }
.tax-nav .tax-btn--ghost:hover { background: var(--tax-bg-alt); }

/* ── Section + cards ────────────────────────────────────────────────────── */
.tax-section { padding: 64px 0; }
.tax-section--alt { background: var(--tax-bg-alt); }
.tax-section h2 {
  font-size: clamp(22px, 3vw, 30px); margin: 0 0 8px; color: var(--tax-text);
}
.tax-section__lede { color: var(--tax-muted); margin: 0 0 32px; max-width: 620px; }

.tax-about-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  max-width: 900px;
}
.tax-about-list li {
  position: relative; padding: 14px 16px 14px 44px;
  background: #fff; border: 1px solid var(--tax-border); border-radius: var(--tax-radius);
  font-weight: 500;
}
.tax-about-list li::before {
  content: ""; position: absolute; left: 16px; top: 50%;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--tax-brand-secondary);
  transform: translateY(-50%);
}

.tax-services-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.tax-service-card {
  background: #fff; border: 1px solid var(--tax-border);
  border-radius: var(--tax-radius); padding: 20px;
  box-shadow: var(--tax-shadow-sm);
  display: flex; flex-direction: column; gap: 8px;
  transition: box-shadow .15s ease, transform .15s ease;
}
.tax-service-card:hover { box-shadow: var(--tax-shadow-md); transform: translateY(-2px); }
.tax-service-card__icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: color-mix(in srgb, var(--tax-brand-primary) 10%, #fff);
  color: var(--tax-brand-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
}
.tax-service-card__category {
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--tax-muted);
}
.tax-service-card h3 { margin: 4px 0 0; font-size: 17px; }
.tax-service-card p { margin: 0; color: var(--tax-muted); font-size: 14px; }
/* Clickable-card variant: same look but reset button defaults. */
.tax-service-card--button {
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  width: 100%;
}
.tax-service-card--button:focus-visible {
  outline: 2px solid var(--tax-brand-primary); outline-offset: 2px;
}
.tax-service-card__more {
  margin-top: auto; padding-top: 6px;
  color: var(--tax-brand-primary); font-size: 13px; font-weight: 600;
}

/* ── Service-detail modal ───────────────────────────────────────────────── */
.tax-modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, .55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
  animation: tax-modal-fade .12s ease;
}
@keyframes tax-modal-fade { from { opacity: 0 } to { opacity: 1 } }
.tax-modal__panel {
  position: relative; background: #fff;
  border-radius: var(--tax-radius);
  box-shadow: 0 20px 60px rgba(15, 23, 42, .25);
  width: 100%; max-width: 560px;
  padding: 32px 28px 24px; display: grid; gap: 12px;
  animation: tax-modal-pop .15s ease;
}
@keyframes tax-modal-pop { from { transform: translateY(8px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
.tax-modal__close {
  position: absolute; top: 10px; right: 12px;
  border: 0; background: transparent; cursor: pointer;
  font-size: 26px; line-height: 1; color: var(--tax-muted);
  padding: 4px 10px; border-radius: 6px;
}
.tax-modal__close:hover { background: var(--tax-bg-alt); color: var(--tax-text); }
.tax-modal__title { margin: 0; font-size: 22px; }
.tax-modal__desc { margin: 0; color: var(--tax-muted); font-size: 15px; }
.tax-modal__longdesc { display: grid; gap: 10px; }
.tax-modal__longdesc p { margin: 0; font-size: 14px; line-height: 1.55; }
.tax-modal__section h4 {
  margin: 8px 0 4px; font-size: 12px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--tax-muted);
}
.tax-modal__section ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.55; }
.tax-modal__actions {
  display: flex; gap: 8px; margin-top: 12px;
  padding-top: 12px; border-top: 1px solid var(--tax-border);
}

/* ── Lead form ──────────────────────────────────────────────────────────── */
.tax-form {
  background: #fff; border: 1px solid var(--tax-border);
  border-radius: var(--tax-radius); padding: 28px;
  box-shadow: var(--tax-shadow-sm);
  display: grid; gap: 16px; max-width: 640px;
}
.tax-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.tax-form input, .tax-form textarea, .tax-form select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--tax-border);
  border-radius: 8px; font: inherit; font-size: 15px;
  background: #fff; color: var(--tax-text);
}
.tax-form input:focus, .tax-form textarea:focus, .tax-form select:focus {
  outline: none; border-color: var(--tax-brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tax-brand-primary) 18%, transparent);
}
.tax-form textarea { min-height: 120px; resize: vertical; }
.tax-form__row2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .tax-form__row2 { grid-template-columns: 1fr; } }
.tax-form__row3 { display: grid; gap: 16px; grid-template-columns: 1fr 0.6fr 1fr; }
@media (max-width: 720px) { .tax-form__row3 { grid-template-columns: 1fr; } }
.tax-form__honeypot { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.tax-msg { padding: 12px 14px; border-radius: 8px; font-size: 14px; }
.tax-msg--success { background: rgba(4, 120, 87, .1); color: var(--tax-success); }
.tax-msg--error   { background: rgba(185, 28, 28, .08); color: var(--tax-error); }

/* ── Contact + footer ───────────────────────────────────────────────────── */
.tax-contact-layout {
  display: grid; gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
}
@media (max-width: 720px) { .tax-contact-layout { grid-template-columns: 1fr; } }

.tax-contact-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.tax-contact-item { background: #fff; border: 1px solid var(--tax-border); border-radius: var(--tax-radius); padding: 18px; }
.tax-contact-item__label { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--tax-muted); margin-bottom: 6px; }
.tax-contact-item__value { font-size: 15px; color: var(--tax-text); }

.tax-footer {
  border-top: 1px solid var(--tax-border);
  padding: 24px 0; color: var(--tax-muted); font-size: 13px;
}
.tax-footer__row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ── Loading / error full-screen ────────────────────────────────────────── */
.tax-fullscreen {
  min-height: 70vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
}
.tax-fullscreen__inner { max-width: 460px; color: var(--tax-muted); }

/* ── Employee shell: sidebar layout (Phase 4l) ───────────────────────────── */
.tax-shell { display: flex; min-height: 100vh; background: var(--tax-bg-alt); }
.tax-shell__sidebar {
  width: 240px; flex-shrink: 0;
  background: #fff; border-right: 1px solid var(--tax-border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.tax-shell__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px; border-bottom: 1px solid var(--tax-border);
  text-decoration: none; color: inherit; min-height: 64px;
}
.tax-shell__brand-name {
  display: flex; flex-direction: column; min-width: 0; line-height: 1.15;
}
.tax-shell__brand-title { font-weight: 700; font-size: 15px; }
.tax-shell__staff-badge {
  display: inline-block; margin-top: 2px; padding: 1px 6px; border-radius: 4px;
  background: var(--tax-brand-primary); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  align-self: flex-start;
}
.tax-shell__nav {
  flex: 1 1 auto; overflow-y: auto;
  padding: 12px 8px; display: flex; flex-direction: column; gap: 18px;
}
.tax-shell__group { display: flex; flex-direction: column; gap: 2px; }
.tax-shell__group-label {
  font-size: 11px; font-weight: 700; color: var(--tax-muted);
  text-transform: uppercase; letter-spacing: .6px;
  padding: 4px 12px 6px;
}
.tax-shell__nav a, .tax-shell__nav button.tax-shell__nav-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-radius: 8px;
  color: var(--tax-text); text-decoration: none; font-size: 14px;
  background: transparent; border: 0; cursor: pointer; text-align: left;
  font-family: inherit; font-weight: 500;
}
.tax-shell__nav a:hover, .tax-shell__nav button.tax-shell__nav-link:hover {
  background: var(--tax-bg-alt); color: var(--tax-brand-primary);
}
.tax-shell__nav a.active {
  background: color-mix(in srgb, var(--tax-brand-primary) 10%, #fff);
  color: var(--tax-brand-primary); font-weight: 700;
}
.tax-shell__nav .tax-shell__badge {
  padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--tax-brand-secondary); color: #fff;
}
.tax-shell__footer {
  border-top: 1px solid var(--tax-border); padding: 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.tax-shell__footer-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 4px;
}
.tax-shell__main {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column;
}
.tax-shell__topbar {
  display: none;
  position: sticky; top: 0; z-index: 9;
  background: rgba(255,255,255,.95); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--tax-border);
  padding: 12px 16px; align-items: center; gap: 12px;
}
.tax-shell__menu-btn {
  appearance: none; background: transparent; border: 1px solid var(--tax-border);
  border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 18px; line-height: 1;
  color: var(--tax-text);
}
.tax-shell__content {
  flex: 1 1 auto; padding: 28px 32px;
}
.tax-shell__backdrop { display: none; }

@media (max-width: 900px) {
  .tax-shell { flex-direction: column; }
  .tax-shell__sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 280px;
    transform: translateX(-100%); transition: transform .2s ease;
    z-index: 30; box-shadow: var(--tax-shadow-md);
  }
  .tax-shell__sidebar--open { transform: translateX(0); }
  .tax-shell__topbar { display: flex; }
  .tax-shell__content { padding: 20px 16px; }
  .tax-shell__backdrop {
    display: none; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 20;
  }
  .tax-shell__backdrop--open { display: block; }
}

/* ── Customer portal mobile pass (Phase 4o) ───────────────────────────────
   Goals: no horizontal scroll, 16px+ input fields (iOS won't zoom on focus
   when input font-size >= 16px), large tap targets, and a hamburger drawer
   for the portal nav on small phones. Staff side keeps its own mobile
   pattern (tax-shell__*).
*/

/* Portal hamburger button — only visible at narrow widths. */
.tax-portal-menu-btn {
  display: none;
  appearance: none; background: transparent;
  border: 1px solid var(--tax-border);
  border-radius: 8px; padding: 8px 12px;
  font-size: 18px; line-height: 1; cursor: pointer;
  color: var(--tax-text);
  min-height: 44px;
}

/* Mobile drawer for the portal nav. Slides down from below the header
   when the menu button is tapped. Backdrop sits behind it. */
.tax-portal-nav-backdrop { display: none; }

@media (max-width: 720px) {
  .tax-portal-menu-btn { display: inline-flex; align-items: center; }
  .tax-portal-nav {
    display: none;
    position: absolute; top: 64px; left: 16px; right: 16px;
    background: #fff; border: 1px solid var(--tax-border);
    border-radius: 12px; padding: 12px;
    flex-direction: column !important; align-items: stretch !important;
    gap: 4px !important;
    box-shadow: var(--tax-shadow-md);
    z-index: 20;
  }
  .tax-portal-nav--open { display: flex !important; }
  .tax-portal-nav a, .tax-portal-nav button.tax-btn {
    width: 100%; justify-content: flex-start;
    padding: 12px 14px !important; min-height: 44px;
    font-size: 15px;
  }
  .tax-portal-nav-backdrop--open {
    display: block; position: fixed; inset: 0;
    background: rgba(15,23,42,.35); z-index: 19;
  }
  /* The header row's container should leave room for the menu button. */
  .tax-header__row { padding-right: 8px; padding-left: 8px; }
}

/* Inputs: 16px font on small screens so iOS Safari doesn't zoom the
   viewport on focus. Also bumps the touch target. */
@media (max-width: 720px) {
  .tax-app input, .tax-app textarea, .tax-app select {
    font-size: 16px !important;
    min-height: 44px;
  }
  .tax-app textarea { min-height: 88px; }
  .tax-app .tax-btn { min-height: 44px; }
  .tax-container { padding-left: 16px; padding-right: 16px; }
}

/* Sticky bottom action bar — opt-in via class. Used on the magic-link
   Respond page and any other long form where the primary CTA should
   always be reachable on a phone. Desktop: pass-through (no sticky). */
.tax-sticky-cta { display: contents; }
@media (max-width: 720px) {
  .tax-sticky-cta {
    display: block;
    position: sticky; bottom: 0;
    background: linear-gradient(to top, #fff 60%, rgba(255,255,255,0));
    padding: 12px 0 16px;
    z-index: 5;
  }
  .tax-sticky-cta .tax-btn {
    width: 100%;
  }
}
