.tools-hub-tile.card {
  background-color: var(--bs-body-bg);
  border: 1px solid var(--fc-border, var(--bs-border-color));
  border-radius: var(--fc-radius-card, 8px);
  box-shadow: var(--fc-elevation-1);
}

.tools-hub-page-wordmark {
  margin-bottom: 1.75rem;
}

@media (min-width: 768px) {
  .tools-hub-page-wordmark {
    margin-bottom: 2rem;
  }
}

.tools-hub-tile__heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.625rem;
}

.tools-hub-tile__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--bs-primary);
}

.tools-hub-tile__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  min-width: 0;
}

.tools-hub-tile__heading .h5,
.tools-hub-tile__heading .h4 {
  line-height: 1.3;
}

.tools-hub-tile__description {
  margin-bottom: 0;
  color: var(--fc-text-muted, var(--bs-secondary-color, var(--bs-secondary)));
}

.tools-hub-tile__action {
  margin-top: 1.25rem;
}

@media (min-width: 768px) {
  .tools-hub-tile__action {
    margin-top: 1.5rem;
  }
}

.tools-hub-tile.card:hover {
  border-color: var(--bs-primary-border-subtle, var(--bs-border-color));
}

.tools-hub-tile--full .tools-hub-tile__inner {
  flex-direction: row;
  align-items: center;
  gap: 1.25rem;
}

@media (max-width: 575.98px) {
  .tools-hub-tile--full .tools-hub-tile__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

.tools-hub-tile--full .tools-hub-tile__copy {
  flex: 1 1 auto;
  min-width: 0;
}

.tools-hub-tile--full .tools-hub-tile__action {
  flex-shrink: 0;
}

@media (min-width: 576px) {
  .tools-hub-tile--full .tools-hub-tile__action {
    margin-top: 0;
  }
}

/* Login is the front door — brand navy, light CTA, more presence than free-tool cards. */
.tools-hub-tile--login.card {
  --fc-login-fg: #ffffff;
  --fc-login-muted: rgba(255, 255, 255, 0.78);
  background:
    linear-gradient(
      135deg,
      var(--fc-primary-dark, #101c2b) 0%,
      #1a3148 100%
    );
  border-color: transparent;
  color: var(--fc-login-fg);
  box-shadow:
    0 0.35rem 0.75rem rgba(16, 28, 43, 0.18),
    0 1rem 2.25rem rgba(16, 28, 43, 0.28);
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.tools-hub-tile--login .tools-hub-tile__inner {
  padding: 1.5rem 1.6rem;
}

@media (min-width: 768px) {
  .tools-hub-tile--login .tools-hub-tile__inner {
    padding: 1.85rem 2rem;
  }
}

.tools-hub-tile--login .tools-hub-tile__icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  color: var(--fc-login-fg);
  background-color: rgba(255, 255, 255, 0.12);
  font-size: 1.35rem;
}

.tools-hub-tile--login .tools-hub-tile__heading .h4 {
  color: var(--fc-login-fg);
  font-weight: 600;
}

.tools-hub-tile--login .tools-hub-tile__description {
  color: var(--fc-login-muted);
}

.tools-hub-tile--login .tools-hub-tile__action.btn-light {
  font-weight: 600;
  padding: 0.5rem 1.35rem;
  color: var(--fc-primary-dark, #101c2b);
  border-color: transparent;
}

.tools-hub-tile--login.card:hover {
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow:
    0 0.45rem 1rem rgba(16, 28, 43, 0.22),
    0 1.15rem 2.5rem rgba(16, 28, 43, 0.34);
}

[data-bs-theme="dark"] .tools-hub-tile--login.card {
  background:
    linear-gradient(
      135deg,
      #152536 0%,
      #1e3a56 100%
    );
  border-color: rgba(var(--bs-primary-rgb), 0.35);
  box-shadow:
    0 0.35rem 0.75rem rgba(0, 0, 0, 0.4),
    0 1rem 2.25rem rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .tools-hub-tile--login.card:hover {
  border-color: rgba(var(--bs-primary-rgb), 0.5);
  box-shadow:
    0 0.45rem 1rem rgba(0, 0, 0, 0.48),
    0 1.15rem 2.5rem rgba(0, 0, 0, 0.58);
}

[data-bs-theme="dark"] .tools-hub-tile--login .tools-hub-tile__action.btn-light {
  color: #101c2b;
}

/* AI extractors — teal accent, distinct from brand blue without shouting. */
.tools-hub-tile--ai {
  --fc-ai: #0f766e;
  --fc-ai-rgb: 15, 118, 110;
}

[data-bs-theme="dark"] .tools-hub-tile--ai {
  --fc-ai: #2dd4bf;
  --fc-ai-rgb: 45, 212, 191;
}

.tools-hub-tile--ai.card {
  background:
    linear-gradient(
      180deg,
      rgba(var(--fc-ai-rgb), 0.08) 0%,
      var(--bs-body-bg) 52%
    );
  border-color: rgba(var(--fc-ai-rgb), 0.28);
  box-shadow:
    inset 3px 0 0 var(--fc-ai),
    0 0.125rem 0.25rem rgba(0, 0, 0, 0.04),
    0 0.5rem 1.25rem rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.tools-hub-tile--ai .tools-hub-tile__icon {
  color: var(--fc-ai);
}

.tools-hub-tile--ai.card:hover {
  border-color: rgba(var(--fc-ai-rgb), 0.45);
  box-shadow:
    inset 3px 0 0 var(--fc-ai),
    0 0.25rem 0.5rem rgba(0, 0, 0, 0.06),
    0 0.75rem 1.5rem rgba(0, 0, 0, 0.1);
}

.tools-hub-tile__ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex-shrink: 0;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.3;
  color: var(--fc-ai);
  background-color: rgba(var(--fc-ai-rgb), 0.12);
}

.tools-hub-tile__ai-badge .bi {
  font-size: 0.75rem;
}

[data-bs-theme="dark"] .tools-hub-tile--ai.card {
  box-shadow:
    inset 3px 0 0 var(--fc-ai),
    0 0.125rem 0.35rem rgba(0, 0, 0, 0.35),
    0 0.5rem 1.25rem rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .tools-hub-tile--ai.card:hover {
  box-shadow:
    inset 3px 0 0 var(--fc-ai),
    0 0.25rem 0.5rem rgba(0, 0, 0, 0.45),
    0 0.75rem 1.5rem rgba(0, 0, 0, 0.5);
}

.tools-hub-free-section {
  border: 1px solid var(--fc-border, var(--bs-border-color-translucent, var(--bs-border-color)));
  border-radius: var(--fc-radius-card, 8px);
  background-color: var(--bs-tertiary-bg, var(--bs-body-bg));
  box-shadow: none;
  overflow: hidden;
}

[data-bs-theme="dark"] .tools-hub-free-section {
  border-color: var(--fc-border, var(--bs-border-color-translucent, var(--bs-border-color)));
  background-color: rgba(255, 255, 255, 0.02);
}

.tools-hub-free-section--signed-in {
  border: none;
  box-shadow: none;
  background-color: transparent;
}

.tools-hub-free-section--signed-in .tools-hub-free-section__body {
  padding: 0;
}

.tools-hub-free-section__header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--fc-border, var(--bs-border-color-translucent, var(--bs-border-color)));
  background-color: transparent;
}

.tools-hub-free-section__badge {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--fc-radius-control, 6px);
  color: var(--bs-secondary-color, var(--bs-secondary));
  background-color: var(--bs-secondary-bg, rgba(0, 0, 0, 0.06));
  font-size: 1.15rem;
}

.tools-hub-free-section__titles {
  flex: 1 1 auto;
  min-width: 0;
}

.tools-hub-free-section__body {
  padding: 1.25rem;
  background-color: var(--bs-body-bg);
}

.tools-hub-free-section--signed-in .tools-hub-free-section__body {
  background-color: transparent;
}

.tools-hub-free-section__group-title {
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--fc-border, var(--bs-border-color-translucent, var(--bs-border-color)));
  padding-bottom: 0.5rem;
}

.tools-hub-free-section__group:last-child {
  margin-bottom: 0 !important;
}

@media (min-width: 768px) {
  .tools-hub-free-section__body {
    padding: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tools-hub-tile.card,
  .tools-hub-tile.card:hover,
  .tools-hub-tile--login.card:hover {
    transition: none;
    transform: none;
  }
}
