:root {
  --primary: #1e3a5f;
  --primary-dark: #152a45;
  --primary-light: #2d5a8a;
  --accent: #f5a623;
  --accent-dark: #e09000;
  --secondary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f5f5f0;
  --bg-secondary: #eeeee8;
  --card: #fafaf8;
  --card-border: #e0e0d8;
  --text: #1e293b;
  --text-muted: #64748b;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --radius: 12px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('bg-image.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}

.app-container {
  max-width: 750px;
  margin: 0 auto;
  padding: 20px;
}

/* Header Controls */
.header-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.music-btn {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border: none;
  border-radius: 50%;
  font-size: 18px;
  color: white;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}

.music-btn:hover {
  transform: scale(1.1);
  background: var(--primary-light);
}

.music-btn.playing {
  background: var(--accent);
  color: var(--primary-dark);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

/* Progress */
.progress-container {
  background: var(--card-border);
  border-radius: 50px;
  height: 8px;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 50px;
  width: 0%;
  transition: width 0.5s ease;
}

.progress-text {
  position: absolute;
  right: -40px;
  top: -6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Sections */
.section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

/* Logo Center */
.logo-center {
  text-align: center;
  margin-bottom: 32px;
}

.logo-center img {
  height: 140px;
  width: auto;
  object-fit: contain;
}

@media (max-width: 600px) {
  .logo-center img {
    height: 100px;
  }
}

/* Welcome Letter */
.welcome-letter {
  text-align: left;
  margin: 24px 0 32px;
  line-height: 1.8;
}

.welcome-letter p {
  margin-bottom: 16px;
  color: var(--text);
}

.welcome-letter .greeting {
  text-align: left;
  margin-bottom: 20px;
}

.welcome-letter .signature-name {
  font-weight: 700;
  color: var(--primary);
  margin-top: 24px;
  margin-bottom: 0;
  text-align: left;
}

.likert-info {
  background: rgba(30, 58, 95, 0.08);
  border: 1px solid var(--primary-light);
  border-radius: 8px;
  padding: 16px;
  margin: 24px 0;
  text-align: center;
}

.likert-info p {
  margin: 4px 0;
  font-size: 14px;
}

.thesis-title {
  font-style: normal;
  font-size: 15px;
}

.thesis-title em {
  font-style: italic;
}

h1 {
  font-size: 32px;
  text-align: center;
  margin-bottom: 12px;
  color: var(--primary);
  font-weight: 700;
}

h2 {
  font-size: 16px;
  text-align: center;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 16px;
  line-height: 1.5;
}

.subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 15px;
}

.info-box {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 36px;
  color: var(--text-muted);
  font-size: 14px;
}

.info-box span {
  background: var(--bg-secondary);
  padding: 8px 16px;
  border-radius: 8px;
}

/* Section Header */
.section-header {
  margin-bottom: 24px;
  text-align: left;
}

.badge {
  display: inline-block;
  background: var(--primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  color: white;
}

.section-header h2 {
  text-align: left;
  font-size: 24px;
  color: var(--primary);
  margin-bottom: 4px;
  font-weight: 600;
}

.section-header p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Form */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

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

.form-group input,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  background: white;
  border: 2px solid var(--card-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.15);
}

.radio-group {
  display: flex;
  gap: 12px;
}

.radio-card {
  flex: 1;
  padding: 16px;
  background: white;
  border: 2px solid var(--card-border);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s;
}

.radio-card:hover {
  border-color: var(--primary);
}

.radio-card input {
  display: none;
}

.radio-card:has(input:checked) {
  border-color: var(--primary);
  background: rgba(30, 58, 95, 0.08);
}

/* Legend & Trait Box */
.legend {
  background: var(--bg-secondary);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 24px;
  text-align: center;
}

.trait-box {
  position: sticky;
  top: 80px;
  /* Below navbar */
  z-index: 10;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
}

.trait-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

/* Questions */
.question {
  background: white;
  padding: 24px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 2px solid var(--card-border);
  transition: all 0.3s;
  text-align: left;
}

.question:hover {
  border-color: var(--primary-light);
}

.question.answered {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.05);
}

.question.error {
  border-color: var(--danger);
  animation: shake 0.5s;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

.question p {
  margin-bottom: 16px;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}

.likert {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.likert label {
  flex: 1;
  text-align: center;
  cursor: pointer;
}

.likert label span {
  display: block;
  padding: 12px 8px;
  background: var(--bg);
  border: 2px solid var(--card-border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s;
  color: var(--text-muted);
}

.likert label:hover span {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.likert label input {
  display: none;
}

.likert label:has(input:checked) span {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: scale(1.05);
}

/* Buttons */
.nav-buttons {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

.btn-primary,
.btn-secondary {
  flex: 1;
  padding: 16px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: var(--accent);
  color: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(245, 166, 35, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: var(--accent-dark);
  box-shadow: 0 6px 20px rgba(245, 166, 35, 0.5);
}

/* Center button on welcome page */
.card>.btn-primary {
  display: block;
  width: auto;
  max-width: 280px;
  margin: 0 auto;
}

.btn-secondary {
  background: white;
  color: var(--text);
  border: 2px solid var(--card-border);
}

.btn-secondary:hover {
  border-color: var(--primary);
}

.btn-submit {
  background: var(--success);
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-submit:hover {
  background: #059669;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

/* Result */
.result-card {
  text-align: center;
}

.checkmark {
  width: 80px;
  height: 80px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: white;
  margin: 0 auto 24px;
  animation: pop 0.5s ease;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

@keyframes pop {
  0% {
    transform: scale(0);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

.result-card h2 {
  font-size: 32px;
  margin-bottom: 8px;
  color: var(--text);
}

#resultSummary {
  margin: 24px 0;
  text-align: left;
}

.score-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--card-border);
}

.score-bar {
  flex: 1;
  margin: 0 16px;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* Alert */
.alert {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--warning);
  color: #000;
  padding: 16px 24px;
  border-radius: 8px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

.alert.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Responsive */
@media (max-width: 600px) {
  .app-container {
    padding: 12px;
  }

  .card {
    padding: 24px;
  }

  h1 {
    font-size: 24px;
  }

  .info-box {
    flex-direction: column;
    gap: 8px;
    align-items: center;
  }

  .likert {
    flex-wrap: nowrap;
    gap: 4px;
  }

  .likert label {
    flex: 1;
  }

  .likert label span {
    padding: 8px 2px;
    font-size: 10px;
  }

  .radio-group {
    flex-direction: column;
  }

  .nav-buttons {
    flex-direction: column;
  }
}