body, input, textarea, button, select {
  font-size: 15px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
html {
  scroll-behavior: auto;
}
body {
  max-width: 720px;
  margin: auto;
  padding: 20px;
  overflow-anchor: none;
}
body.lang_ca .lang_ca {display: block;}
body.lang_ca .lang_es, body.lang_ca .lang_en {display: none;}
body.lang_es .lang_es {display: block;}
body.lang_es .lang_ca, body.lang_es .lang_en {display: none;}
body.lang_en .lang_en {display: block;}
body.lang_en .lang_ca, body.lang_en .lang_es {display: none;}

#top_controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}
#session_controls {
  display: none;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
#session_user {
  display: inline-flex;
  align-items: center;
  font-size: 16px;
  line-height: 1;
  position: relative;
  top: -2px;
}
#logout_button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #3b82f6;
  cursor: pointer;
  line-height: 0;
  position: relative;
  top: -2px;
}
#logout_button:hover {
  color: #2563eb;
}
#logout_button svg {
  width: 20px;
  height: 20px;
  display: block;
}
#set_page_lang {
  display: flex;
  align-items: center;
  gap: 4px;
}
#set_page_lang button {
	border:0;
	padding:0;
	background:#fff;
}
#set_page_lang svg {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}
.inactive {
	opacity: 0.5;
}
.italic {
  font-style: italic;
}
.red {
 color: #990000;
}

.user_message {
  background: #f7f7f8;
  border: 1px solid #ddd;
  border-radius: 14px;
  padding: 12px 16px;
  margin: 12px 0 12px 40px;
  color: #0f172a;
}
.patient_message {
  border: 1px solid #ddd;
  border-radius: 14px;
  padding: 12px 16px;
  margin: 12px 40px 12px 0;
}

.user_assessment {
  background: #f7f7f8;
  border: 1px solid #ddd;
  border-radius: 14px;
  padding: 12px 16px;
  margin: 12px 0 12px 0;
  color: #0f172a;
  white-space: pre-wrap;
}
.supervisor_feedback {
	font-style: italic;
  white-space: pre-wrap;
}


#dots {
  display:none;
}
#dots span {
  opacity: 0;
  animation: blink 1.4s infinite;
}
#dots span:nth-child(1) { animation-delay: 0s; }
#dots span:nth-child(2) { animation-delay: 0.2s; }
#dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  100% { opacity: 0; }
}

#feedback, #questionnaire {
	display:none;
}

#assessment_editor {
  margin: 12px 0 24px 0;
}
#assessment_textarea {
  width: 100%;
  min-height: 120px;
  height: 120px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  box-sizing: border-box;
  outline: none;
  resize: vertical;
  line-height: 1.4;
}
#assessment_submit_button {
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #f3f3f3;
  margin-top: 8px;
  padding: 7px 20px;
  cursor: pointer;
}
#assessment_submit_button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#user_input {
  position: relative;
  margin: 20px 0;
  display:none;
}

#user_input_textarea {
  width: 100%;
  padding: 12px 52px 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  box-sizing: border-box;
  outline: none;
  resize: none;
  line-height: 1.4;
  overflow: hidden;
  flex: 1;
}

#user_input_button {
  display: flex;
  position: absolute;
  right: 4px;
  bottom: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #3b82f6;
  color: white;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, transform .1s ease;
}
#user_input_button:hover {
  background: #2563eb;
}
#user_input_button:active {
  transform: scale(0.95);
}
#user_input_button svg {
  width: 20px;
  height: 20px;
}

#end_chat {
  display:none;
  scroll-margin-bottom: 20px;
}
#set_chat_lang, #set_level, #set_presentation, #start_chat_button, #end_chat_button {
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #f3f3f3;
  margin: auto;
  padding: 5px 20px;
}


#questionnaire {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid #ddd;
}
.questionnaire_item {
  border: 0;
  padding: 0;
  margin: 18px 0;
}
.questionnaire_item legend {
  padding: 0;
  margin-bottom: 8px;
}
.likert_options {
  display: flex;
  gap: 8px;
}
.likert_options label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.likert_scale_labels {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: -6px 0 18px 0;
  font-size: 13px;
  color: #555;
}
#questionnaire_comment_label {
  display: block;
  margin: 18px 0 8px 0;
}
#questionnaire_comment {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.12);
  box-sizing: border-box;
  resize: vertical;
}
#questionnaire_submit {
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #f3f3f3;
  margin-top: 12px;
  padding: 7px 20px;
  cursor: pointer;
}
#questionnaire_submit:disabled {
  opacity: 0.6;
  cursor: default;
}
#questionnaire_status {
  margin-top: 12px;
}

#scroll_anchor {
  height: 1px;
  width: 100%;
}

/* Authentication -------------------------------------------------------- */
.auth_locked #app {
  display: none;
}

#login_panel {
  width: 100%;
  box-sizing: border-box;
  margin: 24px 0;
  padding: 0;
  border: 0;
  background: transparent;
}

#register_page {
  max-width: 520px;
  margin: 24px auto;
  padding: 18px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 14px;
  background: #f7f7f8;
}

#login_panel label,
#register_page label {
  font-weight: 600;
}

.auth_field {
  margin-bottom: 12px;
}

.auth_field input,
#register_form input[type="password"],
#register_form input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  margin-top: 5px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.18);
  background: #fff;
}

.auth_checkbox {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 8px 0 14px;
  font-weight: 400 !important;
}

.auth_checkbox span {
  display: inline;
}

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

.auth_actions button,
#register_form button {
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #f3f3f3;
  padding: 7px 18px;
  cursor: pointer;
}

.auth_help {
  font-size: 0.92em;
}

#login_status {
  min-height: 1.4em;
}

#register_languages {
  text-align: right;
}

#register_languages a {
  margin-left: 8px;
}


@media (max-width: 600px) {
  #assessment_textarea {
    min-height: 160px;
    height: 160px;
  }
}

#site_footer {
  margin-top: 36px;
  padding: 16px 0 4px 0;
  text-align: right;
  font-size: 12px;
  color: #777;
}
