* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #121214;
  --bg-secondary: #151515;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --border-color: rgba(147, 114, 252, 0.2);
}

body.light-mode {
  --bg-primary: #f5f5f5;
  --bg-secondary: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --border-color: rgba(147, 114, 252, 0.1);
}

body {
  background-image: url("./imagems/bg.jpg");
  background-repeat: no-repeat;
  background-size: 100% auto;
  background-position: top center;
  background-color: var(--bg-primary);
  font-family: Arial, sans-serif;
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

body *,
:root {
  font-family: "Inter";
  line-height: 160%;
}

header {
  padding-top: 2rem;
  text-align: center;
  position: relative;
}

header img {
  width: 15rem;
}

.theme-toggle {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: none;
  border: 2px solid rgba(147, 114, 252, 0.5);
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  border-color: rgba(147, 114, 252, 1);
  background-color: rgba(147, 114, 252, 0.1);
  transform: scale(1.1) rotate(20deg);
}

.theme-toggle:active {
  transform: scale(0.95) rotate(20deg);
}

body.light-mode .theme-toggle {
  border-color: rgba(147, 114, 252, 0.5);
}

main {
  max-width: 44rem;
  width: min(95%, 44rem);
  margin: 3.5rem auto;
}
section {
  background-image: linear-gradient(
    90deg,
    #9572fc 0%,
    #13e7ad 50%,
    #4337e6 100%
  );
  border-radius: 0.665rem;
  padding-top: 4px;
}

section > div {
  padding: 2.5rem;
  padding-top: 2rem;
  border-radius: 0.5rem;
  background-color: var(--bg-secondary);
  box-shadow: 0 8px 2rem rgba(0, 0, 0, 0.5);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

body.light-mode section > div {
  box-shadow: 0 4px 1rem rgba(147, 114, 252, 0.1);
}

section h2 {
  letter-spacing: -0.47px;
}

section p {
  opacity: 1;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* Animações*/

main section {
  opacity: 0;
  transform: translateY(2rem);

  animation-name: appear;
  animation-duration: 700ms;
  animation-fill-mode: forwards;
}

@keyframes appear {
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.8rem 0;
}

@media (min-width: 768px) {
  form {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: slideUp 0.6s ease-out forwards;
  opacity: 0;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

input,
select,
button {
  min-height: 3rem;
  font-size: 1rem;
}

input select {
  background-color: rgba(125, 101, 101, 0.08);
  border: 1px solid #54418a;
  box-shadow: inset 0 0 0.4rem rgba(0, 0, 0, 0.35);
}

input,
select {
  flex: 1;
  min-height: 2.8rem;
  font-size: 1rem;
  padding: 0.8rem !important;
  background-image: linear-gradient(
    245deg,
    #ff006e,
    0%,
    #8338ec 50%,
    #3a86ff 100%
  );
  border-radius: 1.5rem;
  border: 0;
  color: white;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

body.light-mode input::placeholder,
body.light-mode select {
  color: #333333;
}

body.light-mode input::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

input:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 1rem rgba(141, 114, 252, 0.6);
}

@media (max-width: 480px) {
  main {
    max-width: 100%;
    margin: 2rem auto;
  }

  section > div {
    padding: 1.5rem;
  }

  section h2 {
    font-size: 1.5rem;
  }

  input, select, button {
    min-height: 2.5rem;
    font-size: 0.95rem;
  }

  .form-group label {
    font-size: 0.8rem;
  }
}

select option {
  background-color: #1a1625;
  color: white;
}

select option:checked {
  background-color: #8338ec;
  color: white;
}

body.light-mode select option {
  background-color: #ffffff;
  color: #333333;
}

body.light-mode select option:checked {
  background-color: #9572fc;
  color: white;
}

button {
  width: 100%;
  border: 0;
  background-image: linear-gradient(
    245deg,
    #9572fc,
    0%,
    #13e7ad 50%,
    #e2d45c 100%
  );
  padding: 0.9rem;
  min-height: 2.8rem;
  font-size: 1rem;
  border-radius: 1.5rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.12px;
  color: white;
  grid-column: 1 / -1;

  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.3s ease;
  z-index: -1;
}

button:hover::before {
  left: 100%;
}

button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 2rem rgba(147, 114, 252, 0.4), 
              0 0 2rem rgba(19, 231, 173, 0.2);
  background-size: 200% auto;
  background-position: right center;
}

button:active {
  transform: translateY(-1px) scale(0.98);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

button.loading {
  position: relative;
  color: transparent;
}

button.loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  top: 50%;
  left: 50%;
  margin-left: -0.5rem;
  margin-top: -0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#aiResponse {
  background-image: linear-gradient(
    135deg,
    rgba(19, 231, 173, 0.1) 0%,
    rgba(147, 114, 252, 0.1) 100%
  );
  border-radius: 1rem;
  padding: 2rem;
  border-left: 4px solid #43e7ad;
  margin-top: 2rem;
  animation: slideUp 0.6s ease-out;
  box-shadow: 0 8px 2rem rgba(0, 0, 0, 0.3);
}

#aiResponse.hidden {
  display: none;
}

#aiResponse ul {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

#aiResponse li {
  margin: 0.5rem 0;
  color: #e1e1e6;
}

#aiResponse p {
  color: #e1e1e6;
  margin-bottom: 1rem;
  line-height: 1.7;
}

#aiResponse h1, #aiResponse h2, #aiResponse h3 {
  color: #13e7ad;
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
}

body.light-mode #aiResponse {
  background-image: linear-gradient(
    135deg,
    rgba(147, 114, 252, 0.05) 0%,
    rgba(19, 231, 173, 0.05) 100%
  );
  border-left-color: #7c3aed;
  background-color: #f9f5ff;
  box-shadow: 0 4px 1rem rgba(147, 114, 252, 0.15);
}

body.light-mode #aiResponse p,
body.light-mode #aiResponse li {
  color: #333333;
}

body.light-mode #aiResponse h1,
body.light-mode #aiResponse h2,
body.light-mode #aiResponse h3 {
  color: #7c3aed;
}

.loading {
  animation: pulse 1s infinite;
}

.hidden {
  display: none;
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 3rem;
  border-top: 1px solid var(--border-color);
  animation: fadeIn 1s ease-out 0.8s forwards;
  opacity: 0;
  transition: color 0.3s ease, border-color 0.3s ease;
}

footer p {
  margin: 0;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  50% {
    opacity: 0.5;
  }
}
