
:root {
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-surface-2: #f7f8fa;
  --color-border: #e5e7eb;

  --color-text: #171a1f;
  --color-text-dim: #667085;

  --color-primary: #5b4ce6;
  --color-primary-dark: #10233f;
  --color-accent: #159c91;

  --color-danger: #d94b5b;
  --color-success: #219653;

  --radius: 9px;
  --radius-sm: 6px;

  --shadow: 0 6px 20px rgba(16, 24, 40, 0.07);
  --max-width: 1180px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
           Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}


/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  padding: 10px 17px;

  border: 1px solid transparent;
  border-radius: var(--radius-sm);

  font-size: 0.9rem;
  font-weight: 600;

  cursor: pointer;

  transition:
    background-color .15s ease,
    border-color .15s ease,
    color .15s ease,
    transform .15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-ghost:hover {
  background: var(--color-surface-2);
  border-color: #d0d5dc;
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
}

.btn-block {
  width: 100%;
}


/* ==========================================================================
   Navbar
   ========================================================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;

  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--color-border);

  backdrop-filter: blur(10px);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;

  font-size: 1.1rem;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.brand-mark {
  width: 30px;
  height: 30px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--color-primary);
  color: #fff;

  border-radius: 7px;

  font-size: .85rem;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--color-text-dim);
  font-size: 0.88rem;
  font-weight: 500;

  transition: color .15s ease;
}

.nav-links a:hover {
  color: var(--color-text);
}

.nav-links a.active {
  color: var(--color-text);
  font-weight: 650;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-toggle {
  display: none;

  padding: 4px;

  background: none;
  border: 0;

  color: var(--color-text);
  font-size: 1.35rem;
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links.open {
    display: flex;

    position: absolute;
    top: 64px;
    left: 0;
    right: 0;

    padding: 14px 24px;

    background: #fff;
    border-bottom: 1px solid var(--color-border);

    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-links.open a {
    padding: 11px 0;
    border-bottom: 1px solid var(--color-border);
  }
}


/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding: 88px 0 72px;
  text-align: center;

  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(91, 76, 230, .055),
      transparent 42%
    );
}

.hero .eyebrow {
  display: inline-block;

  margin-bottom: 18px;
  padding: 5px 10px;

  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 5px;

  color: var(--color-text-dim);
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 0 auto 17px;

  font-size: clamp(2.35rem, 5vw, 3.7rem);
  line-height: 1.06;
  letter-spacing: -.045em;
}

.hero h1 span {
  color: var(--color-primary);
}

.hero p {
  max-width: 620px;
  margin: 0 auto 28px;

  color: var(--color-text-dim);
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
}

.page-hero {
  padding: 70px 0 50px;
  text-align: center;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
}

.page-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.page-hero p {
  max-width: 560px;
  margin: 0 auto;
  color: var(--color-text-dim);
}


/* ==========================================================================
   Section headings
   ========================================================================== */

.section {
  padding: 60px 0;
}

.section-head {
  max-width: 640px;
  margin: 0 auto 38px;
  text-align: center;
}

.section-head h2 {
  margin: 0 0 9px;

  font-size: clamp(1.55rem, 3vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: -.03em;
}

.section-head p {
  margin: 0;
  color: var(--color-text-dim);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr);
  gap: 28px;
  align-items: start;
}

.content-grid h2 {
  margin: 0 0 12px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.18;
  letter-spacing: -.03em;
}

.content-grid p {
  margin: 0 0 12px;
  color: var(--color-text-dim);
}

.info-panel {
  padding: 20px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.info-panel h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.info-panel ul {
  margin: 0;
  padding-left: 18px;
  color: var(--color-text-dim);
}

.info-panel li + li {
  margin-top: 7px;
}

.policy-content {
  max-width: 780px;
  margin: 0 auto;
}

.policy-content h2 {
  margin: 28px 0 8px;
  font-size: 1.25rem;
  line-height: 1.25;
}

.policy-content p {
  margin: 0 0 12px;
  color: var(--color-text-dim);
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(260px, .75fr) minmax(320px, 1.25fr);
  gap: 20px;
  align-items: start;
  max-width: 980px;
  margin: 0 auto;
}

.account-card {
  max-width: none;
  box-shadow: none;
}

.tool-db-content {
  display: grid;
  gap: 20px;
}

.tool-content-section {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.tool-content-section h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  line-height: 1.25;
}

.tool-content-body {
  color: var(--color-text-dim);
  font-size: .94rem;
  line-height: 1.75;
}

.tool-faq-list {
  display: grid;
  gap: 10px;
}

.tool-faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
}

.tool-faq-item summary {
  padding: 13px 15px;
  color: var(--color-text);
  font-weight: 650;
  cursor: pointer;
}

.tool-faq-item div {
  padding: 0 15px 15px;
  color: var(--color-text-dim);
  font-size: .92rem;
  line-height: 1.7;
}


/* ==========================================================================
   Tool cards
   ========================================================================== */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 11px;

  padding: 20px;

  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);

  transition:
    background-color .15s ease,
    border-color .15s ease,
    transform .15s ease,
    box-shadow .15s ease;
}

.tool-card:hover {
  background: #fcfcfd;
  border-color: #d5d9df;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.tool-icon {
  width: 42px;
  height: 42px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 8px;

  color: var(--color-primary);
}

.tool-icon svg {
  width: 21px;
  height: 21px;
}

.tool-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.tool-card p {
  margin: 0;

  color: var(--color-text-dim);
  font-size: .87rem;

  flex-grow: 1;
}

.tool-card .tool-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  padding-top: 3px;

  color: var(--color-text-dim);
  font-size: .77rem;
}

.tool-tag {
  padding: 2px 7px;

  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 4px;

  color: var(--color-text-dim);
  font-weight: 600;
}

.tool-card .tool-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  color: var(--color-primary);
  font-size: .86rem;
  font-weight: 600;
}

.empty-state {
  padding: 48px 20px;

  text-align: center;

  color: var(--color-text-dim);

  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
}


/* ==========================================================================
   Featured tools
   ========================================================================== */

.tool-card.featured {
  background: #fbfaff;
  border-color: rgba(91, 76, 230, .25);
}

.tool-card.featured:hover {
  border-color: rgba(91, 76, 230, .45);
  box-shadow: 0 6px 20px rgba(91, 76, 230, .08);
}

.tool-card.featured .tool-tag {
  background: #f0efff;
  border-color: #ddd9ff;
  color: var(--color-primary);
}


/* ==========================================================================
   Category filters
   ========================================================================== */

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;

  margin-bottom: 28px;
}

.category-pill {
  padding: 7px 12px;

  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 6px;

  color: var(--color-text-dim);
  font-size: .82rem;
  font-weight: 600;

  cursor: pointer;

  transition:
    background-color .15s ease,
    border-color .15s ease,
    color .15s ease;
}

.category-pill:hover {
  background: var(--color-surface-2);
  border-color: #d0d5dc;
  color: var(--color-text);
}

.category-pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.tool-card.hidden {
  display: none;
}


/* ==========================================================================
   Blog
   ========================================================================== */

.breadcrumb {
  margin-bottom: 18px;
  color: var(--color-text-dim);
  font-size: .84rem;
  font-weight: 600;
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: #98a2b3;
  font-weight: 500;
}

.breadcrumb a {
  color: var(--color-text-dim);
  transition: color .15s ease;
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

.breadcrumb span {
  color: var(--color-text);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 20px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition:
    border-color .15s ease,
    box-shadow .15s ease,
    transform .15s ease;
}

.blog-card:hover {
  border-color: #d5d9df;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.blog-card-image {
  aspect-ratio: 16 / 9;
  background: var(--color-surface-2);
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .2s ease;
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.025);
}

.blog-card-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(91, 76, 230, .12), rgba(21, 156, 145, .12)),
    var(--color-surface-2);
}

.blog-card-image-placeholder span {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid rgba(91, 76, 230, .22);
  border-radius: 8px;
  color: var(--color-primary);
  font-size: 1.35rem;
  font-weight: 800;
}

.blog-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  flex-grow: 1;
}

.blog-date {
  color: var(--color-text-dim);
  font-size: .78rem;
  font-weight: 650;
}

.blog-card h2 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.28;
}

.blog-card h2 a:hover {
  color: var(--color-primary);
}

.blog-card p {
  margin: 0;
  color: var(--color-text-dim);
  font-size: .9rem;
  line-height: 1.65;
  flex-grow: 1;
}

.text-link {
  color: var(--color-primary);
  font-size: .9rem;
  font-weight: 650;
}

.text-link:hover {
  color: var(--color-primary-dark);
}

.blog-post-header {
  padding: 44px 0 34px;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
}

.blog-post-header .breadcrumb ol {
  justify-content: flex-start;
}

.blog-post-header h1 {
  max-width: 820px;
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.blog-post-image {
  width: 100%;
  max-height: 440px;
  margin: 34px 0 0;
  object-fit: cover;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.blog-content {
  max-width: 760px;
  margin: 36px auto 0;
  color: #242830;
  font-size: 1.02rem;
  line-height: 1.8;
}

.blog-content p {
  margin: 0 0 18px;
}


/* ==========================================================================
   Feature strip
   ========================================================================== */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.feature {
  padding: 4px;
}

.feature h4 {
  margin: 11px 0 5px;
  font-size: .98rem;
}

.feature p {
  margin: 0;

  color: var(--color-text-dim);
  font-size: .88rem;
}

.feature .feature-icon {
  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #f0f8f7;
  border: 1px solid #d9efec;
  border-radius: 8px;

  color: var(--color-accent);
}


/* ==========================================================================
   Forms / Auth
   ========================================================================== */

.auth-wrap {
  min-height: calc(100vh - 64px);

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;

  padding: 32px;

  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);

  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 1.45rem;
}

.auth-card .sub {
  margin-bottom: 24px;

  color: var(--color-text-dim);
  font-size: .88rem;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;

  margin-bottom: 6px;

  color: var(--color-text-dim);
  font-size: .84rem;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;

  padding: 10px 12px;

  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);

  color: var(--color-text);
  font-family: var(--font);
  font-size: .92rem;

  transition: border-color .15s ease, box-shadow .15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(91, 76, 230, .08);
}

.form-note {
  margin-top: 16px;

  text-align: center;

  color: var(--color-text-dim);
  font-size: .84rem;
}

.form-note a {
  color: var(--color-primary);
  font-weight: 600;
}


/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
  padding: 10px 13px;

  margin-bottom: 16px;

  border-radius: var(--radius-sm);

  font-size: .86rem;
}

.alert-error {
  background: #fff5f6;
  border: 1px solid #f3cbd0;
  color: #b93648;
}

.alert-success {
  background: #f0faf4;
  border: 1px solid #c9ecd7;
  color: #19733f;
}


/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: 40px;
  padding: 32px 0;

  border-top: 1px solid var(--color-border);

  color: var(--color-text-dim);
  font-size: .84rem;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a:hover {
  color: var(--color-text);
}


/* ==========================================================================
   Admin panel
   ========================================================================== */

.admin-body {
  background: #f7f8fa;
}

.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 230px;

  flex-shrink: 0;

  padding: 20px 15px;

  background: #fff;
  border-right: 1px solid var(--color-border);
}

.admin-sidebar .brand {
  margin-bottom: 28px;
  padding-left: 6px;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 9px;

  padding: 9px 11px;
  margin-bottom: 3px;

  border-radius: var(--radius-sm);

  color: var(--color-text-dim);
  font-size: .88rem;
  font-weight: 500;

  transition:
    background-color .15s ease,
    color .15s ease;
}

.admin-nav a:hover,
.admin-nav a.active {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.admin-main {
  flex-grow: 1;

  max-width: 100%;
  padding: 28px;

  overflow-x: auto;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 24px;

  flex-wrap: wrap;
  gap: 12px;
}

.admin-topbar h1 {
  margin: 0;
  font-size: 1.45rem;
}

.admin-filter-row {
  max-width: 440px;
}

.card {
  padding: 22px;
  margin-bottom: 20px;

  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;

  margin-bottom: 24px;
}

.stat-card {
  padding: 18px;

  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.stat-card .num {
  font-size: 1.8rem;
  font-weight: 750;
}

.stat-card .label {
  color: var(--color-text-dim);
  font-size: .82rem;
}


/* ==========================================================================
   Tables
   ========================================================================== */

table {
  width: 100%;
  border-collapse: collapse;

  background: #fff;

  font-size: .87rem;
}

thead th {
  padding: 11px;

  text-align: left;

  color: var(--color-text-dim);
  font-weight: 600;

  border-bottom: 1px solid var(--color-border);

  white-space: nowrap;
}

tbody td {
  padding: 11px;

  border-bottom: 1px solid var(--color-border);

  vertical-align: middle;
}

tbody tr:hover {
  background: #fafafa;
}

.badge {
  padding: 2px 7px;

  border-radius: 4px;

  font-size: .72rem;
  font-weight: 700;
}

.badge-active {
  background: #f0faf4;
  color: var(--color-success);
}

.badge-inactive {
  background: #fff5f6;
  color: var(--color-danger);
}

.table-actions {
  display: flex;
  gap: 6px;
}


/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 860px) {
  .admin-shell {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .admin-nav {
    display: flex;
    gap: 5px;

    overflow-x: auto;
  }

  .admin-nav a span.label-text {
    display: none;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 18px;
  }

  .hero {
    padding: 65px 0 55px;
  }

  .hero h1 {
    font-size: 2.45rem;
  }

  .section {
    padding: 48px 0;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 24px;
  }

  .admin-main {
    padding: 20px;
  }
}
