* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #1a1a2e;
  color: #eee;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo {
  text-align: center;
  margin-bottom: 40px;
}

.logo h1 {
  font-size: 2rem;
  font-weight: 600;
  color: #4a9eff;
}

.card {
  background: #16213e;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.card h2 {
  margin-bottom: 24px;
  font-size: 1.5rem;
  text-align: center;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  border: 2px solid #2d3e5f;
  border-radius: 8px;
  background: #0f1729;
  color: #eee;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #4a9eff;
}

.btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #4a9eff;
  color: #fff;
}

.btn-primary:hover {
  background: #3a8eef;
}

.btn-primary:disabled {
  background: #2d3e5f;
  color: #666;
  cursor: not-allowed;
}

.btn-success {
  background: #28a745;
  color: #fff;
}

.btn-success:hover:not(:disabled) {
  background: #218838;
}

.btn-success:disabled {
  background: #2d3e5f;
  color: #666;
  cursor: not-allowed;
}

.btn-danger {
  background: #dc3545;
  color: #fff;
}

.btn-danger:hover {
  background: #c82333;
}

.error-message {
  color: #ff6b6b;
  text-align: center;
  margin-top: 16px;
  font-size: 0.9rem;
}

.success-message {
  color: #51cf66;
  text-align: center;
  margin-top: 16px;
  font-size: 0.9rem;
}

/* Instructions page */
.instructions-list {
  list-style: none;
  margin: 24px 0;
}

.instructions-list li {
  padding: 12px 0;
  border-bottom: 1px solid #2d3e5f;
  display: flex;
  align-items: center;
}

.instructions-list li:last-child {
  border-bottom: none;
}

.instructions-list .icon {
  width: 24px;
  height: 24px;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.instructions-list .icon.pending {
  color: #868e96;
}

.instructions-list .icon.granted {
  color: #51cf66;
}

.instructions-list .icon.denied {
  color: #ff6b6b;
}

.permission-status {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0;
}

.permission-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #0f1729;
  border-radius: 8px;
}

.permission-item .status {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.permission-item .status.pending {
  background: #2d3e5f;
  color: #868e96;
}

.permission-item .status.granted {
  background: rgba(40, 167, 69, 0.2);
  color: #51cf66;
}

.permission-item .status.denied {
  background: rgba(220, 53, 69, 0.2);
  color: #ff6b6b;
}

/* Test page */
.test-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  overflow: hidden;
}

.vnc-container {
  width: 100%;
  height: 100%;
}

.vnc-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.webcam-overlay {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 200px;
  height: 150px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  cursor: move;
  z-index: 1000;
  background: #000;
}

.webcam-overlay video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.webcam-overlay .recording-indicator {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 12px;
  height: 12px;
  background: #ff4444;
  border-radius: 50%;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

.end-test-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 20px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.end-test-btn:hover {
  background: #c82333;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid #2d3e5f;
  border-top-color: #4a9eff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 20px;
  }

  .card {
    padding: 24px;
  }

  .webcam-overlay {
    width: 120px;
    height: 90px;
    bottom: 10px;
    right: 10px;
  }
}
