/* ─── Resources page overrides ──────────────────────────────────────────── */

.hero-wrap--page {
  min-height: auto;
}

/* ─── Page hero (shorter than main hero) ─────────────────────────────────── */
.page-hero {
  position: relative;
  padding: 48px 56px 64px;
  z-index: 2;
}
.page-hero__inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}
.page-hero__title {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 600;
  font-size: 52px;
  line-height: 1.1;
  color: #fff;
  margin: 0 0 18px;
  letter-spacing: -1.2px;
}
.page-hero__sub {
  font-size: 17px;
  line-height: 1.65;
  color: rgba(255,255,255,0.7);
  max-width: 560px;
  margin: 0 auto 32px;
}
.page-hero__tabs {
  display: inline-flex;
  gap: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 100px;
  padding: 4px;
}
.page-hero__tab {
  padding: 8px 22px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  transition: background 0.2s, color 0.2s;
}
.page-hero__tab:hover,
.page-hero__tab.is-active {
  background: #fff;
  color: var(--navy);
}
.page-hero__tab:hover { color: var(--navy); }

/* ─── Active nav link ─────────────────────────────────────────────────────── */
.nav__link--active {
  color: #fff !important;
  font-weight: 600 !important;
}

/* ─── Section tint ───────────────────────────────────────────────────────── */
.res-section {
  padding-top: 100px;
  padding-bottom: 100px;
}
.res-section--tinted {
  background: var(--cream2);
  max-width: 100%;
  padding-left: 56px;
  padding-right: 56px;
}
.res-section--tinted > * {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Tools grid ─────────────────────────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 48px;
}

.tool-card {
  background: #fff;
  border: 1px solid rgba(10,24,48,0.08);
  border-radius: 20px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: transform 0.35s cubic-bezier(.16,1,.3,1), box-shadow 0.35s ease;
}
.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(10,24,48,0.09);
}
.tool-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 20px;
  flex-shrink: 0;
}
.tool-card__body {
  flex: 1;
}
.tool-card__body h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 10px;
}
.tool-card__body p {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 16px;
}
.tool-card__features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tool-card__features li {
  font-size: 13.5px;
  color: var(--muted);
  padding-left: 18px;
  position: relative;
}
.tool-card__features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--blue);
  font-weight: 700;
}
.tool-card__cta {
  align-self: flex-start;
}

.tools-upsell {
  text-align: center;
  padding: 28px;
  background: var(--cream2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.tools-upsell p {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

/* ─── Articles grid ──────────────────────────────────────────────────────── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.article-card {
  background: #fff;
  border: 1px solid rgba(10,24,48,0.08);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: transform 0.35s cubic-bezier(.16,1,.3,1), box-shadow 0.35s ease;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(10,24,48,0.09);
}
.article-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.article-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: 100px;
}
.article-tag--blue  { background: #e8f0fd; color: #1e4fd8; }
.article-tag--green { background: #e4f5ec; color: #1a7a42; }
.article-tag--purple{ background: #ede8fd; color: #5b35c4; }
.article-tag--orange{ background: #fdf0e4; color: #b85c10; }
.article-card__time {
  font-size: 12px;
  color: #9aa3b0;
  margin-left: auto;
}
.article-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.4;
  margin: 0 0 10px;
}
.article-card p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}
.article-card__link {
  display: inline-block;
  margin-top: 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
}
.article-card__link:hover { color: var(--blue-hover); }

/* ─── Templates grid ─────────────────────────────────────────────────────── */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.template-card {
  background: #fff;
  border: 1px solid rgba(10,24,48,0.08);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(.16,1,.3,1), box-shadow 0.35s ease;
}
.template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(10,24,48,0.09);
}
.template-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.template-icon--teal   { background: #e4f5f2; color: #0e7c68; }
.template-icon--blue   { background: #e8f0fd; color: #1e4fd8; }
.template-icon--purple { background: #ede8fd; color: #5b35c4; }
.template-icon--orange { background: #fdf0e4; color: #b85c10; }
.template-card__body {
  flex: 1;
}
.template-card__body h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 8px;
  line-height: 1.35;
}
.template-card__body p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 12px;
}
.template-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  background: #e8f0fd;
  color: #1e4fd8;
  padding: 3px 9px;
  border-radius: 100px;
  margin-bottom: 16px;
}
.btn--outline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1.5px solid rgba(10,24,48,0.15);
  color: var(--navy);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn--outline:hover {
  border-color: var(--navy);
  background: var(--cream2);
  color: var(--navy);
}
.template-card__cta { align-self: flex-start; }

/* ─── CTA banner ─────────────────────────────────────────────────────────── */
.res-cta-banner {
  max-width: 100% !important;
  padding: 0 56px !important;
  margin: 0 0 80px !important;
}
.res-cta-banner__inner {
  position: relative;
  background: var(--hero-gradient);
  border-radius: 24px;
  overflow: hidden;
  padding: 72px 48px;
  max-width: 1200px;
  margin: 0 auto;
}
.res-cta-banner__content {
  position: relative;
  z-index: 2;
  text-align: center;
}

/* ─── Modal overlay ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,24,48,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.modal-overlay[hidden] { display: none !important; }

.modal-shell {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  align-self: flex-start;
  margin: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid rgba(10,24,48,0.08);
  flex-shrink: 0;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}
.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--cream2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  transition: background 0.2s;
}
.modal-close:hover { background: #e0ddd6; }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 28px;
  border-top: 1px solid rgba(10,24,48,0.08);
  flex-shrink: 0;
}
.btn--ghost-dark {
  background: transparent;
  border: 1.5px solid rgba(10,24,48,0.15);
  color: var(--navy);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn--ghost-dark:hover { background: var(--cream2); }

/* ─── Generator layout ───────────────────────────────────────────────────── */
.generator-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.generator-form {
  padding: 24px 28px;
  overflow-y: auto;
  border-right: 1px solid rgba(10,24,48,0.07);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.generator-preview {
  display: flex;
  flex-direction: column;
  background: #f0ede8;
  min-height: 0;
}
.preview-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  padding: 14px 20px 10px;
  flex-shrink: 0;
}
.preview-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px 20px;
}
.invoice-doc,
.payslip-doc {
  background: #fff;
  border-radius: 8px;
  padding: 32px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 13px;
  color: #1a1a2e;
  box-shadow: 0 4px 20px rgba(10,24,48,0.1);
  min-height: 400px;
}

/* ─── Gen form fields ─────────────────────────────────────────────────────── */
.gen-section {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(10,24,48,0.07);
}
.gen-section:last-child { border-bottom: none; margin-bottom: 0; }
.gen-section__title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--navy);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gen-row { display: grid; gap: 12px; margin-bottom: 12px; }
.gen-row--2 { grid-template-columns: 1fr 1fr; }
.gen-row--3 { grid-template-columns: 1fr 1fr 1fr; }
.gen-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.gen-field:last-child { margin-bottom: 0; }
.gen-row .gen-field { margin-bottom: 0; }
.gen-field label {
  font-size: 11.5px;
  font-weight: 600;
  color: #444;
}
.gen-field input,
.gen-field textarea,
.gen-field select {
  border: 1.5px solid rgba(10,24,48,0.15);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--navy);
  background: #fff;
  transition: border-color 0.2s;
  outline: none;
  resize: vertical;
}
.gen-field input:focus,
.gen-field textarea:focus,
.gen-field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47,111,237,0.12);
}
.gen-field textarea { min-height: 56px; }
.gen-add-btn {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.gen-add-btn:hover { color: var(--blue-hover); }

/* ─── Line items ─────────────────────────────────────────────────────────── */
.line-item-header {
  display: grid;
  grid-template-columns: 1fr 60px 90px 80px 28px;
  gap: 8px;
  padding: 0 0 6px;
  border-bottom: 1px solid rgba(10,24,48,0.1);
  margin-bottom: 8px;
}
.line-item-header span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #888;
}
.line-item-row {
  display: grid;
  grid-template-columns: 1fr 60px 90px 80px 28px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.li-desc { min-width: 0; }
.li-qty, .li-rate {
  padding: 7px 8px !important;
  text-align: right;
}
.li-amount {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  text-align: right;
  white-space: nowrap;
}
.li-remove {
  background: none;
  border: none;
  color: #c0bdb8;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.li-remove:hover { color: #e05050; }
.li-remove-placeholder { display: block; width: 28px; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .page-hero { padding: 36px 24px 48px; }
  .page-hero__title { font-size: 38px; }
  .res-section { padding-left: 24px; padding-right: 24px; }
  .res-section--tinted { padding-left: 24px; padding-right: 24px; }
  .tools-grid { grid-template-columns: 1fr; }
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
  .templates-grid { grid-template-columns: repeat(2, 1fr); }
  .generator-layout { grid-template-columns: 1fr; }
  .generator-form { border-right: none; border-bottom: 1px solid rgba(10,24,48,0.07); max-height: 50vh; }
  .generator-preview { min-height: 400px; }
  .gen-row--3 { grid-template-columns: 1fr 1fr; }
  .modal-shell { max-height: none; }
  .res-cta-banner { padding: 0 24px !important; }
  .res-cta-banner__inner { padding: 48px 28px; }
}

@media (max-width: 600px) {
  .page-hero__title { font-size: 30px; }
  .page-hero__tabs { flex-wrap: wrap; border-radius: 14px; }
  .articles-grid { grid-template-columns: 1fr; }
  .templates-grid { grid-template-columns: 1fr; }
  .gen-row--2 { grid-template-columns: 1fr; }
  .line-item-row,
  .line-item-header { grid-template-columns: 1fr 48px 72px 68px 24px; }
  .modal-overlay { padding: 0; }
  .modal-shell { border-radius: 0; max-height: 100vh; }
}
