/* Design tokens from kit/toi-gian */
:root {
  --chinh: #2563eb;
  --chinh-dam: #1d4ed8;
  --chinh-nhat: #eef3ff;
  --tin-cay: #10b981;
  --tin-cay-nhat: #ecfdf5;
  --canh-bao: #b45309;
  --canh-bao-nhat: #fffbeb;
  --loi: #b91c1c;
  --loi-nhat: #fde8e8;
  --chu: #111827;
  --chu-mo: #6b7280;
  --chu-nhat: #9ca3af;
  --nen: #ffffff;
  --nen-phu: #f9fafb;
  --o-xam: #f3f4f6;
  --vien: #e5e7eb;
  --font: "Be Vietnam Pro", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --bo-nho: 10px;
  --bo: 12px;
  --bo-lon: 16px;
  --cao-nut: 48px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--chu);
  background-color: var(--nen-phu);
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--s-4);
}

/* Header */
.header {
  text-align: center;
  margin-bottom: var(--s-8);
  padding-bottom: var(--s-6);
  border-bottom: 1px solid var(--vien);
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--chu);
  margin-bottom: var(--s-2);
}

.subtitle {
  font-size: 15px;
  color: var(--chu-mo);
  margin-bottom: var(--s-6);
}

.progress-bar {
  font-size: 13px;
  color: var(--chu-mo);
  font-weight: 500;
}

.disclaimer {
  background-color: var(--canh-bao-nhat);
  border-left: 4px solid var(--canh-bao);
  padding: var(--s-4);
  margin-bottom: var(--s-6);
  border-radius: var(--bo-nho);
  font-size: 14px;
  color: var(--chu);
  line-height: 1.5;
}

/* Form */
.form {
  background-color: var(--nen);
  border-radius: var(--bo-lon);
  padding: var(--s-6);
  margin-bottom: var(--s-6);
}

.form-section {
  margin-bottom: var(--s-8);
}

.form-section:last-of-type {
  margin-bottom: var(--s-6);
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--chu);
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 2px solid var(--chinh-nhat);
}

/* Form group */
.form-group {
  margin-bottom: var(--s-5);
}

.form-group label:first-child {
  display: block;
  font-weight: 600;
  margin-bottom: var(--s-3);
  color: var(--chu);
}

.help-text {
  font-size: 13px;
  color: var(--chu-mo);
  margin-top: var(--s-2);
  margin-bottom: var(--s-3);
  font-style: italic;
}

fieldset {
  border: none;
}

fieldset legend {
  font-weight: 600;
  margin-bottom: var(--s-3);
  color: var(--chu);
  display: block;
}

.sub-question {
  margin-left: var(--s-4);
  margin-bottom: var(--s-4);
  padding-left: var(--s-4);
  border-left: 2px solid var(--vien);
}

.sub-question > label:first-child {
  display: block;
  font-weight: 500;
  margin-bottom: var(--s-3);
  color: var(--chu);
  font-size: 14px;
}

/* Radio group */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.radio-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 400;
  user-select: none;
}

.radio-label input[type="radio"] {
  width: 20px;
  height: 20px;
  margin-right: var(--s-3);
  cursor: pointer;
  accent-color: var(--chinh);
}

.radio-label input[type="radio"]:checked + label,
.radio-label input[type="radio"]:focus {
  outline: none;
}

/* Buttons */
.btn {
  height: var(--cao-nut);
  padding: var(--s-3) var(--s-6);
  border: none;
  border-radius: var(--bo);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
}

.btn-primary {
  background-color: var(--chinh);
  color: white;
}

.btn-primary:hover {
  background-color: var(--chinh-dam);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: var(--o-xam);
  color: var(--chu);
}

.btn-secondary:hover {
  background-color: var(--vien);
}

.form-actions {
  display: flex;
  gap: var(--s-4);
  margin-top: var(--s-6);
}

/* Results section */
.results-section {
  background-color: var(--nen);
  border-radius: var(--bo-lon);
  padding: var(--s-6);
}

.results-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  margin-top: var(--s-6);
}

.results-actions .btn {
  width: 100%;
}

.risk-card {
  padding: var(--s-5);
  border-radius: var(--bo-lon);
  margin-bottom: var(--s-6);
}

.risk-card.green {
  background-color: var(--tin-cay-nhat);
  border-left: 4px solid var(--tin-cay);
}

.risk-card.yellow {
  background-color: var(--canh-bao-nhat);
  border-left: 4px solid var(--canh-bao);
}

.risk-card.orange {
  background-color: #fed7aa;
  border-left: 4px solid #f97316;
}

.risk-card.red {
  background-color: var(--loi-nhat);
  border-left: 4px solid var(--loi);
}

.risk-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--s-3);
}

.risk-card.green .risk-title {
  color: #047857;
}

.risk-card.yellow .risk-title {
  color: #b45309;
}

.risk-card.orange .risk-title {
  color: #ea580c;
}

.risk-card.red .risk-title {
  color: #991b1b;
}

.risk-description {
  font-size: 14px;
  line-height: 1.7;
  margin-top: var(--s-2);
}

.risk-issues {
  margin-top: var(--s-4);
  padding: var(--s-3);
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: var(--bo-nho);
}

.risk-issues li {
  margin-bottom: var(--s-2);
  font-size: 14px;
  margin-left: var(--s-4);
}

/* Document checklist */
.checklist-section {
  margin-top: var(--s-6);
  padding-top: var(--s-6);
  border-top: 1px solid var(--vien);
}

.checklist-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: var(--s-4);
  color: var(--chu);
}

.checklist-item {
  margin-bottom: var(--s-4);
  padding: var(--s-4);
  background-color: var(--nen-phu);
  border-radius: var(--bo-nho);
  border-left: 3px solid var(--chinh);
}

.checklist-item h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: var(--s-2);
  color: var(--chu);
}

.checklist-item ul {
  margin-left: var(--s-4);
  font-size: 13px;
  color: var(--chu-mo);
  line-height: 1.7;
}

.checklist-item li {
  margin-bottom: var(--s-2);
}

/* Registrant recommendation */
.registrant-section {
  margin-top: var(--s-6);
  padding: var(--s-4);
  background-color: var(--chinh-nhat);
  border-radius: var(--bo-nho);
}

.registrant-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--chinh-dam);
  margin-bottom: var(--s-3);
}

.registrant-section p {
  font-size: 14px;
  color: var(--chu);
  line-height: 1.7;
}

/* Download section */
.download-section {
  margin-top: var(--s-6);
  padding: var(--s-4);
  background-color: var(--nen-phu);
  border-radius: var(--bo-nho);
  border: 1px dashed var(--vien);
}

.download-section h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: var(--s-3);
  color: var(--chu);
}

.download-field {
  margin-bottom: var(--s-4);
}

.download-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: var(--s-2);
  color: var(--chu-mo);
}

.download-field input {
  width: 100%;
  padding: var(--s-3);
  border: 1px solid var(--vien);
  border-radius: var(--bo-nho);
  font-family: var(--font);
  font-size: 14px;
}

.download-buttons {
  display: flex;
  gap: var(--s-3);
  margin-top: var(--s-4);
}

.btn-download {
  flex: 1;
  background-color: var(--tin-cay);
  color: white;
}

.btn-download:hover {
  background-color: #059669;
}

/* Error message */
.error-message {
  padding: var(--s-4);
  background-color: var(--loi-nhat);
  border: 1px solid var(--loi);
  border-radius: var(--bo-nho);
  color: var(--loi);
  margin-bottom: var(--s-4);
  font-size: 14px;
}

/* Responsive */
@media (min-width: 768px) {
  .container {
    padding: var(--s-6);
  }

  .header h1 {
    font-size: 32px;
  }

  .form {
    padding: var(--s-8);
  }

  .radio-group {
    flex-direction: row;
    gap: var(--s-5);
  }

  .radio-label {
    flex: 1;
  }

  .download-buttons {
    flex-direction: row;
  }

  .btn-download {
    flex: 1;
  }
}

@media (min-width: 1440px) {
  .container {
    max-width: 800px;
  }

  .header h1 {
    font-size: 36px;
  }
}

/* Print styles */
@media print {
  .header {
    border-bottom: none;
  }

  .form-actions,
  .download-section {
    display: none;
  }

  .results-section {
    box-shadow: none;
  }
}

/* SVG icon styles */
.icon {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.25em;
  margin-right: 0.5em;
}
