/* Reset & base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
}

/* Header */
header {
  background: #4a2d6b;
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.header-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

header h1 {
  font-size: 22px;
  font-weight: 600;
}

/* Main content */
main {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 32px;
  background: #fff;
  min-height: calc(100dvh - 80px);
}

/* Form fields */
.field {
  padding: 16px 20px;
}

.field label {
  display: block;
  font-size: 15px;
  font-weight: 400;
  color: #333;
  margin-bottom: 10px;
}

.field input[type="number"] {
  width: 100px;
  padding: 8px 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #333;
  -moz-appearance: textfield;
}

.field input[type="number"]::-webkit-inner-spin-button,
.field input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.field input[type="number"]:focus {
  outline: none;
  border-color: #4a2d6b;
  box-shadow: 0 0 0 2px rgba(74, 45, 107, 0.2);
}

hr {
  border: none;
  border-top: 1px solid #e8e8e8;
  margin: 0 20px;
}

/* Yes/No toggle buttons */
.toggle-group {
  display: inline-flex;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #ddd;
  background: #f0f0f0;
}

.toggle-btn {
  padding: 8px 24px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: #999;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.toggle-btn + .toggle-btn {
  border-left: 1px solid #ddd;
}

.toggle-btn.selected {
  background: #4a2d6b;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.toggle-btn:active {
  opacity: 0.8;
}

/* Switch toggles */
.switch-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 8px;
}

.switch-row span {
  font-size: 14px;
  color: #555;
  line-height: 1.3;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ccc;
  border-radius: 28px;
  transition: background 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .slider {
  background: #4caf50;
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

/* Action buttons */
.actions {
  display: flex;
  gap: 12px;
  padding: 24px 20px 8px;
}

.btn {
  flex: 1;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn:active {
  opacity: 0.8;
}

.btn-assess {
  background: #4caf50;
  color: #fff;
}

.btn-reset {
  background: #5c7999;
  color: #fff;
}

/* Result area */
.result {
  background: #c62828;
  color: #fff;
  text-align: center;
  padding: 20px;
  margin-top: 8px;
  transition: opacity 0.2s;
}

.result.low-risk {
  background: #2e7d32;
}

.result.hidden {
  display: none;
}

.risk-ratio {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.risk-message {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
}

/* Validation highlight */
.field input.error {
  border-color: #c62828;
  box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.2);
}

/* Disclaimer footer */
.disclaimer {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 20px 32px;
  background: #f5f5f5;
  border-top: 1px solid #e0e0e0;
}

.disclaimer p {
  font-size: 11px;
  color: #888;
  line-height: 1.5;
  margin-bottom: 10px;
}

.disclaimer p:last-child {
  margin-bottom: 0;
}

.disclaimer a {
  color: #666;
  text-decoration: underline;
}
