/* ============================================
   Verify MC — Add Patient — Custom Styles
   ============================================ */

/* Base */
* { box-sizing: border-box; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* Scrollbar */
#chat-messages::-webkit-scrollbar,
#record-panel::-webkit-scrollbar,
#manual-layout::-webkit-scrollbar {
  width: 5px;
}
#chat-messages::-webkit-scrollbar-track,
#record-panel::-webkit-scrollbar-track,
#manual-layout::-webkit-scrollbar-track {
  background: transparent;
}
#chat-messages::-webkit-scrollbar-thumb,
#record-panel::-webkit-scrollbar-thumb,
#manual-layout::-webkit-scrollbar-thumb {
  background: #E5E7EB;
  border-radius: 10px;
}
#chat-messages::-webkit-scrollbar-thumb:hover,
#record-panel::-webkit-scrollbar-thumb:hover {
  background: #CBD5E1;
}

/* Icon Rail */
.rail-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  color: #94A3B8;
  transition: all 150ms ease;
  border: none; background: none; cursor: pointer;
}
.rail-icon:hover { background: #F1F5F9; color: #64748B; }
.rail-icon.active { background: #E6F5F4; color: #0C8F8B; }

/* Ghost Button */
.ghost-btn {
  background: transparent;
  color: #64748B;
  border: none;
  cursor: pointer;
  transition: all 150ms ease;
  display: inline-flex;
  align-items: center;
  font-family: inherit;
}
.ghost-btn:hover { color: #0F172A; background: #F1F5F9; }

/* Primary Button */
.primary-btn {
  background: #0C8F8B;
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  transition: all 150ms ease;
  font-family: inherit;
}
.primary-btn:hover { background: #0A7F7B; }
.primary-btn:disabled { background: #CBD5E1; cursor: not-allowed; }

/* Secondary Button */
.secondary-btn {
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid #E5E7EB;
  cursor: pointer;
  transition: all 150ms ease;
  font-family: inherit;
}
.secondary-btn:hover { background: #F8FAFC; border-color: #CBD5E1; }

/* Field Row */
.field-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #F1F5F9;
}
.field-row:last-child { border-bottom: none; }
.field-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94A3B8;
  white-space: nowrap;
  flex-shrink: 0;
}
.field-value {
  font-size: 13px;
  color: #0F172A;
  text-align: right;
  word-break: break-word;
  line-height: 1.4;
}
.field-value.waiting {
  color: #CBD5E1;
  font-style: italic;
}
.field-value.skipped {
  color: #CBD5E1;
}
.field-value .check-icon {
  display: inline-flex;
  margin-left: 4px;
  vertical-align: middle;
  color: #10B981;
}

/* Manual Form */
.manual-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94A3B8;
  margin-bottom: 6px;
}
.manual-input {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: #0F172A;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.manual-input:focus {
  border-color: rgba(12,143,139,0.4);
  box-shadow: 0 0 0 2px rgba(12,143,139,0.08);
}
.manual-input::placeholder { color: #CBD5E1; }

/* One-Sentence Engine */
#one-sentence-engine {
  animation: msgIn 0.16s ease-out both;
}
#one-sentence-engine.processed {
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 120ms ease;
}
#one-sentence-engine.processed input {
  background: #F8FAFC;
}

/* Assistant Bubble Width Constraint */
.assistant-bubble {
  max-width: 680px;
  width: 100%;
}

/* Field Update Animation */
.field-value {
  transition: all 120ms ease-out;
}
.field-value.updated {
  animation: fieldUpdate 0.16s ease-out;
}
@keyframes fieldUpdate {
  0% { opacity: 0.6; transform: translateX(-2px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* Progress Bar Smooth Animation */
#progress-bar {
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Chip Press Feedback */
.chip-option:active {
  transform: scale(0.96);
  transition: transform 0.08s ease;
}

/* Condition Card Press Feedback */
.condition-card:active {
  transform: scale(0.97);
  transition: transform 0.08s ease;
}

/* User Bubble Slide In */
.user-bubble {
  animation: slideIn 0.16s ease-out;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(4px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Quick Option Press */
.quick-option:active {
  transform: scale(0.95);
  transition: transform 0.08s ease;
}

/* Input Focus Transition */
input, select, textarea {
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .chat-msg, .user-bubble, .field-value, #progress-bar {
    animation: none;
    transition: none;
  }
}

/* Chat Messages */
.chat-msg {
  animation: msgIn 0.22s ease-out both;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Assistant Message */
.assistant-bubble {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  border-top-left-radius: 4px;
  padding: 14px 16px;
  max-width: 92%;
}
.assistant-bubble p {
  font-size: 15px;
  line-height: 1.55;
  color: #0F172A;
}
.assistant-bubble .helper-text {
  font-size: 12px;
  color: #94A3B8;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* User Response */
.user-bubble {
  background: #0C8F8B;
  color: #FFFFFF;
  border-radius: 16px;
  border-bottom-right-radius: 4px;
  padding: 10px 16px;
  max-width: 75%;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  margin-left: auto;
}

/* Chip Options */
.chip-option {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 500;
  color: #0F172A;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 100px;
  cursor: pointer;
  transition: all 150ms ease;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.chip-option:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}
.chip-option.selected {
  background: #E6F5F4;
  border-color: #0C8F8B;
  color: #0C8F8B;
}

/* Quick Option (composer area) */
.quick-option {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #64748B;
  background: #F8FAFC;
  border: 1px solid #E5E7EB;
  border-radius: 100px;
  cursor: pointer;
  transition: all 150ms ease;
  font-family: 'Inter', sans-serif;
}
.quick-option:hover {
  background: #F1F5F9;
  color: #0F172A;
  border-color: #CBD5E1;
}

/* Condition Cards */
.condition-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #0F172A;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  cursor: pointer;
  transition: all 150ms ease;
  text-align: center;
  font-family: 'Inter', sans-serif;
  line-height: 1.3;
  min-height: 42px;
}
.condition-card:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}
.condition-card.selected {
  background: #E6F5F4;
  border-color: #0C8F8B;
  color: #0C8F8B;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  border-top-left-radius: 4px;
  width: fit-content;
}
.typing-indicator span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #CBD5E1;
  animation: typingDot 1.4s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

/* Pulse subtle for live badge */
.animate-pulse-subtle {
  animation: pulseSubtle 2s ease-in-out infinite;
}
@keyframes pulseSubtle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Review Card */
.review-card {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  padding: 20px;
}
.review-section {
  margin-bottom: 16px;
}
.review-section:last-child { margin-bottom: 0; }
.review-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94A3B8;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #F1F5F9;
}
.review-field {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  font-size: 13px;
}
.review-field-label {
  color: #64748B;
  font-weight: 500;
}
.review-field-value {
  color: #0F172A;
  font-weight: 500;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}
.review-field-value.empty {
  color: #CBD5E1;
  font-style: italic;
}
.review-edit-link {
  font-size: 11px;
  font-weight: 500;
  color: #0C8F8B;
  cursor: pointer;
  text-decoration: none;
  transition: color 150ms;
}
.review-edit-link:hover { color: #0A7F7B; text-decoration: underline; }

/* Success State */
.success-state {
  text-align: center;
  padding: 32px 20px;
}
.success-check {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #E6F5F4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  animation: scaleIn 0.3s ease-out;
}
@keyframes scaleIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Mobile Bottom Nav */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 56px;
  background: #FFFFFF;
  border-top: 1px solid #E5E7EB;
  z-index: 35;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
}
@media (max-width: 767px) {
  .mobile-bottom-nav { display: flex; }
  body { padding-bottom: 56px; }
}

/* Responsive */
@media (max-width: 767px) {
  .icon-rail { display: none !important; }
  #composer-area {
    position: sticky;
    bottom: 56px;
    background: #F8FAFC;
    z-index: 10;
    padding-top: 12px;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
}