/* ==========================================================================
   UGI — DESIGN SYSTEM
   ========================================================================== */

:root {
  --bg-color: #ffffff;
  --bg-surface: #f8f9fa;
  --bg-vip: #09090b;

  --text-main: #111111;
  --text-muted: #4b5563;

  --border-color: #e5e7eb;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;

  --vip-text: #ffffff;
  --vip-accent: #facc15;

  --danger: #dc2626;
  --success: #16a34a;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --transition:
    all 0.25s cubic-bezier(
      0.4,
      0,
      0.2,
      1
    );

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

[data-theme="dark"] {
  --bg-color: #0d0d10;
  --bg-surface: #16161a;
  --bg-vip: #1a1a1e;

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;

  --border-color: #27272a;

  --accent: #3b82f6;
  --accent-hover: #60a5fa;
}

/* ==========================================================================
   RESET E BASE
   ========================================================================== */

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;

  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

[hidden] {
  display: none !important;
}

*:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

mark {
  padding: 0 0.25em;
  color: var(--accent);
  background-color: rgba(37, 99, 235, 0.1);
  border-radius: var(--radius-sm);
}

h1,
h2,
h3,
h4 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  margin-bottom: 1.5rem;
  font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
  margin-bottom: 1.5rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
}

h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

/* ==========================================================================
   UTILITÁRIOS DE ACESSIBILIDADE
   ========================================================================== */

.visually-hidden {
  position: absolute !important;

  width: 1px !important;
  height: 1px !important;

  padding: 0 !important;
  margin: -1px !important;

  overflow: hidden !important;

  clip: rect(0, 0, 0, 0) !important;

  white-space: nowrap !important;

  border: 0 !important;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 3000;

  padding: 1rem;

  color: var(--bg-color);
  background: var(--text-main);

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

  transition: top 0.3s;
}

.skip-link:focus {
  top: 1rem;
}

/* ==========================================================================
   ESTRUTURA GERAL
   ========================================================================== */

.container {
  width: 100%;
  max-width: 1200px;

  padding: 0 2rem;
  margin: 0 auto;
}

.section {
  padding: 100px 0;
}

.section--muted {
  background-color: var(--bg-surface);
}

.section-divider {
  height: 1px;

  background-color: var(--border-color);

  border: 0;
}

.section__heading {
  max-width: 700px;

  margin-right: auto;
  margin-bottom: 4rem;
  margin-left: auto;

  text-align: center;
}

.section__heading p {
  margin-top: 1rem;

  color: var(--text-muted);

  font-size: 1.15rem;
}

/* ==========================================================================
   BOTÕES
   ========================================================================== */

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

  padding: 0.85rem 1.75rem;

  color: inherit;

  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;

  text-decoration: none;

  cursor: pointer;

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

  transition: var(--transition);
}

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

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1.1rem 2.25rem;
  font-size: 1.1rem;
}

.btn-full {
  width: 100%;
  padding: 1rem;
}

.btn-primary {
  color: var(--bg-color);
  background-color: var(--text-main);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

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

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-surface);
}

.btn-vip {
  padding: 1rem 2.5rem;

  color: #000000;
  background-color: var(--vip-accent);

  font-size: 1.1rem;
  font-weight: 700;
}

.btn-vip:hover {
  background-color: #f59e0b;
  transform: translateY(-1px);
}

.btn-ghost {
  padding: 0.5rem 1rem;

  color: var(--text-muted);
  background-color: transparent;
}

.btn-ghost:hover {
  color: var(--text-main);
}

.btn-audit {
  color: #7c3aed;
  background-color: rgba(139, 92, 246, 0.1);
  border-color: #8b5cf6;
}

.btn-audit:hover:not(:disabled) {
  color: #ffffff;
  background-color: #8b5cf6;
}

[data-theme="dark"] .btn-audit {
  color: #a78bfa;
  background-color: rgba(167, 139, 250, 0.1);
  border-color: #a78bfa;
}

[data-theme="dark"] .btn-audit:hover:not(:disabled) {
  color: #000000;
  background-color: #a78bfa;
}

/* ==========================================================================
   FORMULÁRIOS
   ========================================================================== */

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;

  min-width: 0;
}

.form-field label {
  color: var(--text-main);

  font-size: 0.875rem;
  font-weight: 600;
}

.form-field-grow {
  flex: 1 1 260px;
}

.form-field-credits {
  flex: 0 1 130px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  margin-bottom: 15px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ==========================================================================
   LANDING PAGE
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;

  padding: 1rem 0;

  background-color: var(--bg-color);

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

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

.site-header__brand {
  display: flex;
  align-items: center;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav a {
  color: var(--text-muted);
  font-weight: 500;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text-main);
}

.site-header__right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0.5rem;

  color: var(--text-main);
  background: none;

  font-size: 1.2rem;

  cursor: pointer;

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

  transition: var(--transition);
}

.theme-toggle:hover {
  background-color: var(--bg-surface);
  border-color: var(--text-main);
}

.topbar-right .theme-toggle {
  margin-right: 0.5rem;
}

.hero {
  padding: 6rem 0;
  text-align: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;

  margin-bottom: 2rem;

  color: var(--text-muted);

  font-size: 0.85rem;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero__eyebrow-dot {
  width: 8px;
  height: 8px;

  background-color: var(--success);

  border-radius: 50%;

  animation: pulse 2s infinite;
}

.hero__subtitle {
  max-width: 680px;

  margin: 0 auto 3rem;

  color: var(--text-muted);

  font-size: 1.25rem;
}

.hero__actions {
  display: flex;
  justify-content: center;
  gap: 1rem;

  margin-bottom: 3rem;
}

.hero__proof {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;

  color: var(--text-muted);

  font-size: 0.9rem;
}

.steps {
  display: grid;

  grid-template-columns:
    repeat(
      auto-fit,
      minmax(280px, 1fr)
    );

  gap: 3rem;
}

.step__text {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.features-grid {
  display: grid;

  grid-template-columns:
    repeat(
      auto-fit,
      minmax(300px, 1fr)
    );

  gap: 2.5rem;
}

.feature-item {
  padding: 2.5rem;

  background-color: var(--bg-color);

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

  transition: var(--transition);
}

.feature-item__icon {
  margin-bottom: 1.5rem;
  font-size: 2rem;
}

.feature-item__text {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ==========================================================================
   PREÇOS
   ========================================================================== */

.pricing-grid {
  display: grid;

  grid-template-columns:
    repeat(
      auto-fit,
      minmax(300px, 1fr)
    );

  gap: 2rem;

  margin-bottom: 3rem;
}

.pricing-card {
  position: relative;

  display: flex;
  flex-direction: column;

  padding: 3rem 2rem;

  background-color: var(--bg-color);

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

  transition: var(--transition);
}

.pricing-card:hover {
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.05);

  transform: translateY(-4px);
}

.pricing-card--featured {
  border: 2px solid var(--accent);
}

.pricing-card__badge {
  position: absolute;
  top: -14px;
  left: 50%;

  padding: 0.35rem 1rem;

  color: #ffffff;
  background-color: var(--accent);

  font-size: 0.75rem;
  font-weight: 700;

  text-transform: uppercase;
  white-space: nowrap;

  border-radius: 30px;

  transform: translateX(-50%);
}

.pricing-card__volume {
  margin-bottom: 1rem;

  color: var(--accent);

  font-size: 1.1rem;
  font-weight: 700;
}

.pricing-card__desc {
  min-height: 48px;

  margin-bottom: 2rem;

  color: var(--text-muted);

  font-size: 1rem;
}

.pricing-card__price {
  margin-top: auto;

  color: var(--text-main);

  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
}

.pricing-card__price span {
  font-size: 1.5rem;
}

.pricing-card__peritem {
  margin-top: 0.5rem;
  margin-bottom: 2rem;

  color: var(--text-muted);

  font-size: 0.9rem;
}

.pricing-card__features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;

  margin-bottom: 2rem;
}

.pricing-card__features-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;

  color: var(--text-muted);

  font-size: 0.95rem;
}

.plans-note {
  color: var(--text-muted);

  font-size: 0.9rem;

  text-align: center;
}

/* ==========================================================================
   VIP
   ========================================================================== */

.vip-banner {
  padding: 5rem 3rem;
  margin: 2rem 0;

  color: var(--vip-text);
  background-color: var(--bg-vip);

  text-align: center;

  border-radius: var(--radius-lg);
}

.vip-banner__content {
  max-width: 800px;
  margin: 0 auto;
}

.vip-banner__title {
  margin-bottom: 1.5rem;

  color: var(--vip-text);

  font-size: clamp(
    1.75rem,
    3vw,
    2.5rem
  );
}

.vip-banner__text {
  margin-bottom: 2.5rem;

  color: rgba(255, 255, 255, 0.8);

  font-size: 1.15rem;
}

/* ==========================================================================
   FAQ E RODAPÉ
   ========================================================================== */

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  padding: 2rem 0;

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

.faq-item:first-child {
  border-top:
    1px solid var(--border-color);
}

.faq-item dt {
  margin-bottom: 1rem;

  color: var(--text-main);

  font-size: 1.25rem;
  font-weight: 700;
}

.faq-item dd {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.site-footer {
  padding: 4rem 0;
  margin-top: auto;

  background-color: var(--bg-surface);

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

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.site-footer__copy {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.site-footer__links {
  display: flex;
  gap: 1.5rem;
}

.site-footer__links a {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.site-footer__links a:hover {
  color: var(--text-main);
}

/* ==========================================================================
   SOBRE E PÁGINAS LEGAIS
   ========================================================================== */

.about-hero {
  padding: 80px 0 60px;
  text-align: center;
}

.about-hero__content {
  max-width: 800px;
  margin: 0 auto;
}

.about-hero__title {
  margin-bottom: 2rem;

  font-size: clamp(
    2.5rem,
    5vw,
    3.5rem
  );
}

.about-hero__text {
  margin-bottom: 1.5rem;

  color: var(--text-muted);

  font-size: 1.25rem;
  line-height: 1.8;
}

.team-member {
  padding: 3.5rem 3rem;
}

.team-member__name {
  margin-bottom: 1.5rem;
  font-size: 1.85rem;
}

.team-member__bio {
  margin-bottom: 3rem;

  color: var(--text-muted);

  font-size: 1.05rem;
  line-height: 1.8;
}

.experience-title {
  margin-bottom: 1.5rem;

  color: var(--text-main);

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

  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.experience-item {
  padding-left: 1.25rem;

  border-left:
    2px solid var(--border-color);
}

.experience-item--highlight {
  border-left-color: var(--accent);
}

.experience-item__org {
  display: block;

  margin-bottom: 0.25rem;

  color: var(--text-main);

  font-size: 1.1rem;
  font-weight: 700;
}

.experience-item__role {
  display: block;

  color: var(--text-muted);

  font-size: 0.95rem;
}

.legal-container {
  max-width: 800px;

  padding: 0 2rem;
  margin: 4rem auto;
}

.legal-container h1 {
  padding-bottom: 1rem;
  margin-bottom: 2rem;

  font-size: 2.5rem;

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

.legal-container h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;

  font-size: 1.5rem;
}

.legal-container p {
  margin-bottom: 1rem;

  color: var(--text-muted);

  font-size: 1.05rem;
}

/* ==========================================================================
   TELAS E AUTENTICAÇÃO
   ========================================================================== */

.screen {
  display: none;
}

.screen.active {
  display: flex;
}

.screen-app.active {
  display: block;
}

.screen-auth {
  align-items: center;
  justify-content: center;

  width: 100%;
  min-height: 100vh;

  padding: 2rem;

  background-color: var(--bg-surface);
}

.screen-auth .auth-box {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

.auth-box {
  width: 100%;
  max-width: 440px;

  padding: 3rem 2.5rem;

  background: var(--bg-color);

  text-align: center;

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

  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.05);
}

.auth-logo-img {
  display: block;

  width: 72px;
  height: 72px;

  margin: 0 auto 1rem;
}

.auth-title {
  margin-bottom: 0.4rem;

  color: var(--text-main);

  font-size: 1.2rem;
}

.auth-subtitle {
  margin-bottom: 1.5rem;

  color: var(--text-muted);

  font-size: 0.85rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-tabs {
  display: flex;

  padding: 0.35rem;
  margin-bottom: 2rem;

  background: var(--bg-surface);

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

.auth-tab {
  flex: 1;

  padding: 0.75rem;

  color: var(--text-muted);
  background: transparent;

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

  cursor: pointer;

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

  transition: var(--transition);
}

.auth-tab.active {
  color: #ffffff;
  background: var(--accent);

  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.05);
}

.google-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;

  width: 100%;
  min-height: 48px;

  padding: 0.875rem 1rem;

  color: var(--text-main);
  background: var(--bg-color);

  font: inherit;
  font-weight: 700;

  cursor: pointer;

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

  transition: var(--transition);
}

.google-auth-btn:hover:not(:disabled) {
  border-color: var(--text-muted);

  box-shadow:
    0 8px 24px rgba(15, 23, 42, 0.1);

  transform: translateY(-1px);
}

.google-auth-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.google-auth-icon {
  flex: 0 0 20px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;

  margin: 1.5rem 0;

  color: var(--text-muted);

  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  flex: 1;

  height: 1px;

  content: "";

  background: var(--border-color);
}

.auth-field {
  width: 100%;

  padding: 1rem;
  margin-bottom: 0;

  color: var(--text-main);
  background: var(--bg-surface);

  font-family: var(--font-sans);
  font-size: 1rem;

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

  outline: 0;

  transition: var(--transition);
}

.auth-field:focus {
  background: var(--bg-color);
  border-color: var(--accent);
}

.auth-feedback {
  min-height: 1.25rem;

  margin: 0;

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

  text-align: center;
}

.feedback-error {
  color: var(--danger);
}

.feedback-success {
  color: var(--success);
}

.auth-highlight {
  animation:
    auth-highlight 1.2s ease 1;
}

/* ==========================================================================
   CONSULTOR
   ========================================================================== */

.page-consultor {
  height: 100vh;
  overflow: hidden;
}

.app-layout {
  display: flex;

  width: 100vw;
  height: 100vh;

  overflow: hidden;

  background-color: var(--bg-color);
}

.sidebar {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;

  width: 280px;
  height: 100%;

  background-color: var(--bg-surface);

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

  transition: var(--transition);
}

.sidebar-header {
  padding: 1.5rem;

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

.new-project-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;

  width: 100%;

  padding: 0.8rem;

  color: var(--bg-color);
  background-color: var(--text-main);

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

  cursor: pointer;

  border: 0;
  border-radius: var(--radius-md);

  transition: var(--transition);
}

.new-project-btn:hover {
  opacity: 0.9;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;

  padding: 1rem;

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;

  width: 100%;

  padding: 0.75rem 1rem;

  color: var(--text-muted);
  background: transparent;

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

  text-align: left;

  cursor: pointer;

  border: 0;
  border-radius: var(--radius-md);

  transition: var(--transition);
}

.nav-item:hover,
.nav-item.active {
  color: var(--text-main);
  background-color: var(--border-color);
}

.project-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.4rem;

  padding: 1rem;

  overflow-y: auto;
}

.project-item-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0.25rem;

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

  transition: var(--transition);
}

.project-item-wrap:hover,
.project-item-wrap.active {
  background-color: var(--border-color);
}

.project-item {
  flex: 1;

  padding: 0.6rem;

  overflow: hidden;

  color: var(--text-main);
  background: none;

  font-size: 0.95rem;
  font-weight: 500;

  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;

  cursor: pointer;

  border: 0;
}

.project-actions {
  display: flex;
  gap: 0.25rem;

  padding-right: 0.5rem;

  opacity: 0;

  transition: var(--transition);
}

.project-item-wrap:hover .project-actions,
.project-item-wrap.active .project-actions {
  opacity: 1;
}

.project-actions button {
  display: flex;
  align-items: center;

  padding: 0.25rem;

  color: var(--text-muted);
  background: none;

  cursor: pointer;

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

.project-actions button:hover {
  color: var(--danger);
  background-color: rgba(220, 38, 38, 0.1);
}

.sidebar-footer {
  padding: 1.5rem;

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

.main-content {
  position: relative;

  display: flex;
  flex: 1;
  flex-direction: column;

  height: 100%;

  overflow: hidden;
}

.topbar {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;

  min-height: 75px;

  padding: 1rem 2rem;

  background-color: var(--bg-color);

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

.topbar-sub {
  overflow: hidden;

  color: var(--text-muted);

  font-size: 0.85rem;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;

  padding: 0.5rem 1rem;

  background-color: var(--bg-surface);

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

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

.chat-wrap {
  display: flex;
  flex: 1;
  flex-direction: column;

  width: 100%;
  max-width: 900px;

  padding: 2rem;
  margin: 0 auto;

  overflow: hidden;
}

#chatLog {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1.5rem;

  padding-right: 0.5rem;

  overflow-y: auto;

  scroll-behavior: smooth;
}

.msg {
  display: flex;
  gap: 1rem;

  max-width: 85%;

  animation: fadeIn 0.3s ease;
}

.msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg.bot {
  align-self: flex-start;
}

.msg-avatar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;

  width: 36px;
  height: 36px;

  color: var(--text-main);
  background-color: var(--bg-surface);

  font-size: 0.75rem;
  font-weight: 700;

  border: 1px solid var(--border-color);
  border-radius: 50%;
}

.msg.user .msg-avatar {
  color: #ffffff;
  background-color: var(--accent);
  border-color: var(--accent);
}

.msg-bubble {
  min-width: 0;

  padding: 1rem 1.25rem;

  overflow-wrap: break-word;

  font-size: 1rem;
  line-height: 1.6;

  white-space: pre-wrap;
  word-break: break-word;

  border-radius: var(--radius-lg);
}

.msg-bubble-wide {
  width: 100%;
}

.msg.user .msg-bubble {
  color: var(--text-main);
  background-color: var(--bg-surface);

  border: 1px solid var(--border-color);
  border-top-right-radius: 0;
}

.msg.bot .msg-bubble {
  color: var(--bg-color);
  background-color: var(--text-main);

  border-top-left-radius: 0;
}

.msg-content,
.diagnostic-content {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.msg-actions,
.diagnostic-actions {
  padding-top: 0.75rem;
  margin-top: 0.75rem;

  text-align: right;

  border-top: 1px dashed currentColor;
}

.msg.bot .msg-actions {
  border-top-color:
    rgba(255, 255, 255, 0.25);
}

.input-area {
  flex-shrink: 0;
  padding-top: 1.5rem;
}

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;

  padding: 0.75rem 1.25rem;

  background-color: var(--bg-surface);

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

  transition: var(--transition);
}

.input-row:focus-within {
  background-color: var(--bg-color);
  border-color: var(--accent);
}

#userInput {
  flex: 1;

  min-height: 1.5rem;
  max-height: 150px;

  padding: 0.25rem 0;

  color: var(--text-main);
  background: transparent;

  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;

  resize: none;

  border: 0;
  outline: 0;

  field-sizing: content;
}

#userInput:disabled {
  opacity: 0.5;
}

.input-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;

  padding-bottom: 0.15rem;
}

.input-buttons button {
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0.5rem;

  color: var(--text-muted);
  background: none;

  cursor: pointer;

  border: 0;
  border-radius: var(--radius-md);

  transition: var(--transition);
}

.input-buttons button:hover:not(:disabled) {
  color: var(--text-main);
  background-color: var(--border-color);
}

.input-buttons button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.input-buttons svg {
  width: 22px;
  height: 22px;
}

#sendBtn:not(:disabled) {
  color: #ffffff;
  background-color: var(--accent);
}

#sendBtn:not(:disabled) svg {
  fill: #ffffff;
}

/* ==========================================================================
   RADAR
   ========================================================================== */

.radar-wrap {
  display: none;
  flex: 1;
  flex-direction: column;
  gap: 2rem;

  width: 100%;
  max-width: 1000px;

  padding: 2rem;
  margin: 0 auto;

  overflow-y: auto;
}

.radar-wrap.active {
  display: flex;
}

.view-panel[hidden] {
  display: none !important;
}

.radar-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.radar-title h2 {
  margin-bottom: 0.5rem;
  font-size: 2rem;
}

.radar-title p {
  color: var(--text-muted);
}

.edicts-grid {
  display: grid;

  grid-template-columns:
    repeat(
      auto-fill,
      minmax(300px, 1fr)
    );

  gap: 1.5rem;
}

.edict-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;

  padding: 1.5rem;

  background: var(--bg-color);

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

  transition: var(--transition);
}

.edict-card:hover {
  border-color: var(--text-muted);

  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.05);
}

.edict-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.edict-badge {
  padding: 0.25rem 0.75rem;

  font-size: 0.75rem;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: 0.05em;

  border-radius: 20px;
}

.badge-open {
  color: var(--success);
  background: rgba(22, 163, 74, 0.1);
}

.badge-warning {
  color: #b45309;
  background: rgba(245, 158, 11, 0.1);
}

.edict-region {
  display: flex;
  align-items: center;
  gap: 0.25rem;

  color: var(--text-muted);

  font-size: 0.8rem;
}

.edict-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.edict-desc {
  display: -webkit-box;

  overflow: hidden;

  color: var(--text-muted);

  font-size: 0.95rem;

  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.edict-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;

  padding-top: 1rem;
  margin-top: auto;

  font-size: 0.85rem;

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

/* ==========================================================================
   DIAGNÓSTICO E ESTADOS
   ========================================================================== */

.diagnostic-card {
  border: 1px solid var(--danger);
}

.diagnostic-title {
  margin: 0 0 1rem;
  color: var(--danger);
}

.diagnostic-content {
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.diagnostic-actions {
  border-top-color: var(--border-color);
}

.error-message {
  color: var(--danger);
  font-weight: 600;
}

.text-placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.typing-dots span {
  width: 0.4rem;
  height: 0.4rem;

  background: currentColor;

  border-radius: 50%;

  animation:
    typing-dot 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

/* ==========================================================================
   PAINEL ADMINISTRATIVO
   ========================================================================== */

.page-admin {
  min-height: 100vh;
  background: var(--bg-surface);
}

.admin-app {
  min-height: 100vh;
}

.metrics-grid {
  display: grid;

  grid-template-columns:
    repeat(
      auto-fit,
      minmax(220px, 1fr)
    );

  gap: 20px;

  margin-bottom: 40px;
}

.metric-card {
  padding: 20px;

  background: var(--bg-color);

  border-left: 5px solid var(--accent);
  border-radius: var(--radius-md);

  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.05);
}

.metric-card h2 {
  margin: 0;

  color: var(--text-muted);

  font-size: 0.875rem;

  text-transform: uppercase;
  letter-spacing: 0;
}

.metric-card p {
  margin: 10px 0 0;

  color: var(--text-main);

  font-size: 28px;
  font-weight: 700;
}

.section-box {
  padding: 25px;
  margin-bottom: 30px;

  background: var(--bg-color);

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

  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.05);

  scroll-margin-top: 40px;
}

.section-box h2 {
  padding-bottom: 10px;
  margin-top: 0;

  color: var(--text-main);

  border-bottom:
    2px solid var(--border-color);
}

.admin-controls {
  padding: 20px;
  margin-bottom: 25px;

  background: var(--bg-surface);

  border-radius: var(--radius-md);
}

.admin-controls input {
  flex: 1;

  min-width: 180px;

  padding: 10px;

  color: var(--text-main);
  background: var(--bg-color);

  font-family: var(--font-sans);

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

.admin-controls input:focus {
  border-color: var(--accent);
  outline: 0;
}

.admin-controls input[readonly] {
  color: var(--text-muted);
  cursor: not-allowed;
}

.search-box {
  width: 100%;

  padding: 10px;
  margin-bottom: 0;

  color: var(--text-main);
  background: var(--bg-color);

  font-family: var(--font-sans);

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

.search-box:focus {
  border-color: var(--accent);
  outline: 0;
}

.table-responsive {
  overflow-x: auto;
}

.user-table {
  width: 100%;

  margin-top: 15px;

  text-align: left;

  border-collapse: collapse;
}

.user-table th,
.user-table td {
  padding: 12px 15px;

  font-size: 14px;

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

.user-table th {
  color: var(--text-muted);
  background-color: var(--bg-surface);

  font-size: 12px;

  text-transform: uppercase;
}

.user-table tr:hover {
  background-color: var(--bg-surface);
}

.user-id-cell {
  color: var(--text-muted);

  font-family: monospace;
  font-size: 12px;
}

.credits-badge {
  color: var(--accent);
  font-weight: 700;
}

.action-btn {
  padding: 6px 12px;
  margin-right: 5px;

  color: #ffffff;

  font-size: 12px;
  font-weight: 700;

  cursor: pointer;

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

  transition: var(--transition);
}

.btn-table-edit {
  background-color: var(--text-muted);
}

.btn-table-edit:hover {
  background-color: var(--text-main);
}

.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;

  justify-content: flex-start;
}

.admin-sidebar h2 {
  color: var(--text-main);
}

.admin-menu {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.25rem;

  padding: 1rem;
}

.admin-menu a {
  display: block;

  padding: 0.75rem 1rem;

  color: var(--text-muted);

  font-weight: 600;

  border-radius: var(--radius-md);
}

.admin-menu a:hover {
  color: var(--text-main);
  background-color: var(--border-color);
}

.admin-main {
  height: 100vh;

  padding: 2rem;
  margin-left: 280px;

  overflow-y: auto;
}

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

  margin-bottom: 30px;
}

.admin-header h1 {
  margin-bottom: 0.25rem;

  font-size: clamp(
    2rem,
    4vw,
    3rem
  );
}

.admin-status {
  color: var(--accent);
  font-weight: 700;
}

.admin-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;

  margin-bottom: 1.5rem;
}

.admin-section-header h2 {
  margin-bottom: 0.5rem;
}

.admin-section-header p {
  color: var(--text-muted);
}

/* ==========================================================================
   ANIMAÇÕES
   ========================================================================== */

@keyframes pulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(22, 163, 74, 0.4);

    transform: scale(0.95);
  }

  70% {
    box-shadow:
      0 0 0 8px rgba(22, 163, 74, 0);

    transform: scale(1);
  }

  100% {
    box-shadow:
      0 0 0 0 rgba(22, 163, 74, 0);

    transform: scale(0.95);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes auth-highlight {
  0%,
  100% {
    box-shadow:
      0 10px 40px rgba(0, 0, 0, 0.05);
  }

  45% {
    box-shadow:
      0 0 0 5px rgba(37, 99, 235, 0.18),
      0 20px 60px rgba(15, 23, 42, 0.18);
  }
}

@keyframes typing-dot {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* ==========================================================================
   RESPONSIVIDADE
   ========================================================================== */

.menu-toggle {
  display: none;

  padding: 0.4rem 0.6rem;

  color: var(--text-main);
  background: none;

  font-size: 1.25rem;

  cursor: pointer;

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

@media (max-width: 768px) {
  .container {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .section {
    padding: 64px 0;
  }

  .site-nav {
    display: none;
  }

  .hero {
    padding: 4rem 0;
  }

  .hero__actions {
    flex-direction: column;
  }

  .site-footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .screen-auth {
    align-items: flex-start;
    padding: 1rem;
  }

  .screen-auth .auth-box {
    padding: 1.5rem 1.125rem;
  }

  .menu-toggle {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -280px;
    z-index: 200;

    height: 100vh;
  }

  .sidebar.open {
    left: 0;

    box-shadow:
      5px 0 25px rgba(0, 0, 0, 0.2);
  }

  .topbar {
    position: relative;

    flex-direction: column;

    min-height: auto;

    padding: 4.5rem 1rem 1rem;
  }

  .topbar-sub {
    width: 100%;

    color: var(--text-main);

    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;

    white-space: normal;
    word-break: break-word;
  }

  .credit-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;

    padding: 0.4rem 0.5rem;

    font-size: 0.75rem;
  }

  .menu-toggle {
    position: absolute;
    top: 1rem;
    left: 1rem;
  }

  .chat-wrap,
  .radar-wrap {
    padding: 1rem;
  }

  .msg {
    max-width: 95%;
  }

  .input-row {
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
  }

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

  .page-admin .admin-sidebar {
    position: static;

    width: 100%;
    height: auto;
  }

  .page-admin .admin-menu {
    flex: initial;
  }

  .page-admin .admin-main {
    height: auto;
    min-height: 100vh;

    padding: 1rem;
    margin-left: 0;
  }

  .admin-section-header {
    flex-direction: column;
  }

  .admin-section-header .btn {
    width: 100%;
  }

  .form-actions .btn {
    width: 100%;
  }

  .user-table th,
  .user-table td {
    padding: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;

    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;

    transition-duration: 0.01ms !important;
  }
}