* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  min-height: 100vh;
  background: #1a1a2e;
  color: #eee;
}

main {
  padding: 2rem;
}

.btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

.btn-primary {
  background: #4361ee;
  color: #fff;
}

.btn-primary:hover {
  background: #3a56d4;
}

.btn-secondary {
  background: #444;
  color: #eee;
  margin-top: 1rem;
}

.btn-secondary:hover {
  background: #555;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  background: #16213e;
  border-radius: 12px;
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #2a2a4a;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 1.25rem;
  overflow: auto;
}

/* Login form */
.challenge-passed-msg {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: rgba(67, 97, 238, 0.2);
  border: 1px solid #4361ee;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #a5b8ff;
}

.challenge-passed-msg.hidden {
  display: none;
}

.login-form label {
  display: block;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.login-form input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #3a3a5c;
  border-radius: 6px;
  background: #1a1a2e;
  color: #eee;
  font-size: 1rem;
}

.login-form input:focus {
  outline: none;
  border-color: #4361ee;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
}

.login-form button[type="submit"] {
  width: 100%;
  margin-top: 1.25rem;
}

.hint {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #888;
}

.hint code {
  background: #2a2a4a;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

/* Challenge container */
.challenge-container {
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.challenge-container.hidden {
  display: none;
}

.challenge-label {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: #aaa;
}

.challenge-frame {
  width: 100%;
  min-height: 280px;
  border: 1px solid #3a3a5c;
  border-radius: 8px;
  background: #fff;
}

#login-form-container.hidden {
  display: none;
}
