:root {
  --md-sys-color-primary: #4D70B5;
  --md-sys-color-on-primary: #FFFFFF;
  --md-sys-color-primary-container: #D9E3FF;
  --md-sys-color-on-primary-container: #001350;
  --md-sys-color-secondary: #5E6B78;
  --md-sys-color-on-secondary: #FFFFFF;
  --md-sys-color-secondary-container: #E2F0FF;
  --md-sys-color-on-secondary-container: #1A232A;
  --md-sys-color-tertiary: #6D5B7E;
  --md-sys-color-on-tertiary: #FFFFFF;
  --md-sys-color-tertiary-container: #F5D7FF;
  --md-sys-color-on-tertiary-container: #261835;
  --md-sys-color-error: #BA1A1A;
  --md-sys-color-error-container: #FFDAD6;
  --md-sys-color-on-error: #FFFFFF;
  --md-sys-color-on-error-container: #410002;
  --md-sys-color-background: #FFFBFF;
  --md-sys-color-on-background: #1C1B1F;
  --md-sys-color-surface: #FFFBFF;
  --md-sys-color-on-surface: #1C1B1F;
  --md-sys-color-surface-variant: #E7E0EC;
  --md-sys-color-on-surface-variant: #49454E;
  --md-sys-color-outline: #79747E;
  --md-sys-color-inverse-on-surface: #F4EFF4;
  --md-sys-color-inverse-surface: #313033;
  --md-sys-color-shadow: rgba(0, 0, 0, 0.2);
  --md-sys-color-surface-tint: #4D70B5;
  --md-sys-color-outline-variant: #CAC4D0;
}

*, *::before, *::after {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
  line-height: 1.6;
  min-height: 100vh;
  background-image: radial-gradient(circle at 10% 20%, var(--md-sys-color-primary) 0%, transparent 50%), radial-gradient(circle at 90% 80%, var(--md-sys-color-tertiary) 0%, transparent 50%);
  background-attachment: fixed;
  background-size: cover;
  overflow-x: hidden;
}

body.modo-escuro {
  --md-sys-color-background: #121212;
  --md-sys-color-on-background: #E1E1E1;
  --md-sys-color-surface: #1E1E1E;
  --md-sys-color-surface-variant: #2D2D2D;
  --md-sys-color-on-surface: #E6E1E5;
  --md-sys-color-on-surface-variant: #CAC4D0;
  --md-sys-color-outline: #938F99;
  --md-sys-color-outline-variant: #49454F;
  background-image: none;
}

.cabecalho-app {
  position: sticky;
  top: 0;
  background-color: var(--md-sys-color-surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  height: 64px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.lado-esquerdo-cabecalho {
  display: flex;
  align-items: center;
  gap: 16px;
}

.titulo-app {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}

.conteudo-principal {
  padding-top: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: 80px;
}

.secao-heroi {
  text-align: center;
  margin-bottom: 2rem;
}

.titulo-heroi {
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(45deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

.subtitulo-heroi {
  font-size: 1.25rem;
  color: var(--md-sys-color-on-surface-variant);
}

main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
  }
}

.secao-editor {
  background-color: var(--md-sys-color-surface);
  border-radius: 28px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
  border: 1px solid var(--md-sys-color-outline-variant);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.navegacao-abas {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.botao-aba {
  flex: 1;
  background: none;
  border: none;
  color: var(--md-sys-color-on-surface-variant);
  padding: 16px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  border-bottom: 3px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.botao-aba:hover {
  background-color: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-primary);
}

.botao-aba.ativo {
  color: var(--md-sys-color-primary);
  background-color: var(--md-sys-color-secondary-container);
  border-bottom: 3px solid var(--md-sys-color-primary);
}

.botao-limpar {
  background: none;
  border: none;
  color: var(--md-sys-color-error);
  width: 50px;
  cursor: pointer;
  border-left: 1px solid var(--md-sys-color-outline-variant);
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.botao-limpar:hover {
  background-color: var(--md-sys-color-error-container);
}

.conteudo-aba {
  display: none;
  padding: 24px;
  animation: fadeIn 0.3s ease-in-out;
}

.conteudo-aba.ativo {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.grupo-formulario {
  margin-bottom: 20px;
}

.linha-formulario {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grupo-campo {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--md-sys-color-on-surface);
}

.campo-formulario, .area-texto-formulario {
  width: 100%;
  padding: 16px 20px;
  background-color: var(--md-sys-color-surface-variant);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 12px;
  color: var(--md-sys-color-on-surface);
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  font-family: 'Roboto', sans-serif;
}

.campo-formulario:focus, .area-texto-formulario:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px rgba(77, 112, 181, 0.2);
  background-color: var(--md-sys-color-surface);
}

.area-texto-formulario {
  min-height: 120px;
  resize: vertical;
}

.secao-previa {
  position: sticky;
  top: 80px;
  height: fit-content;
}

.cartao-previa {
  background-color: var(--md-sys-color-surface);
  padding: 24px;
  border-radius: 28px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.cabecalho-previa {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.botao {
  padding: 12px 24px;
  border-radius: 20px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.botao-primario {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.botao-primario:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
}

.container-saida {
  background-color: #000;
  padding: 20px;
  border-radius: 12px;
  font-family: 'Consolas', 'Monaco', monospace;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-x: auto;
  border: 1px solid #333;
  max-height: 600px;
  overflow-y: auto;
}

.notificacao {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 500;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
  z-index: 2000;
}

.notificacao.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch #input-tema {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #2196f3;
  transition: background-color 0.4s ease;
  z-index: 0;
  overflow: hidden;
  border-radius: 34px;
}

.sun-moon {
  position: absolute;
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: yellow;
  border-radius: 50%;
  transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1), background-color 0.4s ease;
  z-index: 1;
}

#input-tema:checked + .slider {
  background-color: #1a1a2e;
}

#input-tema:focus + .slider {
  box-shadow: 0 0 1px #2196f3;
}

#input-tema:checked + .slider .sun-moon {
  transform: translateX(26px);
  background-color: white;
  animation: rotate-center 0.6s ease-in-out both;
}

.moon-dot {
  opacity: 0;
  transition: opacity 0.4s ease;
  fill: gray;
}

#input-tema:checked + .slider .sun-moon .moon-dot {
  opacity: 1;
}

#moon-dot-1 {
  left: 10px;
  top: 3px;
  position: absolute;
  width: 6px;
  height: 6px;
  z-index: 4;
}

#moon-dot-2 {
  left: 2px;
  top: 10px;
  position: absolute;
  width: 10px;
  height: 10px;
  z-index: 4;
}

#moon-dot-3 {
  left: 16px;
  top: 18px;
  position: absolute;
  width: 3px;
  height: 3px;
  z-index: 4;
}

#light-ray-1 {
  left: -8px;
  top: -8px;
  position: absolute;
  width: 43px;
  height: 43px;
  z-index: -1;
  fill: white;
  opacity: 0.1;
  transition: opacity 0.4s ease;
}

#light-ray-2 {
  left: -50%;
  top: -50%;
  position: absolute;
  width: 55px;
  height: 55px;
  z-index: -1;
  fill: white;
  opacity: 0.1;
  transition: opacity 0.4s ease;
}

#light-ray-3 {
  left: -18px;
  top: -18px;
  position: absolute;
  width: 60px;
  height: 60px;
  z-index: -1;
  fill: white;
  opacity: 0.1;
  transition: opacity 0.4s ease;
}

#input-tema:checked + .slider #light-ray-1,
#input-tema:checked + .slider #light-ray-2,
#input-tema:checked + .slider #light-ray-3 {
  opacity: 0;
}

.cloud-light {
  position: absolute;
  fill: #eee;
  opacity: 0;
  transition: opacity 0.4s ease;
  animation: cloud-move 6s infinite;
}

.cloud-dark {
  position: absolute;
  fill: #ccc;
  opacity: 0;
  transition: opacity 0.4s ease;
  animation: cloud-move 6s infinite;
  animation-delay: 1s;
}

#input-tema:checked + .slider .cloud-light,
#input-tema:checked + .slider .cloud-dark {
  opacity: 1;
}

#cloud-1 {
  left: 30px;
  top: 15px;
  width: 40px;
}

#cloud-2 {
  left: 44px;
  top: 10px;
  width: 20px;
}

#cloud-3 {
  left: 18px;
  top: 24px;
  width: 30px;
}

#cloud-4 {
  left: 36px;
  top: 18px;
  width: 40px;
}

#cloud-5 {
  left: 48px;
  top: 14px;
  width: 20px;
}

#cloud-6 {
  left: 22px;
  top: 26px;
  width: 30px;
}

@keyframes cloud-move {
  0% {
    transform: translateX(0px);
  }
  40% {
    transform: translateX(4px);
  }
  80% {
    transform: translateX(-4px);
  }
  100% {
    transform: translateX(0px);
  }
}

.stars {
  transform: translateY(-32px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.4s ease;
}

.star {
  fill: white;
  position: absolute;
  transition: transform 0.4s ease;
  animation: star-twinkle 2s infinite;
}

#input-tema:checked + .slider .stars {
  transform: translateY(0);
  opacity: 1;
}

#star-1 {
  width: 20px;
  top: 2px;
  left: 3px;
  animation-delay: 0.3s;
}

#star-2 {
  width: 6px;
  top: 16px;
  left: 3px;
}

#star-3 {
  width: 12px;
  top: 20px;
  left: 10px;
  animation-delay: 0.6s;
}

#star-4 {
  width: 18px;
  top: 0px;
  left: 18px;
  animation-delay: 1.3s;
}

@keyframes star-twinkle {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.2);
  }
  80% {
    transform: scale(0.8);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes rotate-center {
  0% {
    transform: translateX(26px) rotate(0);
  }
  100% {
    transform: translateX(26px) rotate(360deg);
  }
}

.botao-info {
  background: none;
  border: none;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.botao-info:hover {
  background-color: var(--md-sys-color-surface-variant);
}

.sobreposicao-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sobreposicao-modal.ativo {
  opacity: 1;
  visibility: visible;
}

.modal {
  background-color: var(--md-sys-color-surface);
  border-radius: 28px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--md-sys-color-outline-variant);
  position: relative;
  z-index: 2;
}

.sobreposicao-modal.ativo .modal {
  transform: scale(1);
}

.modal-boas-vindas {
  text-align: center;
  padding: 32px;
}

.cabecalho-modal {
  padding: 24px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.corpo-modal {
  padding: 24px;
  overflow-y: auto;
}

.titulo-modal {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 8px;
}

.texto-modal {
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 24px;
}

.container-idiomas {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.botao-idioma {
  padding: 12px 24px;
  border-radius: 20px;
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: transform 0.2s;
}

.botao-idioma:hover {
  transform: scale(1.05);
}

.botao-fechar-modal {
  background: none;
  border: none;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-items: center;
}

.botao-fechar-modal:hover {
  color: var(--md-sys-color-error);
}

.texto-info-riq {
  font-size: 1.2rem;
  color: var(--md-sys-color-primary);
  font-weight: 500;
  text-align: center;
  margin-bottom: 8px;
}

.texto-versao {
  font-size: 0.9rem;
  color: var(--md-sys-color-on-surface-variant);
  text-align: center;
}

@media (max-width: 480px) {
  .titulo-heroi { font-size: 2rem; }
  .cabecalho-app { padding: 8px 16px; }
  .botao-aba { padding: 12px 8px; font-size: 0.8rem; }
  .linha-formulario { grid-template-columns: 1fr; }
}

