/*
 * ITFreeTools — final cross-application design system.
 * Loaded last so the portal and every application share one visual language.
 */

body.has-itft-shell {
  --navy: var(--itft-brand-navy);
  --navy-2: var(--itft-brand-navy);
  --dark: var(--itft-brand-navy-deep);
  --blue: var(--itft-brand-teal);
  --teal: var(--itft-brand-teal);
  --teal-dark: #0b655f;
  --gold: var(--itft-brand-gold);
  --ink: var(--itft-brand-ink);
  --muted: var(--itft-brand-muted);
  --line: var(--itft-brand-border);
  --bg: var(--itft-brand-bg);
  --paper: var(--itft-brand-bg);
  --cream: #edf6f5;
  --soft: #edf6f5;
  --card: var(--itft-brand-surface);
  --radius: 16px;
  --shadow: var(--itft-brand-shadow);
  margin: 0;
  color: var(--itft-brand-ink);
  background: var(--itft-brand-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

body.has-itft-shell :where(h1, h2, h3, h4, h5, h6) {
  color: var(--itft-brand-navy);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-style: normal;
  letter-spacing: -0.025em;
}

body.has-itft-shell :where(h1) {
  font-size: clamp(2.15rem, 4.4vw, 3.75rem);
  line-height: 1.06;
}

body.has-itft-shell :where(h2) {
  font-size: clamp(1.55rem, 2.8vw, 2.25rem);
  line-height: 1.15;
}

body.has-itft-shell :where(h3) {
  font-size: 1.05rem;
  line-height: 1.3;
}

body.has-itft-shell :where(p, li, label, input, select, textarea, button, a) {
  font-family: inherit;
}

/* The shared shell is the only public site navigation and footer. */
body.itft-app-page > :where(.app-header, .top, .site-header),
body.itft-app-page > :where(.footer, footer):not(.itft-shell-footer) {
  display: none !important;
}

body.itft-portal-page > .site-header > .nav,
body.itft-portal-page > .site-footer {
  display: none !important;
}

body.itft-portal-page > .site-header {
  top: auto !important;
}

/* One content width and horizontal rhythm across the public site. */
body.has-itft-shell :where(.shell, .wrap, .top, main) {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

body.itft-office-tools .layout {
  width: min(1180px, 100%);
  margin-inline: auto;
}

body.itft-office-tools .content {
  padding-inline: clamp(18px, 3vw, 38px);
}

body.itft-portal-page :where(.hero, .tools-section, .about-section) {
  width: min(1180px, calc(100% - 32px));
}

/* Consistent fields and controls throughout all sub-tools. */
body.has-itft-shell :where(input, select, textarea) {
  min-height: 44px;
  padding: 9px 12px;
  color: var(--itft-brand-ink);
  background: #fff;
  border: 1px solid #b9c9d2;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.35;
}

body.has-itft-shell textarea {
  min-height: 96px;
}

body.has-itft-shell :where(button, .btn, .button, .small):not(.remove):not(.close):not(.menu-button) {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
}

body.has-itft-shell :where(.primary, button[type="submit"]):not(.remove):not(.close) {
  color: #fff;
  background: var(--itft-brand-teal);
  border-color: var(--itft-brand-teal);
}

body.has-itft-shell :where(.primary, button[type="submit"]):not(.remove):not(.close):hover {
  background: #0b655f;
  border-color: #0b655f;
}

body.has-itft-shell :where(.secondary, .small) {
  color: var(--itft-brand-navy);
  background: #e8f2f2;
  border-color: #c8dcdc;
}

body.has-itft-shell :where(.secondary, .small):hover {
  color: #0b655f;
  background: #dff0ed;
  border-color: #9ccfc7;
}

body.has-itft-shell :where(button, .btn, .button, .small):disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

/* Shared card geometry, borders, shadows and headings. */
body.has-itft-shell :where(.card, .tool-card, .panel, .form-card, .guide, .details-block) {
  border-color: var(--itft-brand-border);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(16, 42, 67, 0.08);
}

body.has-itft-shell :where(.form-card, .panel, .tool-card) {
  padding: clamp(20px, 3vw, 28px);
}

body.has-itft-shell :where(.tool-title h3, .tool-card > h3) {
  padding-left: 11px;
  color: var(--itft-brand-navy);
  border-left: 4px solid var(--itft-brand-teal);
  font-size: 1.22rem;
  font-weight: 800;
}

body.has-itft-shell :where(.section-head, .section-heading, .toolbar, .section-row) {
  align-items: center;
}

body.has-itft-shell :where(.notice, .public-purpose-note) {
  border-radius: 12px;
}

body.has-itft-shell :where(table th) {
  color: #fff;
  background: var(--itft-brand-navy);
  font-size: 0.72rem;
  font-weight: 800;
}

/* Keep the homepage visually aligned with the applications. */
body.itft-portal-page .site-header {
  background: var(--itft-brand-navy-deep);
}

body.itft-portal-page .hero h1,
body.itft-portal-page .section-heading h2,
body.itft-portal-page .principles-copy h2,
body.itft-portal-page .about-copy h2,
body.itft-portal-page .disclaimer-heading h2 {
  font-family: inherit;
  font-weight: 750;
}

body.itft-portal-page .hero h1 {
  color: #fff;
}

body.itft-portal-page .hero h1 em {
  color: #8ed7ca;
  font-family: inherit;
  font-style: normal;
}

body.itft-portal-page :where(.principles-section, .disclaimer-section) :where(h2, h3) {
  color: #fff;
}

body.itft-portal-page .tool-card {
  min-height: 410px;
}

/* Page-level spacing starts consistently below the shared header. */
.seo-breadcrumb {
  margin-top: 18px;
}

.public-purpose-note {
  margin-top: 14px;
  margin-bottom: 26px;
}

@media (max-width: 900px) {
  body.has-itft-shell :where(.shell, .wrap, .top, main),
  body.itft-portal-page :where(.hero, .tools-section, .about-section) {
    width: min(100% - 24px, 1180px);
  }

  body.itft-office-tools .layout {
    width: 100%;
  }
}

@media (max-width: 640px) {
  body.has-itft-shell {
    font-size: 14px;
  }

  body.has-itft-shell :where(button, .btn, .button, .small):not(.remove):not(.close):not(.menu-button) {
    min-height: 44px;
    padding-inline: 13px;
  }

  body.has-itft-shell :where(.form-card, .panel, .tool-card) {
    padding: 18px 15px;
  }

  body.itft-portal-page .tool-card {
    min-height: auto;
  }
}

@media print {
  body.itft-app-page > :where(.app-header, .top, .site-header),
  body.itft-app-page > :where(.footer, footer):not(.itft-shell-footer),
  body.itft-portal-page > .site-header > .nav,
  body.itft-portal-page > .site-footer {
    display: none !important;
  }
}
