/* Clinical, minimal aesthetic (UK wording in copy; valid CSS syntax) */
body {
  background: linear-gradient(135deg, #e0e7ff 0%, #f1f5f9 100%);
  font-family: "Segoe UI", Arial, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  color: #1e293b;
}

.container {
  max-width: 1200px;
  margin: 40px auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
  padding: 32px 24px;
}

.logo {
  display: block;
  max-width: 300px;
  height: auto;
  margin: 0 auto 24px auto;
}

h1 {
  text-align: left;
  font-size: 2rem;
  margin: 0 0 24px 0;
  color: #1e293b;
}

.client-info {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 200px;
}

.input-group label {
  font-weight: 600;
  color: #374151;
  font-size: 0.95rem;
}

.input-group input {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.95rem;
  color: #374151;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.input-group input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16,185,129,0.1);
}

.input-group input::placeholder {
  color: #9ca3af;
}

.section-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin: 32px 0 16px 0;
  letter-spacing: 0.01em;
  padding-bottom: 8px;
  border-bottom: 2px solid #e0e7ff;
}

/* Item card */
.item-card {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.item-title {
  font-weight: 700;
  margin-bottom: 12px;
  color: #111827;
  font-size: 1rem;
}

.item-code {
  color: #6366f1;
  font-weight: 600;
  margin-right: 4px;
}

/* Table layout for options */
.options-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.options-grid thead th {
  background: #e0e7ff;
  color: #334155;
  font-weight: 600;
  padding: 10px 8px;
  text-align: left;
  font-size: 0.95rem;
}

.options-grid td {
  padding: 10px 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.options-grid tr:nth-child(even) td {
  background: #f8fafc;
}

.score-cell {
  width: 40%;
  vertical-align: top;
}

.criteria-cell {
  width: 60%;
  vertical-align: top;
}

.scores-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.score-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.score-option input[type="radio"] {
  margin: 0;
  cursor: pointer;
}

.score-option label {
  margin: 0;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
}

.criteria-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #374151;
  background: #ffffff;
  resize: vertical;
  display: block;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: pre-wrap;
}

.criteria-textarea:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16,185,129,0.1);
}

.score-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 16px;
  font-size: 0.95rem;
}

.emotion-input {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.95rem;
  color: #374151;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: pre-wrap;
}

.emotion-input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16,185,129,0.1);
}

.emotion-input::placeholder {
  color: #9ca3af;
}

/* Buttons */
.btn-wrap { 
  text-align: center; 
  margin-top: 20px; 
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
  transition: transform 0.05s ease, box-shadow 0.3s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn.grey {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  box-shadow: 0 4px 12px rgba(107,114,128,0.3);
}
.btn.alt {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

/* Modals */
.modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: none;
}

.modal-content {
  background: #fff;
  margin: 2% auto;
  padding: 0;
  border-radius: 16px;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 {
  margin: 0;
  font-size: 1.4rem;
  color: #1e293b;
}
.close {
  color: #6b7280;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}
.close:hover { color: #374151; }
.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  overflow-wrap: break-word;
  word-break: break-word;
}
.modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
}
#report-content {
  white-space: pre-wrap;
  line-height: 1.6;
  color: #374151;
  overflow-wrap: break-word;
  word-break: break-word;
}
#report-content .section-heading {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 24px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e0e7ff;
}
#report-content .section-heading:first-child {
  margin-top: 0;
}

#dsm5-content {
  white-space: pre-wrap;
  line-height: 1.6;
  color: #374151;
  overflow-wrap: break-word;
  word-break: break-word;
}

#dsm5-content .section-heading {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 24px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e0e7ff;
}

#dsm5-content .section-heading:first-child {
  margin-top: 0;
}

/* Loading modal */
.loading-modal-content {
  background: #fff;
  margin: 15% auto;
  padding: 0;
  border-radius: 16px;
  width: 420px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  text-align: center;
}
.loading-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}
.loading-body { padding: 24px; }
.progress-container { margin-bottom: 14px; }
.progress-bar {
  width: 100%;
  height: 12px;
  background: #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 6px;
  width: 0%;
  transition: width 0.3s ease;
}
.progress-percentage {
  font-size: 1.05rem;
  font-weight: 700;
  color: #10b981;
}
.loading-status { color: #6b7280; font-size: 0.95rem; }

.reset-link {
  margin-top: 8px;
  background: none;
  border: none;
  color: #2563eb;
  font-size: 0.85rem;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.reset-link:hover {
  color: #1d4ed8;
}
