@import url("https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Lato", sans-serif;
}

body {
  background-color: #f0f0f0;
  transition:
    background-color 0.4s,
    color 0.4s;
}

body.dark {
  background-color: #1a1a2e;
  color: #e0e0e0;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.3rem 1.8rem;
  background: linear-gradient(145deg, #101b58, #3b4996);
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

.title h1 {
  font-size: 1.4rem;
  color: #ffffff;
  font-weight: bold;
  text-shadow: 3px 3px 3px rgba(0, 0, 0, 0.5);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.cpf a {
  text-decoration: none;
  color: #ffffff;
  cursor: pointer;
}
.cpf a:hover {
  text-decoration: underline;
}

.theme-toggle {
  position: relative;
  width: 80px;
  height: 36px;
  cursor: pointer;
}

.theme-toggle input {
  display: none;
}

.toggle-track {
  width: 80px;
  height: 36px;
  border-radius: 18px;
  background: linear-gradient(180deg, #6ab4e8 0%, #a8d8f0 100%);
  position: relative;
  overflow: hidden;
  transition: background 0.5s;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
}

.theme-toggle input:checked ~ .toggle-track {
  background: linear-gradient(180deg, #0d1b4b 0%, #1a2f6e 100%);
}

.cloud1,
.cloud2 {
  position: absolute;
  background: white;
  border-radius: 50%;
  transition:
    opacity 0.4s,
    transform 0.4s;
}
.cloud1 {
  width: 22px;
  height: 10px;
  bottom: 7px;
  right: 6px;
  box-shadow:
    -8px 2px 0 white,
    4px 2px 0 white;
}
.cloud2 {
  width: 14px;
  height: 8px;
  bottom: 14px;
  right: 20px;
  box-shadow: -5px 1px 0 white;
}
.theme-toggle input:checked ~ .toggle-track .cloud1,
.theme-toggle input:checked ~ .toggle-track .cloud2 {
  opacity: 0;
}

.star1,
.star2,
.star3 {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.4s;
}
.star1 {
  width: 3px;
  height: 3px;
  top: 7px;
  right: 14px;
}
.star2 {
  width: 2px;
  height: 2px;
  top: 14px;
  right: 24px;
}
.star3 {
  width: 3px;
  height: 3px;
  top: 10px;
  right: 8px;
}

.theme-toggle input:checked ~ .toggle-track .star1,
.theme-toggle input:checked ~ .toggle-track .star2,
.theme-toggle input:checked ~ .toggle-track .star3 {
  opacity: 1;
}

.toggle-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe566, #f5c400);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.3),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.4s;
  z-index: 2;
}

.theme-toggle input:checked ~ .toggle-track .toggle-knob {
  transform: translateX(44px);
  background: radial-gradient(circle at 60% 30%, #e0e8f8, #c8d8f0);
  box-shadow:
    -4px 0 0 2px #8aadd4,
    0 2px 6px rgba(0, 0, 0, 0.3);
}

.gerador {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6rem 1.5rem 3rem;
  gap: 1.5rem;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.logo img {
  width: 22rem;
  height: auto;
}
.logo p {
  font-size: 1.1rem;
  color: #555;
  margin-top: 0.75rem;
  text-align: center;
}
body.dark .logo p {
  color: #aaa;
}

.config-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 2rem 2.5rem;
  width: 100%;
  max-width: 680px;
}
body.dark .config-card {
  background: #1e2a5e;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.config-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 1.5rem;
  text-align: center;
}
body.dark .config-card h2 {
  color: #e0e0e0;
}

.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 2rem;
}

@media (max-width: 560px) {
  .config-grid {
    grid-template-columns: 1fr;
  }
}

.config-group label.group-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #444;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
body.dark .config-group label.group-label {
  color: #bbb;
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-item input[type="checkbox"],
.checkbox-item input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #9aa3d4;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.checkbox-item input[type="radio"] {
  border-radius: 50%;
}

.checkbox-item input[type="checkbox"]:checked,
.checkbox-item input[type="radio"]:checked {
  background: #3b4996;
  border-color: #3b4996;
}

.checkbox-item input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.checkbox-item input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.checkbox-item span {
  font-size: 0.9rem;
  font-weight: 600;
  color: #444;
  transition: color 0.2s;
}

.checkbox-item input:checked ~ span {
  color: #3b4996;
}

.checkbox-item:hover input {
  border-color: #3b4996;
}

body.dark .checkbox-item input[type="checkbox"],
body.dark .checkbox-item input[type="radio"] {
  border-color: #6a7dcc;
}
body.dark .checkbox-item input:checked {
  background: #5a6dc0;
  border-color: #5a6dc0;
}
body.dark .checkbox-item span {
  color: #bbb;
}
body.dark .checkbox-item input:checked ~ span {
  color: #8a9de0;
}

.fields-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem 2rem;
  margin-top: 1.5rem;
}
@media (max-width: 560px) {
  .fields-row {
    flex-direction: column;
    align-items: stretch;
  }
}

.field-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #444;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
body.dark .field-group label {
  color: #bbb;
}

.field-group input[type="number"],
.field-group input[type="text"] {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1.5px solid #d0d0d0;
  border-radius: 10px;
  font-size: 0.95rem;
  color: #333;
  background: #fafafa;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.field-group input:focus {
  border-color: #3b4996;
  box-shadow: 0 0 0 3px rgba(59, 73, 150, 0.15);
}
body.dark .field-group input {
  background: #131e4a;
  border-color: #3a4a8a;
  color: #e0e0e0;
}
body.dark .field-group input:focus {
  border-color: #6a7dcc;
  box-shadow: 0 0 0 3px rgba(106, 125, 204, 0.2);
}

.entrada {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 680px;
}

.entrada input[type="text"] {
  padding: 1rem 3rem;
  border: 1.5px solid #ccc;
  border-radius: 12px;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  color: #222;
  background: #fff;
  outline: none;
  text-align: center;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.entrada input[type="text"]:focus {
  border-color: #3b4996;
  box-shadow: 0 0 0 4px rgba(59, 73, 150, 0.12);
}
body.dark .entrada input[type="text"] {
  background: #1e2a5e;
  border-color: #3a4a8a;
  color: #e0e0e0;
}

.entrada button {
  --btn-bg-1: hsla(194, 100%, 69%, 1);
  --btn-bg-2: hsla(217, 100%, 56%, 1);
  cursor: pointer;
  padding: 0.9em 2em;
  min-width: 160px;
  min-height: 48px;
  font-size: 1rem;
  font-weight: 700;
  transition: background-position 0.8s;
  background-size: 280% auto;
  background-image: linear-gradient(
    325deg,
    var(--btn-bg-2) 0%,
    var(--btn-bg-1) 55%,
    var(--btn-bg-2) 90%
  );
  border: none;
  border-radius: 12px;
  color: #fff;
  box-shadow:
    0 0 20px rgba(71, 184, 255, 0.5),
    0 5px 5px -1px rgba(58, 125, 233, 0.25),
    inset 4px 4px 8px rgba(175, 230, 255, 0.5),
    inset -4px -4px 8px rgba(19, 95, 216, 0.35);
}
.entrada button:hover {
  background-position: right top;
}
.entrada button:active {
  transform: scale(0.97);
}

footer {
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  animation: fadeUp 0.6s ease both;
  animation-delay: 0.2s;
  background: linear-gradient(145deg, #101b58, #3b4996);
  color: #fff;
  padding: 1rem;
  width: 100%;
}

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

footer a:hover {
  text-decoration: underline;
}

/* --- Novas Animações e Suavização --- */

/* Suaviza todas as transições de cores e sombras do card */
.config-card,
.entrada input,
.entrada button,
.checkbox-item span,
.checkbox-item input {
  transition: all 0.3s ease;
}

/* Animação de entrada dos elementos principais ao carregar a página */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.logo {
  animation: fadeInUp 0.6s ease-out forwards;
}
.config-card {
  animation: fadeInUp 0.8s ease-out forwards;
}
.entrada {
  animation: fadeInUp 1s ease-out forwards;
}

@keyframes highlightFade {
  0% {
    background-color: rgba(59, 73, 150, 0.2);
    transform: scale(1.02);
  }
  100% {
    background-color: transparent;
    transform: scale(1);
  }
}

.senha-atualizada {
  animation: highlightFade 0.4s ease-out;
}

.checkbox-item:hover {
  transform: translateX(5px);
}

.entrada button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(71, 184, 255, 0.6);
}
