/* ==========================================================================
   MODULE: HÒM THƯ TƯ VẤN ẨN DANH 2 CHIỀU (#tab-anonymous)
   ========================================================================== */

#tab-anonymous {
  padding-top: 50px !important;
  padding-bottom: 80px;
}

.anon-container {
  max-width: 960px;
  margin: 0 auto;
}

.anon-page-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 32px;
}

.anon-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}

/* Nav Switcher */
.anon-nav-switcher {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.anon-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.anon-tab-btn:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #0F172A;
}

.anon-tab-btn.is-active {
  background: #059669;
  border-color: #059669;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}

/* Card Panel */
.anon-card-panel {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 24px;
  padding: 36px 40px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.05);
}

/* Shield Banner */
.anon-shield-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 28px;
}

.shield-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.shield-text {
  font-size: 13.5px;
  color: #166534;
  line-height: 1.6;
}

/* Form Grid */
.anon-form-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 14px;
  font-weight: 700;
  color: #1E293B;
}

.req-star {
  color: #E11D48;
}

/* Category Grid */
.anon-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.anon-cat-item input[type="radio"] {
  display: none;
}

.cat-pill {
  display: block;
  padding: 11px 14px;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.anon-cat-item input[type="radio"]:checked + .cat-pill {
  background: #ECFDF5;
  border-color: #059669;
  color: #065F46;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.15);
}

.form-input, .form-textarea {
  width: 100%;
  padding: 13px 16px;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  font-size: 14.5px;
  color: #0F172A;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus, .form-textarea:focus {
  border-color: #059669;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.form-hint {
  font-size: 12.5px;
  color: #64748B;
  font-style: italic;
}

/* Urgency row */
.urgency-row {
  display: flex;
  gap: 16px;
}

.urgency-radio input {
  display: none;
}

.urgency-label {
  display: block;
  padding: 10px 16px;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.urgency-radio input:checked + .label-normal {
  background: #F0FDF4;
  border-color: #16A34A;
  color: #166534;
}

.urgency-radio input:checked + .label-urgent {
  background: #FFF1F2;
  border-color: #E11D48;
  color: #9F1239;
  font-weight: 700;
}

.btn-submit-anon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 32px;
  background: #059669;
  color: #FFFFFF;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.35);
}

.btn-submit-anon:hover {
  background: #047857;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.45);
}

/* Receipt Card (Biên lai bí mật) */
.anon-receipt-card {
  text-align: center;
  padding: 20px 0;
}

.receipt-icon {
  font-size: 50px;
  margin-bottom: 12px;
}

.receipt-title {
  font-size: 22px;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 8px;
}

.receipt-desc {
  font-size: 14px;
  color: #64748B;
  max-width: 600px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.receipt-keys-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 620px;
  margin: 0 auto 32px;
}

.key-box {
  background: #F8FAFC;
  border: 2px dashed #CBD5E1;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.key-box.highlight-pin {
  border-color: #059669;
  background: #F0FDF4;
}

.key-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #64748B;
}

.key-box.highlight-pin .key-label {
  color: #059669;
}

.key-value {
  font-size: 24px;
  font-weight: 900;
  color: #0F172A;
  font-family: monospace;
  letter-spacing: 1px;
}

.btn-copy-key {
  padding: 6px 14px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy-key:hover {
  background: #0F172A;
  color: #FFFFFF;
  border-color: #0F172A;
}

/* QR Code Section */
.receipt-qr-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: #F8FAFC;
  border-radius: 20px;
  padding: 24px 30px;
  max-width: 620px;
  margin: 0 auto 30px;
  border: 1px solid #E2E8F0;
}

#receiptQrCanvas {
  background: #FFFFFF;
  border: 4px solid #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.qr-info-side {
  text-align: left;
}

.qr-info-side h4 {
  font-size: 16px;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 6px;
}

.qr-info-side p {
  font-size: 13px;
  color: #64748B;
  line-height: 1.5;
  margin-bottom: 14px;
}

.btn-download-qr {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #0F172A;
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-download-qr:hover {
  background: #334155;
  transform: translateY(-1px);
}

.btn-open-dialogue {
  padding: 14px 28px;
  background: #059669;
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-open-dialogue:hover {
  background: #047857;
  transform: translateY(-2px);
}

/* VIEW B: LOOKUP & CONVERSATION */
.lookup-heading {
  font-size: 19px;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 6px;
}

.lookup-sub {
  font-size: 14px;
  color: #64748B;
  margin-bottom: 24px;
}

.lookup-inputs-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.lookup-inputs-row .input-col {
  flex: 1;
}

.btn-do-lookup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  background: #059669;
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-do-lookup:hover {
  background: #047857;
}

.lookup-error-msg {
  padding: 12px 16px;
  background: #FEE2E2;
  border: 1px solid #FCA5A5;
  border-radius: 10px;
  font-size: 13px;
  color: #B91C1C;
  font-weight: 600;
}

/* Conversation Area */
.anon-conversation-area {
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  overflow: hidden;
  background: #FFFFFF;
  margin-top: 10px;
}

.convo-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}

.convo-title {
  font-size: 16px;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 4px;
}

.convo-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.convo-badge {
  background: #EFF6FF;
  color: #1D4ED8;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.convo-cat {
  color: #64748B;
  font-weight: 600;
}

.convo-status {
  background: #DCFCE7;
  color: #15803D;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.btn-close-convo {
  background: none;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
}

.btn-close-convo:hover {
  background: #F1F5F9;
}

.convo-messages-stream {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 480px;
  overflow-y: auto;
  background: #FAFCFF;
}

.convo-msg {
  padding: 16px 20px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  max-width: 80%;
}

.convo-msg.user {
  align-self: flex-end;
  background: #059669;
  color: #FFFFFF;
  border-top-right-radius: 4px;
}

.convo-msg.ai, .convo-msg.expert {
  align-self: flex-start;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  color: #1E293B;
  border-top-left-radius: 4px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.convo-msg-author {
  font-size: 11.5px;
  font-weight: 800;
  margin-bottom: 4px;
}

.convo-msg.user .convo-msg-author {
  color: #A7F3D0;
}

.convo-msg.ai .convo-msg-author {
  color: #2563EB;
}

.convo-msg.expert .convo-msg-author {
  color: #D97706;
}

.convo-reply-bar {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
}

.convo-reply-input {
  flex-grow: 1;
  padding: 10px 14px;
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
}

.convo-reply-input:focus {
  border-color: #059669;
  background: #FFFFFF;
}

.btn-send-reply {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  background: #059669;
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-send-reply:hover {
  background: #047857;
}

@media (max-width: 768px) {
  .anon-card-panel {
    padding: 24px 18px;
  }
  .receipt-keys-grid {
    grid-template-columns: 1fr;
  }
  .receipt-qr-wrap {
    flex-direction: column;
    text-align: center;
  }
  .lookup-inputs-row {
    flex-direction: column;
    align-items: stretch;
  }
}
