/* ======================================================
   Check no Concurso — Login + CTA "Assinar agora"
   Paleta Família Check. Amarelo sempre com texto navy (#0B2239).
   ====================================================== */

/* CTA "ASSINAR AGORA" — destaque máximo */
.btn-cta-subscribe {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--accent-premium);
  color: var(--text-on-accent);
  font-family: var(--font-body, inherit);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(11, 34, 57, 0.10);
  transition: background 0.15s ease;
}
.btn-cta-subscribe:hover { background: var(--accent-hover, #E2C21A); }
.btn-cta-subscribe:active { background: #D4B514; }
.btn-cta-subscribe:focus-visible {
  outline: 3px solid var(--focus-ring, #0C4F83);
  outline-offset: 3px;
}
.btn-cta-subscribe .cta-arrow { width: 14px; height: 14px; transition: transform 0.15s ease; }
.btn-cta-subscribe:hover .cta-arrow { transform: translateX(2px); }
.btn-cta-subscribe.is-pro {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand-border);
  box-shadow: none;
  font-size: 14px;
  min-height: 42px;
}
.btn-cta-subscribe.is-pro:hover { transform: none; background: var(--brand-soft); }

.btn-cta-block {
  width: 100%;
  min-height: 50px;
  font-size: 16px;
}
.hero-cta-note {
  margin-top: 10px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}

/* BOTÃO ENTRAR + MENU DA CONTA (discreto, sem borda) */
.btn-login {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-login svg { width: 17px; height: 17px; color: var(--muted); }
.btn-login[hidden], .account-wrap[hidden] { display: none; }
.btn-login:hover { background: var(--surface-alt); color: var(--brand); }
.btn-login:hover svg { color: var(--brand); }
.btn-login:focus-visible, .account-chip:focus-visible { outline: 3px solid var(--focus-ring, #0C4F83); outline-offset: 2px; }

.account-wrap { position: relative; }
.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px 0 5px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.account-chip:hover { border-color: var(--brand-border); }
.account-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: var(--text-on-brand);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.account-chip-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
  z-index: 300;
}
.account-menu[hidden] { display: none; }
.account-menu-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 10px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.account-menu-head strong { font-size: 15px; color: var(--ink); }
.account-menu-head small { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.account-plan-tag {
  align-self: flex-start;
  margin-top: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  background: var(--surface-alt);
  color: var(--ink-2);
}
.account-plan-tag.is-essencial { background: var(--brand-soft); color: var(--brand); }
.account-plan-tag.is-completo { background: var(--accent-premium); color: var(--text-on-accent); }
.account-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.account-menu-item:hover, .account-menu-item:focus-visible { background: var(--surface-alt); outline: none; }
.account-menu-item.is-danger { color: var(--status-danger-fg, #B91C1C); }

/* MODAL DE LOGIN / CRIAR CONTA */
.auth-dialog {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  width: min(880px, 100%);
  max-height: min(94vh, 720px);
  overflow: hidden;
  border-radius: 22px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
}
.auth-side {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 36px 32px;
  background:
    radial-gradient(circle at 100% 0%, rgba(244, 214, 50, 0.16), transparent 42%),
    linear-gradient(160deg, #0C4F83 0%, var(--bg-inverse, #0B2540) 72%);
  color: var(--text-on-inverse, #F4F8FB);
}
.auth-side-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display, inherit); font-size: 17px; }
.auth-side-title { font-family: var(--font-display, inherit); font-size: 27px; line-height: 1.2; font-weight: 800; color: #FFFFFF; }
.auth-benefits { list-style: none; padding: 0; margin: 0; display: grid; gap: 13px; }
.auth-benefits li {
  position: relative;
  padding-left: 30px;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--text-on-inverse, #F4F8FB);
}
.auth-benefits li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-premium) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B2239' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5 12.5 10 17 19 7'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.auth-side-foot { margin-top: auto; font-size: 13px; color: var(--text-on-inverse-muted, #C5D5E4); }

.auth-main {
  position: relative;
  padding: 30px 36px 28px;
  overflow-y: auto;
}
.auth-close { position: absolute; top: 14px; right: 14px; }

.auth-tabs {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 4px;
  padding: 4px;
  margin-bottom: 22px;
  border-radius: 12px;
  background: var(--surface-alt);
}
.auth-tab {
  border: 0;
  background: transparent;
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
}
.auth-tab.active { background: var(--bg-surface); color: var(--brand); box-shadow: 0 1px 3px rgba(11, 37, 64, 0.14); }
.auth-tab:focus-visible { outline: 3px solid var(--focus-ring, #0C4F83); outline-offset: 1px; }

.auth-title { font-family: var(--font-display, inherit); font-size: 25px; line-height: 1.2; font-weight: 800; color: var(--ink); }
.auth-sub { margin: 6px 0 20px; font-size: 14.5px; color: var(--muted); }

.btn-google {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.btn-google:hover { background: var(--surface-alt); }
.btn-google:focus-visible { outline: 3px solid var(--focus-ring, #0C4F83); outline-offset: 2px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  font-size: 12.5px;
  color: var(--muted);
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.auth-form { display: grid; gap: 15px; }
.auth-field { display: grid; gap: 6px; }
.auth-field[hidden], .auth-remember[hidden], .auth-legal[hidden], .auth-error[hidden], .auth-link[hidden] { display: none; }
.auth-field label, .auth-label-row label { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.auth-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.auth-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--border-default, #C5D5E4);
  border-radius: 11px;
  background: var(--bg-surface);
  color: var(--ink);
  font-size: 16px; /* evita zoom automático no iOS */
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-field input::placeholder { color: #6A8197; }
.auth-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.auth-field input[aria-invalid="true"] { border-color: var(--status-danger-fg, #B91C1C); }
.auth-error { font-size: 12.5px; font-weight: 600; color: var(--status-danger-fg, #B91C1C); }

.auth-password { position: relative; }
.auth-password input { padding-right: 50px; }
.auth-eye {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.auth-eye:hover, .auth-eye[aria-pressed="true"] { color: var(--brand); }
.auth-eye:focus-visible { outline: 3px solid var(--focus-ring, #0C4F83); outline-offset: -3px; }

.auth-link {
  border: 0;
  background: transparent;
  padding: 2px 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.auth-link:hover { color: var(--brand-hover); }

.auth-remember { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.auth-remember input { width: 18px; height: 18px; accent-color: var(--brand); }

.btn-auth-submit {
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: var(--text-on-brand);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-auth-submit:hover { background: var(--brand-hover); }
.btn-auth-submit:focus-visible { outline: 3px solid var(--focus-ring, #0C4F83); outline-offset: 3px; }

.auth-switch { margin-top: 18px; text-align: center; font-size: 14px; color: var(--ink-2); }
.auth-legal { margin-top: 10px; text-align: center; font-size: 12px; color: var(--muted); }

@media (max-width: 860px) {
  .auth-dialog { grid-template-columns: 1fr; width: min(480px, 100%); }
  .auth-side { display: none; }
}

/* ======================================================
   BUSCA — aviso de resultados, sugestões e foco
   ====================================================== */
.search-box { margin: 0; }
.search-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}
#globalSearchInput { font-size: 16px; } /* evita zoom automático no iPhone */
#globalSearchInput::-webkit-search-cancel-button,
#globalSearchInput::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.search-clear { min-width: 36px; min-height: 36px; border-radius: 9px; }
.search-clear:hover { background: var(--surface-alt); }
.search-hint {
  margin: 10px 2px 0;
  font-size: 13.5px;
  color: var(--ink-2);
}
.search-hint[hidden] { display: none; }
.search-hint strong { color: var(--brand); font-variant-numeric: tabular-nums; }
.search-hint.is-empty { color: var(--status-danger-fg, #B91C1C); }
.search-hint-link {
  border: 0;
  background: transparent;
  padding: 2px 0;
  color: var(--brand);
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.search-empty { display: grid; justify-items: center; gap: 12px; text-align: center; }
.search-suggest-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
}

/* Faixa de testes da equipe: fora do site público (aparece só com ?demo=1) */
.demo-bar[hidden] { display: none !important; }

/* Botão "Instalar App" no topo: mesmo estilo discreto do Entrar */
.site-header #installPwaBtn { border: 0; background: transparent; color: var(--muted); border-radius: 10px; }
.site-header #installPwaBtn:hover { background: var(--surface-alt); color: var(--brand); }

/* Header sem quebra de linha com Entrar + CTA */
.site-header .nav-link,
.site-header .brand-text,
.site-header .btn-ghost-sm,
.site-header .btn-login { white-space: nowrap; }
.site-header .brand-text { flex-wrap: nowrap; }
@media (max-width: 1360px) {
  #installPwaBtn { padding: 0; width: 44px; height: 44px; justify-content: center; }
  #installPwaBtn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@media (max-width: 1180px) {
  .site-header .brand-text small { display: none; }
  .site-header .nav-link { padding: 8px 10px; }
  .site-header .desktop-nav { gap: 2px; }
}
@media (max-width: 1040px) {
  .btn-login { padding: 0; width: 44px; justify-content: center; }
  .btn-login-label, .account-chip-name { display: none; }
}

/* Celular: "Entrar" vira ícone, CTA dourado continua visível no topo */
@media (max-width: 768px) {
  .btn-login { padding: 0; width: 44px; justify-content: center; }
  .btn-login-label, .account-chip-name { display: none; }
  .account-chip { padding: 0 6px 0 5px; }
  .btn-cta-subscribe:not(.btn-cta-block) { min-height: 44px; padding: 0 14px; font-size: 14px; }
  .btn-cta-subscribe:not(.btn-cta-block) .cta-arrow { display: none; }
  .mobile-bottom-nav { grid-template-columns: repeat(5, 1fr); }
  .auth-backdrop { align-items: flex-end; padding: 0; }
  .auth-dialog { width: 100%; max-height: 94vh; border-radius: 22px 22px 0 0; }
  .auth-main { padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
}
@media (max-width: 480px) {
  .site-header .container { padding: 0 14px; }
  .site-header .header-inner { gap: 8px; height: 64px; }
  .site-header .brand { gap: 7px; min-width: 0; }
  .site-header .brand-mark svg { width: 26px; height: 26px; }
  .site-header .brand-text { font-size: 14.5px; }
  .site-header .brand-text small { display: none; }
  .header-actions { gap: 6px; flex-shrink: 0; }
  .btn-login { width: 40px; min-height: 40px; }
  .btn-cta-subscribe:not(.btn-cta-block) { min-height: 38px; padding: 0 12px; font-size: 13.5px; }
}
/* ======================================================
   BLOCO "GRÁTIS, SEM ASSINAR" — primeira tela
   ====================================================== */
.hero:has(.free-access:not([hidden])) { padding-top: 40px; padding-bottom: 48px; }
.free-access {
  margin-top: 22px;
  padding: 16px 20px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-surface);
}
.free-access[hidden] { display: none; }
.free-access-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.free-access-tag {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--status-open-bg, #E6F7EE);
  color: var(--status-open-fg, #0C6B3B);
  border: 1px solid var(--status-open-border, #88D8AF);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.free-access-head h2 {
  font-family: var(--font-display, inherit);
  font-size: 17px;
  line-height: 1.3;
  font-weight: 800;
  color: var(--ink);
}
.free-access-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.free-access-col h3 {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.free-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.free-list li {
  position: relative;
  padding-left: 26px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-2);
}
.free-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 11px;
}
.free-list.is-free li::before {
  background-color: var(--status-open-bg, #E6F7EE);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230C6B3B' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5 12.5 10 17 19 7'/%3E%3C/svg%3E");
}
.free-list.is-locked li { color: var(--muted); }
.free-list.is-locked li::before {
  background-color: var(--surface-alt);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234D657C' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
}
.free-list em { font-style: normal; font-weight: 700; color: var(--accent-text, #734B00); }
.free-samples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.free-sample {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}
.free-sample:hover { background: var(--brand); color: var(--text-on-brand); }
.free-sample:focus-visible, .free-access-link:focus-visible { outline: 3px solid var(--focus-ring, #0C4F83); outline-offset: 2px; }
.free-access-link {
  margin-top: 8px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
@media (max-width: 600px) {
  .free-access { padding: 18px 16px 14px; }
  .free-access-cols { grid-template-columns: 1fr; gap: 16px; }
}

/* Correção mobile: hero não estoura a largura da tela */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-grid > * { min-width: 0; }
}
@media (max-width: 768px) {
  .concursos-grid { grid-template-columns: minmax(0, 1fr); }
  .contest-card, .contest-card > * { min-width: 0; max-width: 100%; }
  .contest-card .card-metrics > * { min-width: 0; overflow-wrap: anywhere; }
}
@media (max-width: 360px) {
  .btn-cta-subscribe:not(.btn-cta-block) .cta-label-extra { display: none; }
}
