:root {
  color-scheme: light;
  --navy: #071a33;
  --navy-2: #0d3260;
  --blue: #1769ff;
  --blue-dark: #0d4fc7;
  --cyan: #72ece5;
  --ink: #132238;
  --muted: #5b6d86;
  --line: #dce6f2;
  --surface: #ffffff;
  --canvas: #f3f7fc;
  --success: #087a55;
  --danger: #b42318;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 16px; line-height: 1.55; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue-dark); }
:focus-visible { outline: 3px solid #ffbf47; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Login */
.login-page { min-height: 100vh; background: radial-gradient(circle at 50% 35%, #103663 0, var(--navy) 45%, #041225 100%); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: min(100%, 460px); padding: 38px; text-align: center; background: var(--surface); border: 1px solid rgba(255,255,255,.5); border-radius: 24px; box-shadow: 0 28px 80px rgba(0,0,0,.3); }
.login-logo { display: block; width: 80px; height: 80px; margin: 0 auto 18px; border-radius: 20px; }
.eyebrow, .section-kicker { margin: 0 0 6px; color: var(--blue); font-size: 12px; font-weight: 850; letter-spacing: .12em; }
.login-card h1 { margin: 0; font-size: clamp(30px, 7vw, 40px); line-height: 1.1; }
.login-intro { max-width: 350px; margin: 12px auto 25px; color: var(--muted); }
.login-form { text-align: left; }
.login-form label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 750; }
.password-field { position: relative; }
.password-field input { width: 100%; height: 52px; padding: 0 92px 0 14px; color: var(--ink); border: 1px solid #bac9dc; border-radius: 11px; background: #fff; }
.password-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(23,105,255,.13); outline: none; }
.password-toggle { position: absolute; top: 6px; right: 6px; min-width: 76px; height: 40px; padding: 0 10px; color: var(--blue-dark); background: #edf3ff; border: 0; border-radius: 8px; font-size: 13px; font-weight: 750; cursor: pointer; }
.field-help { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.form-error { min-height: 22px; margin: 10px 0 4px; color: var(--danger); font-size: 13px; font-weight: 700; }
.primary-button { width: 100%; min-height: 50px; border: 0; border-radius: 11px; color: #fff; background: var(--blue); font-weight: 800; cursor: pointer; box-shadow: 0 10px 24px rgba(23,105,255,.22); }
.primary-button:hover { background: var(--blue-dark); }
.support-link { margin: 22px 0 0; color: var(--muted); font-size: 13px; }
.support-link a { font-weight: 750; }

/* Library shell */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(7,26,51,.96); border-bottom: 1px solid rgba(255,255,255,.11); backdrop-filter: blur(12px); }
.header-inner { width: min(1180px, calc(100% - 40px)); min-height: 70px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; }
.brand img { border-radius: 12px; }
.brand span { display: grid; line-height: 1.15; }
.brand strong { font-size: 16px; letter-spacing: .06em; }
.brand small { margin-top: 3px; color: #cbd9eb; font-size: 11px; }
.logout-button { min-width: 70px; min-height: 42px; padding: 8px 15px; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.35); border-radius: 9px; font-weight: 750; cursor: pointer; }
.logout-button:hover { background: rgba(255,255,255,.1); }
.hero { color: #fff; background: linear-gradient(135deg, var(--navy), var(--navy-2)); overflow: hidden; }
.hero-inner { width: min(1180px, calc(100% - 40px)); min-height: 310px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 50px; padding: 58px 0; }
.hero .eyebrow { color: var(--cyan); }
.hero h1 { max-width: 760px; margin: 0; font-size: clamp(35px, 5vw, 58px); line-height: 1.04; letter-spacing: -.035em; text-wrap: balance; }
.hero-copy { max-width: 680px; margin: 18px 0 0; color: #d5e2f3; font-size: 18px; }
.hero-stat { flex: 0 0 165px; min-height: 165px; display: grid; place-content: center; text-align: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 50%; }
.hero-stat strong { font-size: 48px; line-height: 1; }
.hero-stat span { max-width: 105px; margin-top: 7px; color: #d5e2f3; font-size: 12px; line-height: 1.3; }
.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 60px; }

/* Install guide */
.install-guide { margin-bottom: 48px; background: var(--surface); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 10px 30px rgba(15,43,78,.06); overflow: hidden; }
.install-guide summary { min-height: 92px; padding: 20px 24px; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 15px; list-style: none; cursor: pointer; }
.install-guide summary::-webkit-details-marker { display: none; }
.summary-icon { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; background: var(--blue); border-radius: 50%; font-weight: 900; }
.install-guide summary strong, .install-guide summary small { display: block; }
.install-guide summary strong { font-size: 18px; }
.install-guide summary small { margin-top: 3px; color: var(--muted); font-size: 14px; }
.summary-action { color: var(--blue-dark); font-size: 13px; font-weight: 800; }
.install-guide[open] .summary-action { font-size: 0; }
.install-guide[open] .summary-action::after { content: "Fechar guia"; font-size: 13px; }
.guide-content { padding: 4px 24px 26px; border-top: 1px solid var(--line); }
.guide-grid { margin: 24px 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; list-style: none; counter-reset: guide; }
.guide-grid li { min-width: 0; display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.step-number { width: 32px; height: 32px; display: grid; place-items: center; color: #fff; background: var(--blue); border-radius: 50%; font-size: 14px; font-weight: 850; }
.guide-grid h2 { margin: 1px 0 4px; font-size: 17px; }
.guide-grid p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.guide-grid img { display: block; width: 100%; height: 210px; object-fit: contain; object-position: left top; border: 1px solid var(--line); border-radius: 11px; background: #f7f9fc; }
.guide-warning { margin: 0; padding: 14px 16px; color: #6d4b00; background: #fff8df; border: 1px solid #f0d989; border-radius: 10px; font-size: 13px; }

/* Catalog */
.catalog-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.catalog-heading h2 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; }
.result-count { margin: 0; color: var(--muted); font-size: 14px; }
.catalog-tools { position: sticky; top: 82px; z-index: 10; margin-bottom: 24px; padding: 16px; background: rgba(243,247,252,.94); border: 1px solid var(--line); border-radius: 15px; backdrop-filter: blur(14px); }
.search-field { position: relative; display: block; }
.search-field svg { position: absolute; top: 15px; left: 15px; width: 21px; height: 21px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search-field input { width: 100%; height: 52px; padding: 0 18px 0 48px; color: var(--ink); background: #fff; border: 1px solid #bdcbdd; border-radius: 11px; }
.search-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(23,105,255,.12); outline: none; }
.filters { margin-top: 12px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.filter-button { flex: 0 0 auto; min-height: 38px; padding: 7px 13px; color: #4c607b; background: #fff; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 750; cursor: pointer; }
.filter-button:hover, .filter-button.is-active { color: #fff; background: var(--blue); border-color: var(--blue); }
.snippet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.snippet-card { min-width: 0; min-height: 305px; padding: 22px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 25px rgba(15,43,78,.05); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.snippet-card:hover { transform: translateY(-3px); border-color: #b8cdf1; box-shadow: 0 16px 34px rgba(15,43,78,.1); }
.snippet-card[hidden] { display: none; }
.card-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.snippet-number { color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .1em; }
.difficulty { padding: 4px 8px; color: var(--muted); background: #f2f5f9; border-radius: 999px; font-size: 10px; font-weight: 750; }
.snippet-card h3 { margin: 16px 0 10px; font-size: 21px; line-height: 1.22; text-wrap: balance; }
.snippet-card h3 a { color: var(--ink); text-decoration: none; }
.snippet-card h3 a::after { content: ""; position: absolute; }
.snippet-card > p { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.card-footer { margin-top: auto; padding-top: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; border-top: 1px solid #e9eef5; }
.card-footer > span { padding: 4px 7px; color: #52647e; background: #f2f6fb; border-radius: 5px; font-size: 10px; font-weight: 750; }
.card-footer a { margin-left: auto; color: var(--blue-dark); font-size: 13px; font-weight: 800; text-decoration: none; }
.no-results { padding: 60px 24px; text-align: center; background: #fff; border: 1px dashed #b8c7d9; border-radius: 16px; }
.no-results strong { font-size: 21px; }
.no-results p { margin: 5px 0 0; color: var(--muted); }
.site-footer { padding: 30px 20px 42px; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 30px; color: #73839a; background: #eaf0f7; font-size: 13px; }
.site-footer p { margin: 0; }
.site-footer div { display: flex; gap: 18px; }
.site-footer a { color: #53667f; font-weight: 700; }

@media (max-width: 960px) {
  .snippet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stat { display: none; }
  .guide-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .login-shell { padding: 18px 14px; }
  .login-card { padding: 30px 22px; border-radius: 19px; }
  .login-logo { width: 72px; height: 72px; }
  .header-inner, .hero-inner, .page-shell { width: min(100% - 28px, 1180px); }
  .brand small { display: none; }
  .hero-inner { min-height: 0; padding: 43px 0 47px; }
  .hero h1 { font-size: 38px; }
  .hero-copy { font-size: 16px; }
  .page-shell { padding-top: 20px; }
  .install-guide { margin-bottom: 38px; }
  .install-guide summary { min-height: 84px; padding: 16px; grid-template-columns: 38px 1fr; gap: 11px; }
  .summary-icon { width: 36px; height: 36px; }
  .install-guide summary strong { font-size: 15px; }
  .install-guide summary small { font-size: 12px; }
  .summary-action { grid-column: 2; }
  .guide-content { padding: 2px 16px 18px; }
  .guide-grid { gap: 25px; }
  .guide-grid img { height: auto; max-height: 230px; }
  .catalog-heading { align-items: start; flex-direction: column; gap: 8px; }
  .catalog-tools { top: 78px; margin-left: -3px; margin-right: -3px; padding: 10px; }
  .search-field input { font-size: 16px; }
  .snippet-grid { grid-template-columns: 1fr; }
  .snippet-card { min-height: 280px; padding: 20px; }
  .site-footer { flex-direction: column; align-items: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

