/* CSS Principal do GestiX (app interno) */
:root {
  --bg: var(--gx-background, #f9f9f9);
  --panel: var(--gx-surface-container, #eeeeee);
  --muted: var(--gx-on-surface-variant, #6c757d);
  --text: var(--gx-on-surface, #212529);
  --brand: var(--gx-primary, #000000);
  --ok: #28a745;
  --warn: #ffc107;
  --alert: #dc3545;
  --card: var(--gx-surface-container-lowest, #ffffff);
  --border: var(--gx-outline-variant, #dee2e6);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Layout Principal */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

.sidebar {
  width: 280px;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 1000;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.nav a:hover {
  background: var(--panel);
  color: var(--brand);
}

.nav a.active {
  background: var(--panel);
  color: var(--brand);
  border-left-color: var(--brand);
}

.nav a i {
  width: 20px;
  height: 20px;
}

.content {
  flex: 1;
  margin-left: 280px;
  min-height: 100vh;
  background: var(--bg);
}

.header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--brand);
  color: white;
}

.btn-primary:hover {
  background: #333;
}

.btn-secondary {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}

.card-header {
  margin-bottom: 16px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.card-subtitle {
  color: var(--muted);
  font-size: 14px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--brand);
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.table th,
.table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  background: var(--panel);
  font-weight: 600;
  color: var(--text);
}

.table tbody tr:hover {
  background: var(--panel);
}

.status {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.status.active {
  background: #d4edda;
  color: #155724;
}

.status.inactive {
  background: #f8d7da;
  color: #721c24;
}

.status.pending {
  background: #fff3cd;
  color: #856404;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--card);
  border-radius: 8px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--muted);
}

.modal-close:hover {
  color: var(--text);
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  border-top-color: var(--brand);
  animation: spin 1s ease-in-out infinite;
}

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

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.text-success { color: var(--ok); }
.text-error { color: var(--alert); }
.text-warning { color: var(--warn); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }

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

.flex-1 { flex: 1; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  .content {
    margin-left: 0;
  }

  .header {
    padding: 12px 16px;
  }

  .card {
    padding: 16px;
  }

  .table {
    font-size: 14px;
  }

  .table th,
  .table td {
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 20px;
  }

  .btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .modal-content {
    padding: 16px;
    width: 95%;
  }
}

/* Submenu na sidebar */
.nav-item-with-submenu { position: relative; }
.nav-parent { cursor: pointer; }
.nav-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.nav-submenu.open { max-height: 500px; }
.nav-submenu a { padding-left: 48px; font-size: 13px; }

/* Modal reportar erro */
.modal-reportar-erro {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3000;
  align-items: center;
  justify-content: center;
}
.modal-reportar-erro.active { display: flex; }
.modal-reportar-erro-container {
  background: var(--card);
  max-width: 520px;
  width: 90%;
  border-radius: 8px;
  overflow: hidden;
}
.modal-reportar-erro-header,
.modal-reportar-erro-footer {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.modal-reportar-erro-footer { border-bottom: none; border-top: 1px solid var(--border); justify-content: flex-end; gap: 12px; }
.modal-reportar-erro-body { padding: 20px; }
.form-group-reportar { margin-bottom: 16px; }
.form-group-reportar label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-group-reportar textarea,
.form-group-reportar input { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 6px; }
.form-group-reportar small { color: var(--muted); font-size: 12px; }
.form-message.success { color: var(--ok); }
.form-message.error { color: var(--alert); }

/* ================= Landing Page (index.php) ================= */
body.landing-page {
  background-color: #f9f9f9;
  color: #1a1c1c;
}

body.landing-page * {
  border-radius: 0 !important;
}

body.landing-page .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
}

body.landing-page .input-brutal {
  position: relative;
}

body.landing-page .input-brutal::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0%;
  height: 2px;
  background-color: #000000;
  transition: width 0.3s ease-out;
}

body.landing-page .input-brutal:focus-within::after {
  width: 100%;
}

body.landing-page details > summary {
  list-style: none;
}

body.landing-page details > summary::-webkit-details-marker {
  display: none;
}

body.landing-page .landing-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #000;
  color: #e2e2e2;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  z-index: 50;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

body.landing-page .landing-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

body.landing-page .landing-mobile-nav:not([hidden]) {
  display: block;
}

body.landing-page .landing-tab.active {
  background-color: #000000;
  color: #e2e2e2;
}

body.landing-page .landing-slide.hidden {
  display: none;
}

body.landing-page .landing-carousel-stage {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  body.landing-page .landing-carousel-stage {
    gap: 0.75rem;
  }
}

body.landing-page .landing-carousel-nav {
  flex-shrink: 0;
  width: 2rem;
  align-self: center;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e2e2;
  color: #1a1c1c;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

body.landing-page .landing-carousel-nav:hover {
  background: #dadada;
}

body.landing-page .landing-carousel-nav--next {
  background: #000000;
  color: #e2e2e2;
}

body.landing-page .landing-carousel-nav--next:hover {
  opacity: 0.9;
  background: #000000;
}

body.landing-page .landing-product-frame {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  outline: none;
  background: #ffffff;
}

body.landing-page .landing-product-frame:focus-visible {
  box-shadow: 0 0 0 2px #f9f9f9, 0 0 0 4px #000000;
}

body.landing-page .landing-product-shot {
  background: #d8d8d8;
  line-height: 0;
}

body.landing-page .landing-product-shot__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 440px;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  object-position: top center;
  background: #ffffff;
  filter: contrast(1.08) saturate(1.05);
}

@media (min-width: 768px) {
  body.landing-page .landing-product-shot__img {
    max-height: 520px;
  }
}

@media (min-width: 1024px) {
  body.landing-page .landing-product-shot__img {
    max-height: 560px;
  }
}

body.landing-page .landing-product-caption {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(198, 198, 198, 0.35);
  background: #ffffff;
}

body.landing-page .landing-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: none;
  background: #c6c6c6;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

body.landing-page .landing-dot.is-active {
  background: #000000;
  transform: scale(1.2);
}

body.landing-page .landing-dot:hover {
  background: #777777;
}

body.landing-page .landing-dot.is-active:hover {
  background: #000000;
}

/* Anchor offset under sticky header */
body.landing-page section[id],
body.landing-page #faq {
  scroll-margin-top: 5.5rem;
}

body.landing-page .landing-header {
  transition: box-shadow 0.2s ease;
}

body.landing-page .landing-header.is-scrolled {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
}

/* Horizontal tab strip on narrow screens */
body.landing-page .landing-tabs-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.25rem;
}

body.landing-page .landing-tabs-scroll::-webkit-scrollbar {
  height: 4px;
}

body.landing-page .landing-tabs-scroll::-webkit-scrollbar-thumb {
  background: #c6c6c6;
}

body.landing-page .landing-hero-panel {
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.08);
}

body.landing-page .landing-hero-float {
  box-shadow: none;
}

/* Bento modules: asymmetric mosaic */
body.landing-page .landing-bento {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

body.landing-page .landing-bento__hero {
  grid-column: 1 / -1;
}

@media (min-width: 640px) {
  body.landing-page .landing-bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  body.landing-page .landing-bento {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: minmax(140px, auto);
    gap: 16px;
  }

  body.landing-page .landing-bento__hero {
    grid-column: 1 / span 4;
    grid-row: 1 / span 2;
  }

  body.landing-page .landing-bento > article:nth-child(2) {
    grid-column: 5 / span 2;
    grid-row: 1;
  }

  body.landing-page .landing-bento > article:nth-child(3) {
    grid-column: 5 / span 2;
    grid-row: 2;
  }

  body.landing-page .landing-bento > article:nth-child(4) {
    grid-column: 1 / span 2;
    grid-row: 3;
  }

  body.landing-page .landing-bento > article:nth-child(5) {
    grid-column: 3 / span 2;
    grid-row: 3;
  }

  body.landing-page .landing-bento > article:nth-child(6) {
    grid-column: 5 / span 2;
    grid-row: 3;
  }
}

/* Flow steps: timeline, not equal cards */
body.landing-page .landing-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 2px solid #c6c6c6;
  margin-left: 0.75rem;
  padding-left: 1.25rem;
}

body.landing-page .landing-steps__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.25rem;
  padding-bottom: 1.5rem;
  position: relative;
}

body.landing-page .landing-steps__item:last-child {
  padding-bottom: 0;
}

body.landing-page .landing-steps__index {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #000;
  min-width: 2.5rem;
  margin-left: -0.15rem;
}

body.landing-page .landing-steps__body {
  background: #ffffff;
  border: 2px solid #1a1c1c;
  padding: 1.25rem 1.5rem;
  color: #1a1c1c;
}

body.landing-page .landing-steps__item--alt .landing-steps__body {
  background: #eeeeee;
  border-color: #1a1c1c;
}

body.landing-page .landing-steps__body--inverse {
  background: #000000 !important;
  border-color: #000000 !important;
  color: #ffffff !important;
}

body.landing-page .landing-steps__title {
  font-size: 1.125rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  color: inherit;
}

body.landing-page .landing-steps__text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  font-weight: 500;
  color: #1a1c1c;
}

body.landing-page .landing-steps__body--inverse .landing-steps__text {
  color: #e2e2e2;
}

@media (min-width: 768px) {
  body.landing-page .landing-steps {
    border-left: none;
    margin-left: 0;
    padding-left: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
  }

  body.landing-page .landing-steps__item {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 0;
  }

  body.landing-page .landing-steps__item--alt {
    margin-top: 2.5rem;
  }

  body.landing-page .landing-steps__index {
    font-size: 3rem;
  }

  body.landing-page .landing-steps__body {
    flex: 1;
    min-height: 140px;
  }

  body.landing-page .landing-steps__title {
    font-size: 1.25rem;
  }
}

@media (max-width: 639px) {
  body.landing-page .landing-toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.landing-page .animate-pulse {
    animation: none;
  }
}
