* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
  color: #c9d1d9;
  line-height: 1.6;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
header {
  background: rgba(22, 27, 34, 0.9);
  backdrop-filter: blur(10px);
  padding: 1rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #30363d;
}
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size: 1.8rem;
  font-weight: bold;
  color: #58a6ff;
}
.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}
.nav-links a {
  color: #c9d1d9;
  text-decoration: none;
  transition: color 0.3s;
}
.nav-links a:hover {
  color: #58a6ff;
}
main {
  flex: 1 0 auto;
  padding: 7rem 2rem 2rem 2rem;
  max-width: 800px;
  margin: auto;
}
.button {
  background-color: #238636;
  border: none;
  color: white;
  padding: 0.75rem 1.5rem;
  margin: 1rem 0.5rem;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.3s;
}
.button:hover {
  background-color: #2ea043;
}
.question {
  margin-top: 2rem;
}
.hidden {
  display: none;
}
.feedback {
  font-weight: bold;
  margin-top: 1rem;
}
footer {
  flex-shrink: 0;
  background: #0d1117;
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid #30363d;
  margin-top: 4rem;
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.social-links {
  display: flex;
  gap: 1rem;
}
.social-links a {
  color: #6e7681;
  font-size: 1.5rem;
  transition: color 0.3s;
}
.social-links a:hover {
  color: #58a6ff;
}
.custom-radio {
  display: flex;
  align-items: center;
  background: rgba(22, 27, 34, 0.7);
  border: 2px solid #30363d;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  cursor: pointer;
  font-size: 1.1rem;
  transition: border 0.2s, background 0.2s;
  position: relative;
  user-select: none;
}

.custom-radio.selected,
.custom-radio:hover {
  border-color: #58a6ff;
  background: rgba(88, 166, 255, 0.08);
}

.custom-radio input[type="radio"] {
  display: none;
}

.checkmark {
  height: 22px;
  width: 22px;
  border-radius: 50%;
  border: 2px solid #58a6ff;
  margin-right: 1rem;
  display: inline-block;
  position: relative;
  background: #161b22;
  transition: border 0.2s;
}

.custom-radio.selected .checkmark {
  border: 2px solid #238636;
  background: #238636;
}

.custom-radio input[type="radio"]:checked + .checkmark:after {
  content: "";
  display: block;
  position: absolute;
  top: 4px;
  left: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
}

/* Estilos do Quiz */
.difficulty-section {
  padding: 2rem;
  text-align: center;
  background: rgba(22, 27, 34, 0.8);
  border-radius: 15px;
  margin: 2rem 0;
  border: 1px solid #30363d;
}

#quiz-container {
  background: rgba(22, 27, 34, 0.8);
  border-radius: 15px;
  padding: 2rem;
  margin: 2rem 0;
  border: 1px solid #30363d;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #30363d;
  border-radius: 4px;
  margin-bottom: 1rem;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #58a6ff, #39d353);
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  color: #8b949e;
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.question-container {
  text-align: center;
}

#question-title {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: #f0f6fc;
  line-height: 1.5;
}

#options-container {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.option-btn {
  padding: 1rem;
  background: rgba(48, 54, 61, 0.5);
  border: 2px solid #30363d;
  color: #c9d1d9;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  text-align: left;
}

.option-btn:hover {
  background: rgba(88, 166, 255, 0.1);
  border-color: #58a6ff;
  transform: translateY(-2px);
}

.option-btn.selected {
  background: rgba(88, 166, 255, 0.2);
  border-color: #58a6ff;
  color: #58a6ff;
}

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

#next-btn:disabled:hover {
  transform: none;
  background: rgba(88, 166, 255, 0.1);
}

/* Estilos do Modal */
.login-btn {
  background: #238636;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.3s;
}

.login-btn:hover {
  background: #2ea043;
}

.modal {
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.modal.hidden {
  display: none !important;
}

.modal-content {
  background: linear-gradient(135deg, rgba(22, 27, 34, 0.98), rgba(33, 38, 45, 0.98));
  border: 1px solid #30363d;
  border-radius: 15px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.close {
  color: #8b949e;
  float: right;
  font-size: 28px;
  font-weight: bold;
  position: absolute;
  top: 15px;
  right: 20px;
  cursor: pointer;
  transition: color 0.3s;
}

.close:hover,
.close:focus {
  color: #f85149;
}

.modal-content h2 {
  color: #58a6ff;
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 1.5rem;
}

/* Auth Tabs */
.auth-tab {
  margin-bottom: 1rem;
}

.auth-tab.hidden {
  display: none;
}

.auth-tab h3 {
  color: #7c3aed;
  margin-bottom: 1rem;
  text-align: center;
  font-size: 1.2rem;
}

.auth-tab input {
  width: 100%;
  padding: 0.75rem;
  margin: 0.5rem 0;
  border: 1px solid #30363d;
  border-radius: 8px;
  background: rgba(22, 27, 34, 0.8);
  color: #c9d1d9;
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  box-sizing: border-box;
}

.auth-tab input:focus {
  outline: none;
  border-color: #58a6ff;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.auth-tab input::placeholder {
  color: #8b949e;
}

.auth-tab button {
  width: 100%;
  padding: 0.75rem;
  margin: 1rem 0 0.5rem 0;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.auth-tab button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(124, 58, 237, 0.4);
}

.switch-tab {
  text-align: center;
  margin: 1rem 0;
  color: #8b949e;
  font-size: 0.9rem;
}

.switch-tab a {
  color: #58a6ff;
  text-decoration: none;
  font-weight: 500;
}

.switch-tab a:hover {
  text-decoration: underline;
}

.auth-info {
  text-align: center;
  font-size: 0.8rem;
  color: #8b949e;
  margin-top: 1rem;
  padding: 0.5rem;
  background: rgba(88, 166, 255, 0.1);
  border-radius: 5px;
  border: 1px solid rgba(88, 166, 255, 0.2);
}

/* User Info Styles */
#userInfo {
  text-align: center;
}

.user-welcome {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(88, 166, 255, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(88, 166, 255, 0.2);
}

.user-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.user-details {
  text-align: left;
  flex: 1;
}

.user-details h3 {
  color: #58a6ff;
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
}

.user-details p {
  color: #8b949e;
  margin: 0;
  font-size: 0.9rem;
}

.user-actions {
  display: flex;
  gap: 0.5rem;
  flex-direction: column;
}

.profile-btn, .logout-btn {
  padding: 0.75rem 1rem;
  border: 1px solid;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.profile-btn {
  background: transparent;
  border-color: #58a6ff;
  color: #58a6ff;
}

.profile-btn:hover {
  background: #58a6ff;
  color: #0d1117;
}

.logout-btn {
  background: transparent;
  border-color: #f85149;
  color: #f85149;
}

.logout-btn:hover {
  background: #f85149;
  color: white;
}

/* Tela de Resultados com Scroll */
.results-content {
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  text-align: center;
  /* Estilizar scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #58a6ff #21262d;
}

/* Webkit scrollbar (Chrome, Safari, Edge) */
.results-content::-webkit-scrollbar {
  width: 8px;
}

.results-content::-webkit-scrollbar-track {
  background: #21262d;
  border-radius: 4px;
}

.results-content::-webkit-scrollbar-thumb {
  background: #58a6ff;
  border-radius: 4px;
}

.results-content::-webkit-scrollbar-thumb:hover {
  background: #1f6feb;
}

.score-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin: 2rem 0;
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #58a6ff, #1f6feb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  box-shadow: 0 0 20px rgba(88, 166, 255, 0.5);
}

.score-details {
  text-align: left;
}

.score-details p {
  margin: 0.5rem 0;
  font-size: 1.1rem;
  color: #c9d1d9;
}

.performance-message {
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 2rem 0;
  font-size: 1.1rem;
  font-weight: bold;
}

.performance-message.excellent {
  border-color: #238636;
  background: rgba(35, 134, 54, 0.1);
  color: #3fb950;
}

.performance-message.good {
  border-color: #58a6ff;
  background: rgba(88, 166, 255, 0.1);
  color: #58a6ff;
}

.performance-message.needs-improvement {
  border-color: #f85149;
  background: rgba(248, 81, 73, 0.1);
  color: #f85149;
}

.wrong-answers-section {
  text-align: left;
  margin: 2rem 0;
  max-height: 250px;
  overflow-y: auto;
  padding: 1rem;
  background: #0d1117;
  border-radius: 8px;
  border: 1px solid #30363d;
}

.wrong-answers-section::-webkit-scrollbar {
  width: 6px;
}

.wrong-answers-section::-webkit-scrollbar-track {
  background: #21262d;
  border-radius: 3px;
}

.wrong-answers-section::-webkit-scrollbar-thumb {
  background: #f85149;
  border-radius: 3px;
}

.wrong-answers-section h3 {
  color: #f85149;
  margin-bottom: 1rem;
  position: sticky;
  top: 0;
  background: #0d1117;
  padding-bottom: 0.5rem;
}

.wrong-answer-item {
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}

.wrong-answer-item .question {
  color: #c9d1d9;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.wrong-answer-item .answer {
  margin: 0.25rem 0;
  padding-left: 1rem;
}

.wrong-answer-item .user-answer {
  color: #f85149;
}

.wrong-answer-item .correct-answer {
  color: #3fb950;
}

.results-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.results-actions .cta-button {
  flex: 1;
  max-width: 200px;
}

@media (max-width: 768px) {
  .score-section {
    flex-direction: column;
    gap: 1rem;
  }
  
  .score-details {
    text-align: center;
  }
  
  .results-actions {
    flex-direction: column;
  }
  
  .results-actions .cta-button {
    max-width: none;
  }
}

.close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #8b949e;
  z-index: 10;
}

.close:hover {
  color: #c9d1d9;
}

.modal-content h2 {
  color: #58a6ff;
  margin-bottom: 1.5rem;
  text-align: center;
}

.modal-content input {
  width: 100%;
  padding: 0.8rem;
  margin: 0.5rem 0;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 5px;
  color: #c9d1d9;
  font-size: 1rem;
}

.modal-content input:focus {
  outline: none;
  border-color: #58a6ff;
}

.modal-content button {
  width: 100%;
  padding: 0.8rem;
  margin: 0.5rem 0;
  background: #238636;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s;
}

.modal-content button:hover {
  background: #2ea043;
}

#userInfo {
  text-align: center;
}

#userInfo h3 {
  color: #58a6ff;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  main {
    padding: 7rem 1rem 2rem 1rem;
  }
}