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

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --secondary: #6b7280;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --bg: #f9fafb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --text-light: #6b7280;
  --radius: 8px;
  --spacing: 16px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px 0;
}

#app {
  min-height: 100vh;
}

.screen {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 40px;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container {
  width: 100%;
  max-width: 600px;
  padding: 0 20px;
}

/* Identification Screen */

.identification-screen .container {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.identification-screen h1 {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--text);
  text-align: center;
}

.subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 32px;
  font-size: 16px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.helper-text {
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 24px;
}

/* Questions Screen */

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
  transition: width 0.3s ease;
  z-index: 100;
}

.question-header {
  margin-bottom: 32px;
  background: var(--surface);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.question-counter {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  margin-bottom: 8px;
}

.question-header h2 {
  font-size: 22px;
  line-height: 1.4;
  color: var(--text);
}

.statements-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.statement {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.2s;
}

.statement.ranked {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.02);
}

.statement-text {
  font-size: 16px;
  margin-bottom: 16px;
  line-height: 1.5;
  color: var(--text);
}

.rank-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.rank-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.rank-btn:hover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
}

.statement.ranked .rank-btn[data-rank]:not(:disabled) {
  opacity: 0.3;
}

.statement .rank-btn[data-rank] {
  cursor: pointer;
}

.statement.ranked .rank-indicator {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}

.instructions {
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 24px;
  background: #eff6ff;
  padding: 12px;
  border-radius: 6px;
}

/* Results Screen */

.results-screen .container {
  max-width: 700px;
}

.results-screen h1 {
  text-align: center;
  font-size: 32px;
  margin-bottom: 32px;
  color: var(--text);
}

.profile-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.profile-main {
  text-align: center;
  margin-bottom: 32px;
}

.profile-type-name {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.profile-type-score {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.scores-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 0;
}

.score-item {
  text-align: center;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  transition: all 0.2s;
}

.score-label {
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 8px;
}

.score-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.score-name {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.2;
}

.secondary-profile {
  background: var(--bg);
  border-left: 4px solid var(--warning);
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 24px;
  font-size: 15px;
}

.description {
  background: var(--surface);
  padding: 24px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  line-height: 1.8;
}

.description p {
  margin-bottom: 16px;
  font-size: 15px;
  color: var(--text);
}

.description p:last-child {
  margin-bottom: 0;
}

.alert {
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 24px;
  font-size: 15px;
  border-left: 4px solid;
}

.alert-info {
  background: #dbeafe;
  border-left-color: #3b82f6;
  color: #1e40af;
}

.alert-info strong {
  display: block;
  margin-bottom: 4px;
}

.sync-status {
  text-align: center;
  margin-bottom: 24px;
  font-size: 14px;
}

.sync-success {
  color: var(--success);
  font-weight: 600;
}

.sync-warning {
  color: var(--warning);
  font-weight: 600;
}

/* Buttons */

.button-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--border);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive */

@media (max-width: 640px) {
  .screen {
    padding-top: 20px;
  }

  .identification-screen .container,
  .question-header {
    padding: 24px;
  }

  .identification-screen h1 {
    font-size: 24px;
  }

  .results-screen h1 {
    font-size: 28px;
  }

  .profile-type-name {
    font-size: 20px;
  }

  .profile-type-score {
    font-size: 28px;
  }

  .scores-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .button-group {
    flex-wrap: wrap;
  }

  .btn {
    flex: 1;
    min-width: 140px;
    justify-content: center;
  }
}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible for keyboard navigation */

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible {
  outline-offset: -4px;
}
