:root {
  --ink: #3f3445;
  --brand: #54206f;
  --brand-hover: #6a2b86;
  --danger: #b3263e;
  --ok: #287a45;
  --line: #e1d6e7;
  --bg: #f7f3f9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #efe4f5 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #e8f0ea 0%, transparent 50%),
    var(--bg);
  padding: 28px 16px 40px;
}

.card {
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 14px 36px rgba(84, 32, 111, 0.12);
}

h1 {
  margin: 0 0 10px;
  font-size: 26px;
  color: var(--brand);
  letter-spacing: 0.04em;
}

.form-desc,
.sub,
.help {
  margin: 0 0 14px;
  line-height: 1.6;
  color: #5c5163;
  font-size: 14px;
  white-space: pre-wrap;
}

.field {
  margin: 0 0 16px;
}

label,
legend {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink);
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 0 0 16px;
  padding: 12px 14px 10px;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 12px;
  font-size: 16px;
}

input:focus {
  outline: none;
  border-color: var(--brand-hover);
  box-shadow: 0 0 0 3px rgba(106, 43, 134, 0.13);
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0;
  line-height: 1.45;
}

.choice input {
  margin-top: 3px;
}

.choice.full {
  opacity: 0.72;
  cursor: not-allowed;
}

.choice.separator {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  margin: 18px 0 6px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f4ecf8;
  border-left: 3px solid var(--brand-hover, #6a2b86);
  cursor: default;
  color: var(--brand, #54206f);
}

.choice.separator input {
  display: none;
}

.separator-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.separator-hint {
  font-size: 12px;
  font-weight: 500;
  color: #76677d;
  letter-spacing: 0.02em;
}

.full-label {
  color: var(--danger);
  font-weight: 700;
}

button,
.result-back {
  margin-top: 8px;
  width: 100%;
  border: none;
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 13px 14px;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.08em;
}

button:hover,
.result-back:hover {
  background: var(--brand-hover);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.error {
  color: var(--danger);
  font-weight: 700;
  margin: 0 0 14px;
  line-height: 1.55;
}

.result-success {
  color: var(--ok);
  font-size: 28px;
  font-weight: 700;
  margin: 12px 0 18px;
}

.result-name {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 12px;
}

.result-dates {
  font-size: 20px;
  font-weight: 700;
  color: var(--brand);
  margin: 0 0 22px;
  line-height: 1.55;
}

.result-dates-label {
  font-weight: 600;
  color: var(--ink);
}

.loading-overlay,
.alert-overlay {
  position: fixed;
  inset: 0;
  background: rgba(63, 52, 69, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 18px;
}

.loading-overlay[hidden],
.alert-overlay[hidden],
[hidden] {
  display: none !important;
}

.loading-box,
.alert-box {
  background: #fff;
  border-radius: 12px;
  padding: 22px;
  min-width: 180px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 32px rgba(84, 32, 111, 0.22);
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 12px;
  border: 3px solid #e1d6e7;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.alert-box p {
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 560px) {
  body {
    padding: 18px 12px;
  }
  .card {
    padding: 21px 17px;
  }
  h1 {
    font-size: 22px;
  }
}
