.tps-wrap {
  --enroll-bg: #eef6f5;
  --enroll-card: #ffffff;
  --enroll-fg: #1e2f4a;
  --enroll-primary: #0f766e;
  --enroll-primary-fg: #ffffff;
  --enroll-secondary: #0b5c55;
  --enroll-border: #cce7e3;
  --enroll-muted: #64748b;
  --enroll-field-label: #0f5c55;
  --enroll-accent: #14b8a6;
  max-width: 960px;
  margin: 12px auto 24px;
  padding: 8px 12px 24px;
  font-family: Inter, system-ui, sans-serif;
  color: var(--enroll-fg);
}

.tps-card {
  background: var(--enroll-card);
  border: 1px solid var(--enroll-border);
  border-radius: 16px;
  overflow: visible;
  box-shadow: 0 8px 28px rgba(15, 118, 110, 0.08);
}

.tps-head {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
  border-bottom: 1px solid var(--enroll-border);
  border-radius: 16px 16px 0 0;
  padding: 14px 16px 12px;
}

.tps-head h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.25;
  color: var(--enroll-secondary);
}

.tps-subhead {
  margin: 4px 0 12px;
  text-align: center;
  color: var(--enroll-muted);
  font-size: 13px;
}

.tps-progress-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.tps-progress-bar span {
  display: block;
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, #0f766e, #2dd4bf);
  border-radius: inherit;
  transition: width 0.35s ease;
}

.tps-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.tps-steps li {
  min-width: 0;
}

.tps-steps button {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 2px solid #cbd5e1;
  background: #fff;
  color: #475569;
  border-radius: 12px;
  padding: 10px 6px;
  font: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  min-height: 64px;
}

.tps-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.tps-step-label {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.tps-steps li.is-done button {
  background: #f0fdfa;
  border-color: #5eead4;
  color: #0f766e;
}

.tps-steps li.is-done .tps-step-num {
  background: #99f6e4;
  color: #0f766e;
}

.tps-steps li.is-active button {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.28);
}

.tps-steps li.is-active .tps-step-num {
  background: #fff;
  color: #0f766e;
}

.tps-steps li.is-active .tps-step-label {
  color: #fff;
}

.tps-body {
  padding: 16px 16px 8px;
  background: var(--enroll-bg);
  border-radius: 0 0 16px 16px;
}

.tps-panel[hidden] { display: none !important; }

.tps-panel {
  animation: tpsIn 0.28s ease;
  background: #fff;
  border: 1px solid var(--enroll-border);
  border-radius: 14px;
  padding: 16px;
}

@keyframes tpsIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tps-panel h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: var(--enroll-secondary);
}

.tps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px 14px;
}

.tps-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.tps-full { grid-column: 1 / -1; }

.tps-field label,
.tps-label {
  font-weight: 700;
  font-size: 13px;
  color: var(--enroll-field-label);
}

.tps-field label span,
.tps-label span,
.tps-consent-check .req { color: #d81b60; }

.tps-field input,
.tps-field select,
.tps-med-add input {
  border: 1px solid #c9d6ea;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tps-field input:focus,
.tps-field select:focus,
.tps-med-add input:focus {
  outline: none;
  border-color: var(--enroll-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.tps-field input[readonly] {
  background: #f1f5f9;
  color: #334155;
}

.tps-help { font-size: 12px; color: var(--enroll-muted); }
.tps-live { min-height: 1.2em; font-size: 13px; color: #0f766e; font-weight: 600; }

.tps-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tps-choice-item {
  position: relative;
  cursor: pointer;
}

.tps-choice-item input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.tps-choice-item span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid #cce7e3;
  border-radius: 999px;
  background: #fff;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}

.tps-choice-item:hover span,
.tps-choice-item input:focus-visible + span {
  border-color: #5eead4;
}

.tps-choice-item input:checked + span {
  background: #ecfdf8;
  border-color: #0f766e;
  color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.tps-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tps-chip {
  border: 1px solid #cce7e3;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tps-chip:hover,
.tps-chip.is-selected {
  border-color: #0f766e;
  background: #ecfdf8;
  color: #0f766e;
}

.tps-chip.is-selected {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.tps-chip-check {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
}

.tps-chip-check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.tps-chip-check span {
  display: inline-flex;
  padding: 8px 12px;
}

.tps-med-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
  margin-bottom: 8px;
}

.tps-med-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 12px;
  border-radius: 999px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  font-size: 13px;
  font-weight: 600;
  color: #0f766e;
}

.tps-med-chip button {
  border: 0;
  background: transparent;
  color: #b91c1c;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}

.tps-med-add {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tps-med-add input { flex: 1; min-width: 180px; }

.tps-drop {
  position: relative;
  border: 2px dashed #99f6e4;
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  background: #f8fffe;
  transition: border-color 0.2s, background 0.2s;
}

.tps-drop.is-filled {
  border-style: solid;
  border-color: #0f766e;
  background: #ecfdf8;
}

.tps-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.tps-drop-title { margin: 0 0 4px; font-weight: 700; color: #0f766e; }
.tps-file-name { margin: 8px 0 0; font-size: 13px; font-weight: 600; color: #334155; }

.tps-consent-content {
  font-size: 13px;
  line-height: 1.5;
  background: #f8fffe;
  border: 1px solid var(--enroll-border);
  border-radius: 12px;
  padding: 12px;
}

.tps-consent-content h3 { margin: 0 0 6px; font-size: 0.95rem; color: var(--enroll-secondary); }
.tps-consent-q-list { margin: 0 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.tps-consent-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--enroll-border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.tps-consent-check input {
  width: auto !important;
  margin-top: 3px;
  accent-color: var(--enroll-primary);
}

.tps-summary {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fffe;
  border: 1px solid var(--enroll-border);
  font-size: 13px;
  line-height: 1.5;
  color: #334155;
}

.tps-summary strong { color: #0f766e; }

.tps-success,
.tps-errorbox {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 700;
}

.tps-success { background: #e8f7ec; border: 1px solid #bfe7c7; color: #1b5e20; }
.tps-errorbox { background: #ffebee; border: 1px solid #ffcdd2; color: #b00020; }

.tps-invalid { border-color: #d81b60 !important; box-shadow: 0 0 0 3px rgba(216, 27, 96, 0.12) !important; }
.tps-field.tps-invalid-group { outline: 2px solid rgba(216, 27, 96, 0.22); outline-offset: 4px; border-radius: 10px; }

.tps-actions {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 8px 4px;
  border-top: 1px solid var(--enroll-border);
  background: transparent;
}

.tps-actions button,
.btn-light,
.btn-primary {
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s;
}

.btn-light { background: #e9eef6; color: #203354; }
.btn-primary {
  color: var(--enroll-primary-fg);
  background: var(--enroll-primary);
  min-width: 200px;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.25);
}

.btn-primary:hover { background: #0b5c55; }
.tps-actions button:active { transform: translateY(1px); }

@media (min-width: 700px) {
  .tps-grid { grid-template-columns: 1fr 1fr; }
  .tps-field.tps-full { grid-column: 1 / -1; }
  .tps-steps button {
    flex-direction: row;
    gap: 8px;
    padding: 12px 10px;
    min-height: 52px;
  }
  .tps-step-label { font-size: 13px; }
}

@media (min-width: 900px) {
  .tps-body { padding: 18px 20px 10px; }
  .tps-panel { padding: 18px 20px; }
}

@media (max-width: 640px) {
  .tps-wrap { padding-left: 8px; padding-right: 8px; }
  .tps-steps { gap: 6px; }
  .tps-steps button {
    padding: 8px 4px;
    min-height: 58px;
    border-width: 1.5px;
  }
  .tps-step-label { font-size: 11px; }
  .tps-step-num {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tps-panel,
  .tps-progress-bar span,
  .tps-chip,
  .tps-choice-item span {
    animation: none !important;
    transition: none !important;
  }
}
