body {
  font-family: "Microsoft JhengHei", Arial, sans-serif;
  background: linear-gradient(to bottom, #f9f9fa, #f0f0f5);
  color: #2c2c2c;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

.text-primary-red {
  color: #c8102e;
}

.text-bold {
  font-weight: bold;
}

.form-container {
  max-width: 960px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s forwards 0.3s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.progress-container {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  padding: 10px 0;
}
.progress-container .progress-bar-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.progress-container .progress-label {
  font-weight: bold;
  color: #555;
  white-space: nowrap;
}
.progress-container .progress-outer {
  flex: 1;
  height: 12px;
  background: #e9ecef;
  border-radius: 6px;
  overflow: hidden;
}
.progress-container .progress-inner {
  height: 100%;
  width: 0;
  background: linear-gradient(to right, #c8102e, #a00d24);
  transition: width 0.5s ease;
  position: relative;
}
.progress-container .progress-inner::after {
  content: attr(data-percent) "%";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.4s;
}
.progress-container .progress-inner.filled::after {
  opacity: 1;
}

header.custom-header {
  background: linear-gradient(135deg, #c8102e, #a00d24);
  color: white;
  padding: 24px 32px;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
header.custom-header .logo-placeholder {
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}
header.custom-header .logo-placeholder img {
  max-width: 100%;
  height: auto;
}
header.custom-header h1 {
  font-size: 2.2rem;
  font-weight: bold;
}

.form-wrapper {
  background: white;
  padding: 30px;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

h2.section-title {
  color: #c8102e;
  border-bottom: 3px solid #c8102e;
  padding-bottom: 10px;
  margin: 2rem 0 1.5rem;
  font-size: 1.4rem;
  font-weight: bold;
}

h3.sub-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #a00d24;
  margin: 2rem 0 1.5rem;
  padding: 0.6rem 1.2rem;
  background-color: rgba(200, 16, 46, 0.06);
  border-left: 5px solid #c8102e;
  border-radius: 0 8px 8px 0;
  display: flex;
  align-items: center;
}

.required::after {
  content: " *";
  color: #c8102e;
  font-weight: bold;
}

.inline-other-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.inline-other-group .form-check {
  display: flex;
  align-items: center;
  padding-left: 0;
  margin-bottom: 0;
  gap: 0.4rem;
}
.inline-other-group .form-check .form-check-input {
  float: none;
  margin-left: 0;
  margin-top: 0;
}
.inline-other-group .form-check .form-check-label {
  margin-bottom: 0;
  line-height: 1.2;
}
.inline-other-group .form-control {
  flex: 1 1 auto;
  min-width: 140px;
  max-width: 200px;
}

.conditional {
    /*display: none;*/
    margin: 1rem 0 1rem 1.5rem;
    padding: 1.2rem;
    background: #fff5f5;
    border-left: 5px solid #c8102e;
    border-radius: 6px;
}

.sub-conditional {
    /*display: none;*/
}

.inline-other-group {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
  width: auto;
}
.inline-other-group .form-check {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  gap: 0.4rem;
  flex-shrink: 0;
}
.inline-other-group .form-check .form-check-input {
  margin: 0;
  position: static;
}
.inline-other-group .form-check .form-check-label {
  margin: 0;
  white-space: nowrap;
}
.inline-other-group .form-control {
  flex: 1 1 auto;
  min-width: 80px;
  max-width: 200px;
}

.btn-submit {
  width: 100%;
  max-width: 380px;
  margin: 50px auto 20px;
  padding: 18px;
  font-size: 1.35rem;
  font-weight: bold;
  color: white;
  background: #c8102e;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 6px 20px rgba(200, 16, 46, 0.25);
  position: relative;
  overflow: hidden;
}
.btn-submit:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 30px rgba(200, 16, 46, 0.35);
  color: white;
}
.btn-submit:active {
  transform: translateY(1px) scale(0.98);
}
.btn-submit::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  pointer-events: none;
}
.btn-submit:active::before {
  width: 300px;
  height: 300px;
}

.final-agreement-box {
  background-color: #ffffff;
  border: 1px solid rgba(200, 16, 46, 0.15);
  border-top: 5px solid #c8102e;
  border-bottom: 5px solid #c8102e;
  border-radius: 12px;
  padding: 2.5rem 2rem;
  margin-top: 3.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.final-agreement-box .agree-label {
  background-color: rgba(200, 16, 46, 0.03);
  border: 1px solid rgba(200, 16, 46, 0.1);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.3s ease;
}
.final-agreement-box .agree-label:hover {
  background-color: rgba(200, 16, 46, 0.06);
}
.final-agreement-box .agree-label input[type=checkbox] {
  transform: scale(1.3);
  margin-top: 4px;
  border-color: rgba(200, 16, 46, 0.4);
  cursor: pointer;
}
.final-agreement-box .agree-label input[type=checkbox]:checked {
  background-color: #28a745;
  border-color: #28a745;
}
.final-agreement-box .agree-label span {
  font-size: 1.05rem;
  line-height: 1.6;
}
.final-agreement-box .form-label {
  font-size: 1.1rem;
  font-weight: 600;
}
.final-agreement-box .btn-submit {
  margin: 30px auto 0;
}

.shake {
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  border-color: #c8102e !important;
}

@keyframes shake {
  10%, 90% {
    transform: translateX(-1px);
  }
  20%, 80% {
    transform: translateX(2px);
  }
  30%, 50%, 70% {
    transform: translateX(-3px);
  }
  40%, 60% {
    transform: translateX(3px);
  }
}
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(200, 16, 46, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.success-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.success-overlay.active .success-content {
  transform: scale(1);
  opacity: 1;
}
.success-overlay .success-content {
  text-align: center;
  color: white;
  transform: scale(0.7);
  opacity: 0;
  transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2001;
}
.success-overlay .success-check {
  font-size: 8rem;
  margin-bottom: 20px;
  animation: checkBounce 1.2s ease;
}
.success-overlay .success-text {
  font-size: 2.2rem;
  font-weight: bold;
  margin: 20px 0;
}
.success-overlay .success-subtext {
  font-size: 1.2rem;
  margin-top: 20px;
  margin-bottom: 30px;
  opacity: 0.9;
}
.success-overlay .btn-download, .success-overlay .btn-reset {
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin: 10px;
  transition: all 0.3s;
}
.success-overlay .btn-download {
  background: white;
  color: #2c2c2c;
}
.success-overlay .btn-download:hover {
  color: #c8102e;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}
.success-overlay .btn-reset {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}
.success-overlay .btn-reset:hover {
  background: rgba(255, 255, 255, 0.4);
}

.success-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-content {
    margin: 0 !important;
    transform: none !important;
}

@keyframes checkBounce {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.3);
  }
  80% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}
.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0.7;
  animation: float 6s infinite linear;
}

@keyframes float {
  0% {
    transform: translateY(100vh) scale(0.2);
    opacity: 0;
  }
  20% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-150px) scale(0.8);
    opacity: 0;
  }
}