/* ============================================
   FERRAMENTAS ENG - Design System
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Tema claro — paleta da logo FerramentasEng (azul-marinho + laranja) */

  /* Cores Base */
  --bg-primary: #f7f8fc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #eef1f7;

  /* Surfaces */
  --surface-bg: #f7f8fc;
  --surface-1: #ffffff;
  --surface-2: #f3f5fa;
  --surface-3: #e9edf5;
  --surface-hover: #fdfdfe;
  --surface-glass: rgba(255, 255, 255, 0.85);

  /* Accent */
  --accent-blue: #2563eb;
  --accent-cyan: #0e7490;
  --accent-teal: #0d9488;
  --accent-purple: #7c3aed;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-green: #16a34a;
  --accent-orange: #f26a21;
  --accent-navy: #14315c;

  /* Marca (ações primárias em laranja, como o CTA do iLovePDF) */
  --brand-primary: #f26a21;
  --brand-secondary: #d95713;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #f26a21, #e05a10);
  --gradient-hero: linear-gradient(135deg, #14315c 0%, #1d4ed8 100%);
  --gradient-card-border: linear-gradient(135deg, rgba(242,106,33,0.3), rgba(20,49,92,0.1), transparent);
  --gradient-bg: linear-gradient(180deg, #ffffff 0%, #f7f8fc 100%);

  /* Text */
  --text-primary: #1c2b41;
  --text-secondary: #51617a;
  --text-muted: #7d8ba1;
  --text-accent: #f26a21;

  /* Borders */
  --border-subtle: #e6eaf2;
  --border-medium: #d7deea;
  --border-strong: #b9c5d8;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(20,49,92,0.08);
  --shadow-md: 0 4px 16px rgba(20,49,92,0.08);
  --shadow-lg: 0 10px 32px rgba(20,49,92,0.12);
  --shadow-xl: 0 20px 48px rgba(20,49,92,0.16);
  --shadow-glow-blue: 0 4px 20px rgba(37,99,235,0.12);
  --shadow-glow-cyan: 0 4px 20px rgba(242,106,33,0.14);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Transition */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Container */
  --container-max: 1400px;
  --container-padding: 1.5rem;

  /* Altura do header fixo no seu estado mais alto: o botão do usuário
     (avatar de 32px + 0,5rem de padding + borda = 50px) somado ao padding
     vertical do header e à borda de baixo. Toda página que começa no topo
     precisa descer isso — senão o título nasce embaixo da barra. O número
     mora aqui, e não repetido em cada página, justamente para não divergir:
     era esse o motivo de "Escolha seu Plano" aparecer cortado. */
  --header-h: calc(50px + 2 * var(--space-md) + 1px);

  /* Onde o conteúdo de uma página pode começar: o header mais um respiro. */
  --topo-da-pagina: calc(var(--header-h) + var(--space-2xl));
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

ul, ol {
  list-style: none;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

/* --- Container --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* ============================================
   HEADER
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: var(--space-md) 0;
  transition: var(--transition-base);
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-sm) 0;
}

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

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.header__logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.header__logo-text {
  color: var(--accent-navy);
}

.header__logo-text--accent,
.footer__logo-text--accent {
  color: var(--accent-orange);
}


.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
}

.header__nav-links {
  display: flex;
  gap: var(--space-xl);
}

.header__nav-link {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-primary);
  transition: var(--transition-fast);
  position: relative;
}

.header__nav-link:hover {
  color: var(--accent-orange);
}

.header__nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: var(--transition-base);
}

.header__nav-link:hover::after {
  width: 100%;
}

.header__cta {
  padding: 0.65rem 1.5rem;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  color: white;
  transition: var(--transition-base);
  box-shadow: 0 2px 10px rgba(242,106,33,0.3);
}

.header__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(242,106,33,0.35);
}

/* Mobile Menu */
.header__mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.header__mobile-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition-base);
}

/* ============================================
   TOOLS SECTION
   ============================================ */
.tools {
  padding: var(--space-4xl) 0;
  position: relative;
}

/* Landing: usuário cai direto nas ferramentas (estilo iLovePDF) */
.tools--landing {
  padding-top: var(--topo-da-pagina);
  background:
    radial-gradient(640px 420px at 96% -5%, rgba(242, 106, 33, 0.07), transparent 70%),
    radial-gradient(520px 420px at -4% 30%, rgba(20, 49, 92, 0.05), transparent 70%);
}

.section__title--landing {
  font-size: clamp(2.3rem, 4.8vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.section__description--landing {
  max-width: 880px;
  font-size: 1.22rem;
  line-height: 1.65;
}

.section__header--landing {
  margin-bottom: var(--space-xl);
}

/* Auth no header: Entrar (texto) + Registre-se (botão) */
#authBtn {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.header__auth-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.header__auth-link:hover {
  color: var(--accent-orange);
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section__label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-orange);
  margin-bottom: var(--space-sm);
}

.section__title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
}

.section__description {
  color: var(--text-secondary);
  max-width: 550px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* Category Filters */
.tools__filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.tools__filter-btn {
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--surface-1);
  border: 1px solid var(--border-medium);
  transition: var(--transition-base);
}

.tools__filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background: var(--surface-2);
}

.tools__filter-btn.active {
  color: white;
  background: var(--text-primary);
  border-color: transparent;
}

/* Tools Grid */
.tools__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.25rem;
}

/* ============================================
   TOOL CARD
   ============================================ */
.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.9rem 1.75rem 2.1rem;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  cursor: pointer;
  transition: var(--transition-base);
  overflow: hidden;
  text-decoration: none;
}

.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(242,106,33,0.04), transparent 60%);
  opacity: 0;
  transition: var(--transition-base);
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-lg);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card__icon-wrapper {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 1.1rem;
  position: relative;
  z-index: 1;
  transition: var(--transition-base);
}

.tool-card:hover .tool-card__icon-wrapper {
  transform: scale(1.08);
}

.tool-card__icon-wrapper svg {
  width: 36px;
  height: 36px;
  stroke-width: 2;
}

/* Category colors for icons */
.tool-card__icon-wrapper--memoriais { color: #e5322d; }
.tool-card__icon-wrapper--calculos { color: #2f9e44; }
.tool-card__icon-wrapper--conversores { color: #2563eb; }
.tool-card__icon-wrapper--documentos { color: #f26a21; }

.tool-card__title {
  font-size: 1.16rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}

.tool-card__description {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex-grow: 1;
  position: relative;
  z-index: 1;
}

/* Card hidden by filter */
.tool-card.hidden {
  display: none;
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.features {
  padding: var(--space-4xl) 0;
  background: var(--gradient-bg);
  position: relative;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-3xl);
}

.feature-card {
  padding: var(--space-2xl);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  text-align: center;
  transition: var(--transition-base);
}

.feature-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.feature-card__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-lg);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-card__icon svg {
  width: 30px;
  height: 30px;
}

.feature-card__icon--speed {
  background: rgba(59,130,246,0.12);
  color: var(--accent-blue);
}

.feature-card__icon--precision {
  background: rgba(20,184,166,0.12);
  color: var(--accent-teal);
}

.feature-card__icon--free {
  background: rgba(139,92,246,0.12);
  color: var(--accent-purple);
}

.feature-card__title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.feature-card__description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta {
  padding: var(--space-4xl) 0;
  text-align: center;
}

.cta__card {
  padding: var(--space-4xl) var(--space-2xl);
  background: var(--surface-1);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-2xl);
  position: relative;
  overflow: hidden;
}

.cta__card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(242,106,33,0.06), rgba(20,49,92,0.03), transparent);
  pointer-events: none;
}

.cta__title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: var(--space-md);
  position: relative;
}

.cta__description {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto var(--space-2xl);
  position: relative;
}

.cta__button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.9rem 2.2rem;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 600;
  color: white;
  transition: var(--transition-base);
  box-shadow: 0 4px 20px rgba(242,106,33,0.3);
  position: relative;
}

.cta__button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(242,106,33,0.35);
}

.cta__button svg {
  width: 18px;
  height: 18px;
  transition: var(--transition-base);
}

.cta__button:hover svg {
  transform: translateX(3px);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: var(--space-3xl) 0 var(--space-xl);
  border-top: 1px solid var(--border-subtle);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.footer__logo-img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.footer__logo-text {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-navy);
}

.footer__copyright {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer__links {
  display: flex;
  gap: var(--space-xl);
}

.footer__link {
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

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

/* ============================================
   TOOL PAGE STYLES
   ============================================ */
.tool-page {
  padding: var(--topo-da-pagina) 0 var(--space-4xl);
  min-height: 100vh;
}

.tool-page__breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tool-page__breadcrumb a {
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.tool-page__breadcrumb a:hover {
  color: var(--text-accent);
}

.tool-page__breadcrumb-separator {
  color: var(--text-muted);
}

.tool-page__header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.tool-page__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-lg);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59,130,246,0.12);
  color: var(--accent-blue);
}

.tool-page__icon svg {
  width: 36px;
  height: 36px;
}

.tool-page__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.tool-page__description {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 550px;
  margin: 0 auto;
}

/* Upload Area */
.upload-area {
  max-width: 700px;
  margin: 0 auto var(--space-2xl);
  padding: var(--space-4xl) var(--space-2xl);
  background: var(--surface-1);
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-2xl);
  text-align: center;
  cursor: pointer;
  transition: var(--transition-base);
  position: relative;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--accent-orange);
  background: var(--surface-2);
  box-shadow: var(--shadow-glow-blue);
}

.upload-area__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-lg);
  color: var(--text-muted);
  transition: var(--transition-base);
}

.upload-area:hover .upload-area__icon {
  color: var(--accent-orange);
  transform: translateY(-4px);
}

.upload-area__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.upload-area__subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.upload-area__browse {
  color: var(--accent-orange);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.upload-area__formats {
  margin-top: var(--space-lg);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* Config Panel */
.config-panel {
  max-width: 700px;
  margin: 0 auto var(--space-2xl);
  padding: var(--space-xl);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
}

.config-panel__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.config-panel__title svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.config-panel__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.config-panel__row:last-child {
  border-bottom: none;
}

.config-panel__label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.config-panel__select {
  padding: 0.4rem 0.8rem;
  background: var(--surface-2);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.config-panel__select:focus {
  border-color: var(--accent-blue);
}

/* Action Button */
.tool-page__actions {
  text-align: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 1rem 2.5rem;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  font-size: 1.05rem;
  font-weight: 600;
  color: white;
  transition: var(--transition-base);
  box-shadow: 0 4px 20px rgba(242,106,33,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(242,106,33,0.35);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   PROGRESS AREA
   ============================================ */
.progress-area {
  display: none;
  max-width: 700px;
  margin: 0 auto var(--space-2xl);
  text-align: center;
}

.progress-area__bar {
  width: 100%;
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.progress-area__fill {
  width: 0%;
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.progress-area__text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  animation: pulse 1.5s ease-in-out infinite;
}

/* ============================================
   RESULT AREA
   ============================================ */
.result-area {
  display: none;
  max-width: 700px;
  margin: 0 auto var(--space-2xl);
  padding: var(--space-xl);
  background: var(--surface-1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-xl);
}

.result-area__header {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.result-area__icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: var(--radius-lg);
  background: rgba(34, 197, 94, 0.12);
  color: var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-area__icon svg {
  width: 24px;
  height: 24px;
}

.result-area__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-green);
}

.result-area__subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.result-area__file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
}

.result-area__file-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.result-area__file-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius-md);
  background: rgba(59,130,246,0.12);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-area__file-icon svg {
  width: 20px;
  height: 20px;
}

.result-area__file-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.result-area__file-size {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Download Button */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.65rem 1.5rem;
  background: linear-gradient(135deg, #22c55e, #14b8a6);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  border: none;
  cursor: pointer;
  transition: var(--transition-base);
  box-shadow: 0 2px 12px rgba(34, 197, 94, 0.3);
  white-space: nowrap;
}

.btn-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
}

.btn-download svg {
  width: 18px;
  height: 18px;
}

/* ---- Hero Download Button (Big & Prominent) ---- */
.btn-download-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  width: 100%;
  padding: 1.25rem 2rem;
  background: linear-gradient(135deg, #22c55e 0%, #14b8a6 50%, #06b6d4 100%);
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
  border-radius: var(--radius-xl);
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow:
    0 4px 20px rgba(34, 197, 94, 0.4),
    0 0 40px rgba(34, 197, 94, 0.15);
  letter-spacing: 0.02em;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.btn-download-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%, rgba(255,255,255,0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-download-hero:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow:
    0 8px 32px rgba(34, 197, 94, 0.5),
    0 0 60px rgba(34, 197, 94, 0.25);
}

.btn-download-hero:hover::before {
  opacity: 1;
}

.btn-download-hero:active {
  transform: translateY(-1px) scale(0.99);
}

.btn-download-hero:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.btn-download-hero svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.btn-download-hero--success {
  background: linear-gradient(135deg, #22c55e, #10b981) !important;
  animation: none !important;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* File info row (compact) */
.result-area__file-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-md);
}

.result-area__file-icon-small {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.result-area__file-icon-small svg {
  width: 20px;
  height: 20px;
}

.result-area__file-row .result-area__file-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.result-area__file-row .result-area__file-size {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* Secondary Button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.6rem 1.4rem;
  background: var(--surface-2);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-base);
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.btn-secondary svg {
  width: 16px;
  height: 16px;
}

.result-area__actions {
  text-align: center;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* ---- Tablet landscape / small desktop ---- */
@media (max-width: 1024px) {
  .tools__grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-md);
  }

  .features__grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-md);
  }

}

/* ---- Tablet / Mobile landscape ---- */
@media (max-width: 768px) {
  :root {
    --container-padding: 1.25rem;
  }

  /* Header */
  .header__nav-links {
    display: none;
  }

  .header__cta {
    display: none;
  }

  .header__mobile-toggle {
    display: flex;
  }

  /* Mobile Menu */
  .header__nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
    gap: var(--space-lg);
    z-index: 100;
  }

  /* Hero */
  /* Tools Grid */
  .tools__grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  /* Features */
  .features__grid {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer__inner {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
  }

  .footer__links {
    justify-content: center;
  }

  /* Tool Page */
  .tool-page {
    padding: calc(var(--header-h) + var(--space-xl)) 0 var(--space-3xl);
  }

  .tool-page__header {
    margin-bottom: var(--space-2xl);
  }

  .tool-page__title {
    font-size: 1.4rem;
  }

  .tool-page__description {
    font-size: 0.95rem;
  }

  /* Upload Area */
  .upload-area {
    max-width: 100%;
    padding: var(--space-3xl) var(--space-lg);
    margin: 0 auto var(--space-xl);
  }

  .upload-area__icon {
    width: 48px;
    height: 48px;
  }

  .upload-area__title {
    font-size: 1rem;
  }

  /* Config Panel */
  .config-panel {
    max-width: 100%;
    padding: var(--space-lg);
    margin: 0 auto var(--space-xl);
  }

  .config-panel__row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
  }

  .config-panel__select {
    width: 100%;
  }

  /* Progress & Result */
  .progress-area {
    max-width: 100%;
  }

  .result-area {
    max-width: 100%;
    padding: var(--space-lg);
  }

  .result-area__file {
    flex-direction: column;
    gap: var(--space-md);
    align-items: stretch;
    text-align: center;
  }

  .result-area__file-info {
    justify-content: center;
  }

  .btn-download {
    width: 100%;
    justify-content: center;
  }

  /* Buttons */
  .btn-primary {
    padding: 0.85rem 2rem;
    font-size: 0.95rem;
    width: 100%;
    justify-content: center;
  }

  .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  /* CTA */
  .cta__card {
    padding: var(--space-3xl) var(--space-lg);
  }
}

/* ---- Small mobile (landscape-ish) ---- */
@media (max-width: 600px) {
  .tools__grid {
    grid-template-columns: 1fr;
  }

  .tool-page__icon {
    width: 56px;
    height: 56px;
  }

  .tool-page__icon svg {
    width: 28px;
    height: 28px;
  }

  .result-area__header {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
  }

  .result-area__icon {
    margin: 0 auto;
  }
}

/* ---- Portrait phones ---- */
@media (max-width: 480px) {
  :root {
    --container-padding: 1rem;
  }

  .tools__filters {
    gap: var(--space-xs);
  }

  .tools__filter-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .section__title {
    font-size: 1.4rem;
  }

  .section__description {
    font-size: 0.9rem;
  }

  .tool-page__breadcrumb {
    font-size: 0.75rem;
    flex-wrap: wrap;
  }

  .upload-area {
    padding: var(--space-2xl) var(--space-md);
  }

  .config-panel__title {
    font-size: 0.9rem;
  }

  .config-panel__label {
    font-size: 0.85rem;
  }

  .config-panel__select {
    font-size: 0.8rem;
  }

  .result-area__title {
    font-size: 0.95rem;
  }

  .result-area__file-name {
    font-size: 0.8rem;
    word-break: break-all;
  }

  .footer__copyright {
    font-size: 0.7rem;
  }

  .footer__link {
    font-size: 0.8rem;
  }

  .footer__links {
    gap: var(--space-md);
  }
}

/* ---- Very small screens ---- */
@media (max-width: 360px) {
  .tool-page {
    padding: calc(var(--header-h) + var(--space-md)) 0 var(--space-2xl);
  }

  .tool-page__title {
    font-size: 1.2rem;
  }

  .btn-primary {
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
  }

  .btn-download {
    padding: 0.55rem 1.2rem;
    font-size: 0.8rem;
  }
}

/* ============================================
   NO RESULTS STATE
   ============================================ */
.tools__no-results {
  text-align: center;
  padding: var(--space-4xl) var(--space-xl);
  display: none;
}

.tools__no-results.show {
  display: block;
}

.tools__no-results-icon {
  margin-bottom: var(--space-md);
  color: var(--text-muted);
}

.tools__no-results-icon svg {
  width: 52px;
  height: 52px;
}

.tools__no-results-text {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ============================================
   HEADER AUTH & USER MENU
   ============================================ */
.header__user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition-base);
  margin-left: var(--space-md);
}

.header__user-menu:hover {
  border-color: var(--border-medium);
  background: var(--surface-2);
}

.header__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-medium);
}

.header__avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}

.header__user-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header__user-dropdown {
  position: absolute;
  top: calc(100% + var(--space-sm));
  right: 0;
  background: var(--surface-1);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: var(--space-xs);
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.header__user-menu.open .header__user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header__dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 0.8rem 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: var(--transition-base);
}

.header__dropdown-item:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.header__dropdown-item--admin {
  color: var(--brand-primary);
}
.header__dropdown-item--admin:hover {
  background: rgba(242, 106, 33, 0.1);
  color: var(--brand-secondary);
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--topo-da-pagina) var(--space-lg) var(--space-2xl);
  position: relative;
  overflow: hidden;
}

.login-page__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  z-index: -1;
}

.login-page__orb--1 {
  width: 500px;
  height: 500px;
  background: var(--brand-primary);
  top: -100px;
  left: -100px;
}

.login-page__orb--2 {
  width: 400px;
  height: 400px;
  background: var(--brand-secondary);
  bottom: -100px;
  right: -100px;
}

.login-page__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(20,49,92,0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20,49,92,0.045) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -1;
  mask-image: radial-gradient(circle at center, black, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at center, black, transparent 80%);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 10;
}

.login-card__header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.login-card__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
}

.login-card__title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.login-card__subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.login-card__google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: white;
  color: #3c4043;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: var(--space-xl);
}

.login-card__google-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  transform: translateY(-1px);
}

.login-card__google-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.login-card__divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin-bottom: var(--space-xl);
}

.login-card__divider::before,
.login-card__divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-medium);
}

.login-card__divider span {
  padding: 0 var(--space-md);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.login-card__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.login-card__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.login-card__label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.login-card__input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.login-card__input-icon {
  position: absolute;
  left: 1rem;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.login-card__input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 2.8rem;
  background: var(--surface-1);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition-base);
}

.login-card__input:focus {
  outline: none;
  border-color: var(--brand-primary);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px rgba(242, 106, 33, 0.15);
}

.login-card__toggle-pass {
  position: absolute;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card__toggle-pass svg {
  width: 18px;
  height: 18px;
  transition: color 0.2s;
}

.login-card__toggle-pass:hover svg {
  color: var(--text-secondary);
}

.login-card__forgot {
  text-align: right;
  margin-top: -0.2rem;
}

.login-card__forgot a {
  color: var(--brand-primary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.login-card__forgot a:hover {
  color: var(--brand-secondary);
  text-decoration: underline;
}

.login-card__captcha {
  display: flex;
  justify-content: center;
  margin: var(--space-md) 0;
  min-height: 65px; /* Altura do widget do Cloudflare Turnstile */
}

/* Checklist de requisitos da nova senha (pages/redefinir-senha.html) */
.login-card__requisitos {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
  font-size: 0.82rem;
}

.login-card__requisitos li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted, #6b7280);
  transition: color 0.15s ease;
}

/* O marcador é ::before para o estado ficar só numa classe: sem ícone extra
   no HTML e sem JS mexendo em innerHTML a cada tecla digitada. */
.login-card__requisitos li::before {
  content: "○";
  font-size: 0.9rem;
  line-height: 1;
}

.login-card__requisitos li.ok {
  color: #16a34a;
}

.login-card__requisitos li.ok::before {
  content: "✓";
  font-weight: 700;
}

.login-card__error {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.8rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  color: #b91c1c;
  font-size: 0.85rem;
}

.login-card__error--success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.2);
  color: #15803d;
}

.login-card__error svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.login-card__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: var(--space-sm);
}

.login-card__submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(242, 106, 33, 0.3);
}

.login-card__submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.login-card__spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-card__toggle {
  text-align: center;
  margin-top: var(--space-xl);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.login-card__toggle-btn {
  background: transparent;
  border: none;
  color: var(--brand-primary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0 0 0 0.3rem;
  transition: color 0.2s;
}

.login-card__toggle-btn:hover {
  color: var(--brand-secondary);
  text-decoration: underline;
}

/* ============================================
   ADMIN DASHBOARD
   ============================================ */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: var(--surface-bg);
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: var(--surface-1);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 50;
}

.admin-sidebar__header {
  padding: var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-sidebar__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.admin-sidebar__badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.admin-sidebar__nav {
  flex: 1;
  padding: var(--space-lg) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.admin-sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0.8rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: var(--transition-base);
}

.admin-sidebar__link:hover {
  color: var(--text-primary);
  background: var(--surface-2);
}

.admin-sidebar__link.active {
  color: var(--brand-primary);
  background: rgba(242, 106, 33, 0.1);
}

.admin-sidebar__footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.admin-sidebar__user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.admin-sidebar__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-sidebar__user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-sidebar__user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-sidebar__user-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-sidebar__logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 0.8rem;
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-base);
}

.admin-sidebar__logout:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Main Content */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Important for flex children truncation */
}

.admin-topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  background: var(--surface-1);
  border-bottom: 1px solid var(--border-subtle);
}

.admin-topbar__toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: var(--space-xs);
}

.admin-topbar__title {
  font-size: 1.2rem;
  font-weight: 600;
}

.admin-topbar__site-link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--brand-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.admin-topbar__site-link:hover {
  text-decoration: underline;
}

.admin-section {
  padding: var(--space-2xl);
  flex: 1;
  overflow-y: auto;
}

.admin-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

/* Stats Cards */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.admin-stat-card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.admin-stat-card__icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-stat-card__icon--blue {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.admin-stat-card__icon--green {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.admin-stat-card__icon--purple {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.admin-stat-card__info {
  display: flex;
  flex-direction: column;
}

.admin-stat-card__value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.admin-stat-card__label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Admin Table */
.admin-table-wrapper {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th,
.admin-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-table th {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-2);
}

.admin-table tbody tr {
  transition: background 0.2s ease;
}

.admin-table tbody tr:hover {
  background: rgba(20, 49, 92, 0.03);
}

.admin-table__name {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.admin-table__name svg {
  color: var(--brand-primary);
}

.admin-table__name strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.admin-table__name small {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.admin-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.admin-badge--parcelamento { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.admin-badge--desmembramento { background: rgba(16, 185, 129, 0.15); color: #059669; }
.admin-badge--loteamento { background: rgba(139, 92, 246, 0.15); color: #7c3aed; }
.admin-badge--incorporacao { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.admin-badge--geral { background: rgba(107, 114, 128, 0.15); color: #6b7280; }

.admin-status-toggle {
  background: transparent;
  border: 1px solid var(--border-medium);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.admin-status-toggle.active {
  border-color: rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.admin-table__actions {
  display: flex;
  gap: var(--space-sm);
}

.admin-action-btn {
  background: var(--surface-2);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.admin-action-btn:hover {
  background: var(--surface-3);
  color: var(--text-primary);
}

.admin-action-btn--danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Empty State / Loading */
.admin-empty, .admin-loading {
  text-align: center;
  padding: var(--space-4xl) var(--space-xl);
  background: var(--surface-1);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-xl);
}

.admin-empty svg {
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.admin-empty h3 {
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.admin-empty p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.admin-loading {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Buttons */
.admin-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--brand-primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-btn-primary:hover:not(:disabled) {
  background: var(--brand-secondary);
  transform: translateY(-1px);
}

.admin-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-btn-secondary:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

/* Modal */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-lg);
}

.admin-modal {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-xl);
  max-height: 90vh;
  overflow-y: auto;
}

.admin-modal__header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-modal__close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-md);
}

.admin-modal__close:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.admin-modal__form {
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.admin-modal__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex: 1;
}

.admin-modal__row {
  display: flex;
  gap: var(--space-lg);
}

.admin-modal__field label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.admin-modal__field input[type="text"],
.admin-modal__field select {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.admin-modal__field input:focus,
.admin-modal__field select:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.admin-modal__upload {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  position: relative;
  transition: all 0.2s;
  cursor: pointer;
}

.admin-modal__upload:hover {
  border-color: var(--brand-primary);
  background: rgba(242, 106, 33, 0.05);
}

.admin-modal__upload.has-file {
  border-style: solid;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

.admin-modal__upload.has-file svg {
  color: #10b981;
}

.admin-modal__upload input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.admin-modal__upload svg {
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.admin-modal__upload p {
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.admin-modal__upload small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.admin-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.admin-modal__error {
  padding: 0.8rem;
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  text-align: center;
}

/* Notifications */
.admin-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  color: white;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2000;
}

.admin-notification.show {
  transform: translateY(0);
  opacity: 1;
}

.admin-notification--success {
  background: #10b981;
}

.admin-notification--error {
  background: #ef4444;
}

/* Admin Responsive */
@media (max-width: 1024px) {
  .admin-sidebar {
    position: fixed;
    height: 100vh;
    transform: translateX(-100%);
  }

  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  .admin-topbar__toggle {
    display: block;
  }
}

@media (max-width: 768px) {
  .admin-modal__row {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .admin-section {
    padding: var(--space-lg);
  }
}

/* ============================================
   HEADER USER MENU & DROPDOWN (AUTH STATE)
   ============================================ */
.header__user-container {
  position: relative;
  display: inline-block;
}

.header__user-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 1.1rem;
  background: var(--surface-1);
  border: 1px solid var(--border-medium);
  border-radius: 9999px;
  cursor: pointer;
  outline: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
  min-height: 44px;
}

.header__user-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  box-shadow: 0 2px 10px rgba(20, 49, 92, 0.1);
}

.header__user-btn * {
  pointer-events: none; /* Garante que 100% da área do botão receba o clique */
}

.header__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.header__avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #14315c, #2563eb);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header__user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header__user-arrow {
  transition: transform 0.2s ease;
  stroke: var(--text-muted);
}

.header__user-container.open .header__user-arrow {
  transform: rotate(180deg);
}

.header__user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: 14px;
  padding: 0.5rem;
  box-shadow: 0 12px 32px rgba(20, 49, 92, 0.16);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100000;
}

.header__user-container.open .header__user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header__dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.header__dropdown-item:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.header__dropdown-item--admin {
  color: #2563eb;
  font-weight: 600;
}

.header__dropdown-item--admin:hover {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.header__dropdown-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

/* ============================================
   DADOS DO IMÓVEL — formulário das tags do memorial
   ============================================ */

.dados-panel {
  max-width: 860px;
  margin: 0 auto var(--space-2xl);
  padding: var(--space-xl);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
}

.dados-panel__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.dados-panel__title svg {
  width: 20px;
  height: 20px;
  color: var(--accent-orange);
  flex-shrink: 0;
}

.dados-panel__hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.dados-panel__legend {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: var(--space-xl) 0 var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-subtle);
}

.dados-panel__legend:first-of-type {
  margin-top: 0;
}

.dados-panel__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md) var(--space-lg);
}

.dados-panel__field--full {
  grid-column: 1 / -1;
}

.dados-panel__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.dados-panel__input,
.dados-panel__select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--surface-1);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md, 8px);
  transition: var(--transition-base);
}

.dados-panel__input:focus,
.dados-panel__select:focus {
  outline: none;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(242, 106, 33, 0.15);
}

.dados-panel__input::placeholder {
  color: var(--text-muted);
}

.dados-panel__input[readonly] {
  background: var(--surface-2);
  color: var(--text-secondary);
}

.dados-panel__file {
  width: 100%;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 0.45rem 0;
}

.dados-panel__file::file-selector-button {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--surface-2);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md, 8px);
  padding: 0.4rem 0.8rem;
  margin-right: 0.75rem;
  cursor: pointer;
  transition: var(--transition-base);
}

.dados-panel__file::file-selector-button:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.dados-panel__preview {
  display: none;
  margin-top: var(--space-sm);
  padding: var(--space-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  text-align: center;
}

.dados-panel__preview.show { display: block; }

.dados-panel__preview img {
  max-height: 70px;
  max-width: 100%;
}

/* --- Tabela de segmentos / confrontantes --- */

.segmentos {
  max-width: 860px;
  margin: 0 auto var(--space-2xl);
  padding: var(--space-xl);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
}

/* ===== Navegação entre lotes do arquivo =====
   Um LandXML de loteamento traz vários lotes, e o quadro mostra um por vez.
   Antes só o select "Lote", lá embaixo na configuração, dizia qual era — o
   quadro em si não tinha rótulo nenhum, e quem abria um arquivo de 30 lotes
   via uma tabela sem saber de qual deles. */
.segmentos__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
}

.segmentos__nav-rotulo {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.3;
  text-align: center;
  min-width: 0;
}

.segmentos__nav-rotulo strong {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.segmentos__nav-rotulo span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.segmentos__seta {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-medium);
  background: var(--surface-1);
  color: var(--text-secondary);
  font-size: 1.4rem;
  line-height: 1;
  font-family: inherit;
  transition: var(--transition-fast);
}

.segmentos__seta:hover:not(:disabled) {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

/* Desabilitado em vez de escondido: o botão sumir muda a largura da barra e
   faz o rótulo do lote pular de lugar a cada navegação. */
.segmentos__seta:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* O select de configuração diz o que será GERADO; as setas dizem o que está
   sendo CONFERIDO. Em "Todos os lotes" os dois divergem de propósito, e é
   preciso deixar isso escrito — senão a pessoa confere o lote 2 e acha que só
   ele vai sair no memorial. */
.segmentos__aviso-todos {
  margin: calc(-1 * var(--space-sm)) 0 var(--space-md);
  padding: 8px 12px;
  border-left: 3px solid var(--accent-blue);
  border-radius: var(--radius-md, 8px);
  background: rgba(37, 99, 235, 0.07);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.segmentos__wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
}

.segmentos__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 620px;
}

.segmentos__table th {
  background: var(--surface-2);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-align: left;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.segmentos__table td {
  padding: 0.4rem 0.7rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

.segmentos__table tr:last-child td { border-bottom: none; }

.segmentos__table td.segmentos__conf { width: 42%; white-space: normal; }

.segmentos__input {
  width: 100%;
  padding: 0.4rem 0.55rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--surface-1);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm, 6px);
}

.segmentos__input:focus {
  outline: none;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 2px rgba(242, 106, 33, 0.15);
}

.segmentos__input--auto {
  color: var(--text-muted);
  font-style: italic;
}

.segmentos__resumo {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.segmentos__resumo strong {
  color: var(--text-primary);
  font-weight: 600;
}

@media (max-width: 720px) {
  .dados-panel__grid { grid-template-columns: 1fr; }
}

/* ===== Selo de ferramenta gratuita (card do hub) =====
   Fica no card porque "grátis" é o argumento que faz a pessoa clicar; escondê-lo
   dentro da ferramenta desperdiça o que ele tem de melhor. */
.tool-card__gratis {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.4px;
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 8px;
  text-transform: uppercase;
}
