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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #F5F7FA;
  color: #1a1a1a;
  line-height: 1.5;
  min-height: 100vh;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.header {
  text-align: center;
  margin-bottom: 32px;
}

.header h1 {
  font-size: 24px;
  font-weight: 700;
  color: #1565C0;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 14px;
  color: #666;
}

.section {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.section h2 {
  font-size: 16px;
  font-weight: 600;
  color: #1565C0;
  margin-bottom: 16px;
}

.field {
  margin-bottom: 16px;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #444;
  margin-bottom: 6px;
}

.field input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  background: #F5F7FA;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input[type="text"]:focus {
  outline: none;
  border-color: #1565C0;
  box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
}

.field input[type="text"].error {
  border-color: #d32f2f;
  box-shadow: 0 0 0 3px rgba(211,47,47,0.1);
}

.medicacoes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.med-item {
  background: #F5F7FA;
  border-radius: 8px;
  padding: 14px 16px;
  transition: background 0.2s;
}

.med-item:has(input:checked) {
  background: #e3f2fd;
}

.med-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.med-header input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #1565C0;
  cursor: pointer;
}

.med-header label {
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  flex: 1;
}

.med-olho {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ddd;
}

.med-item:has(input:checked) .med-olho {
  display: flex;
  gap: 16px;
  align-items: center;
}

.olho-group {
  display: flex;
  gap: 12px;
}

.olho-option {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.olho-option input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: #1565C0;
  cursor: pointer;
}

.olho-option label {
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.olho-error {
  display: none;
  font-size: 12px;
  color: #d32f2f;
  margin-left: auto;
}

.olho-error.visible {
  display: block;
}

.btn-primary {
  width: 100%;
  height: 48px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: #1565C0;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s, opacity 0.2s;
  margin-top: 8px;
}

.btn-primary:hover {
  background: #1253a0;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.hidden {
  display: none !important;
}

.feedback {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.feedback.success {
  background: #e8f5e9;
  color: #2e7d32;
}

.feedback.error {
  background: #ffebee;
  color: #c62828;
}

@media (max-width: 480px) {
  .container {
    padding: 20px 16px 48px;
  }

  .section {
    padding: 18px 16px;
  }

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