:root {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --secondary-color: #f3f4f6;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --border-color: #e5e7eb;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.form-container {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 100%;
  padding: 40px;
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-header {
  text-align: center;
  margin-bottom: 30px;
}

.form-header .icon-wrapper {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.form-header .icon-wrapper i {
  font-size: 40px;
  color: white;
}

.form-header h2 {
  color: var(--text-dark);
  font-weight: 600;
  margin-bottom: 10px;
}

.form-header p {
  color: var(--text-light);
  font-size: 14px;
}

.form-group {
  margin-bottom: 25px;
}

.form-label {
  color: var(--text-dark);
  font-weight: 500;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.form-control,
.form-select {
  border: 2px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 15px;
  font-size: 15px;
  transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.1);
  outline: none;
}

.form-control.is-invalid,
.form-select.is-invalid {
  border-color: var(--error-color);
}

.invalid-feedback {
  color: var(--error-color);
  font-size: 13px;
  margin-top: 5px;
  display: none;
}

.form-control.is-invalid ~ .invalid-feedback,
.form-select.is-invalid ~ .invalid-feedback {
  display: block;
}

.warning-text {
  color: var(--warning-color);
  font-size: 12px;
  margin-top: 5px;
  display: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border: none;
  border-radius: 10px;
  padding: 12px 30px;
  font-size: 16px;
  font-weight: 500;
  color: white;
  width: 100%;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--secondary-color);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 30px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-dark);
  width: 100%;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--border-color);
  transform: translateY(-2px);
}

.choice-card {
  border: 2px solid var(--border-color);
  border-radius: 15px;
  padding: 25px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

.choice-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.choice-card i {
  font-size: 28px; /* Was 40px, now smaller */
  color: var(--primary-color);
  margin-bottom: 10px;
}

.choice-card h5 {
  color: var(--text-dark);
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 16px; /* Was default ~20-22px, now smaller */
}

.choice-card p {
  color: var(--text-light);
  font-size: 13px;
  margin: 0;
}

.other-person-card {
  background: var(--secondary-color);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 15px;
  position: relative;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.person-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.person-number {
  background: var(--primary-color);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.btn-remove {
  background: var(--error-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-remove:hover {
  transform: scale(1.1);
  background: #dc2626;
}

.btn-add-person {
  background: var(--success-color);
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  color: white;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px auto;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-add-person:hover {
  background: #059669;
  transform: translateY(-2px);
}

.btn-add-person:disabled {
  background: var(--text-light);
  cursor: not-allowed;
  transform: none;
}

.step-indicator {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.step {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border-color);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  position: relative;
  margin: 0 10px;
}

.step.active {
  background: var(--primary-color);
  color: white;
}

.step.completed {
  background: var(--success-color);
  color: white;
}

.step::after {
  content: "";
  position: absolute;
  width: 40px;
  height: 2px;
  background: var(--border-color);
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
}

.step:last-child::after {
  display: none;
}

.success-message {
  text-align: center;
  padding: 40px;
  display: none;
}

.success-icon {
  width: 100px;
  height: 100px;
  background: var(--success-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

.success-icon i {
  font-size: 50px;
  color: white;
}

.character-count {
  font-size: 12px;
  color: var(--text-light);
  text-align: right;
  margin-top: 5px;
}

.selected-names-list {
  background: white;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
  border: 2px solid var(--border-color);
}

.selected-names-list h6 {
  color: var(--text-dark);
  font-size: 14px;
  margin-bottom: 10px;
  font-weight: 600;
}

.selected-name-tag {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 12px;
  margin: 2px;
}

/* Section: Registered People success page (remains) */
.registered-people-list {
  margin: 25px auto 0 auto;
  padding: 20px 15px;
  background: #f3f4f6;
  border: 2px solid var(--success-color);
  border-radius: 14px;
  max-width: 420px;
  text-align: left;
  display: none;
}
.registered-people-list h5 {
  color: var(--success-color);
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}
.registered-people-list .registered-person {
  padding: 7px 5px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.registered-people-list .registered-person:last-child {
  border-bottom: none;
}
.registered-people-list .person-nik {
  color: var(--text-light);
  font-size: 13px;
  margin-left: 10px;
  font-family: "Courier New", Courier, monospace;
}

@media (max-width: 576px) {
  .form-container {
    padding: 30px 20px;
  }

  .choice-container {
    grid-template-columns: 1fr;
  }

  .step {
    margin: 0 5px;
  }

  .step::after {
    width: 20px;
  }
  .registered-people-list {
    max-width: 100%;
    padding: 12px 3px;
  }
}

/* New: custom step4 for result page */
#step4Section {
  display: none;
  animation: fadeIn 0.35s;
}
#step4Section .registered-people-list {
  display: block;
}
