/* Shield Chat UI - Professional verification style */

:root {
  --shield-bg-soft: #f7f9ff;
  --shield-bg-strong: #eef3ff;
  --shield-border: #d7e1f7;
  --shield-ink: #16213a;
  --shield-muted: #4a5879;
  --shield-accent: #1e40af;
  --shield-accent-strong: #1e3a8a;
  --shield-bubble-user: #1e40af;
  --shield-bubble-agent: #ffffff;
  --shield-shadow: 0 16px 36px rgba(17, 34, 79, 0.12);
}

.shield-chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: linear-gradient(180deg, var(--shield-bg-soft) 0%, #ffffff 22%);
  border-radius: 16px;
  border: 1px solid var(--shield-border);
  overflow: hidden;
  box-shadow: var(--shield-shadow);
}

/* Header */
.shield-chat-header {
  padding: 18px;
  border-bottom: 1px solid var(--shield-border);
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 65%, #1e3a8a 100%);
  color: white;
}

.shield-chat-header__title {
  font-size: 1.06rem;
  font-weight: 700;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.shield-chat-header__icon {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
}

.shield-chat-header__subtitle {
  font-size: 0.86rem;
  opacity: 0.95;
}

/* Messages */
.shield-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, #f8faff 0%, #fbfcff 60%, #ffffff 100%);
}

.shield-chat-message {
  display: flex;
  gap: 8px;
  max-width: 85%;
  animation: slideIn 0.35s ease-out;
}

.shield-chat-message.shield-chat-message--lead {
  align-self: flex-end;
  max-width: 85%;
}

.shield-chat-message.shield-chat-message--shield {
  align-self: flex-start;
}

.shield-chat-message__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 600;
  flex-shrink: 0;
}

.shield-chat-message--lead .shield-chat-message__avatar {
  background: #dbeafe;
  color: #1e3a8a;
  order: 2;
}

.shield-chat-message--shield .shield-chat-message__avatar {
  background: #e0e7ff;
  color: #3730a3;
}

.shield-chat-message__content {
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 0.94rem;
  line-height: 1.45;
  word-wrap: break-word;
}

.shield-chat-message--lead .shield-chat-message__content {
  background: var(--shield-bubble-user);
  color: white;
  border-bottom-right-radius: 4px;
}

.shield-chat-message--shield .shield-chat-message__content {
  background: var(--shield-bubble-agent);
  color: #1f2d4f;
  border-bottom-left-radius: 4px;
  border: 1px solid #dbe4f5;
  box-shadow: 0 4px 14px rgba(20, 45, 90, 0.05);
}

.shield-chat-message.shield-chat-message--typing .shield-chat-message__content {
  padding: 10px 12px;
}

.shield-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.shield-typing i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8ea8e8;
  animation: shieldDot 0.9s infinite ease-in-out;
}

.shield-typing i:nth-child(2) {
  animation-delay: 0.1s;
}

.shield-typing i:nth-child(3) {
  animation-delay: 0.2s;
}

.shield-quick-prompts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 2px 0 4px 38px;
  padding: 12px;
  border: 1px solid #d3def7;
  border-radius: 16px;
  background: linear-gradient(165deg, #f8fbff 0%, #eef4ff 55%, #e8f0ff 100%);
  box-shadow:
    0 10px 22px rgba(29, 78, 216, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.shield-quick-prompts__label {
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3559b5;
  margin: 0 2px 2px;
}

.shield-quick-prompts__item {
  position: relative;
  text-align: left;
  border: 1px solid #bed0fc;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  color: #1d305f;
  border-radius: 12px;
  padding: 10px 12px 10px 30px;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
  box-shadow: 0 3px 9px rgba(30, 64, 175, 0.1);
}

.shield-quick-prompts__item::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: radial-gradient(
    circle at 30% 30%,
    #7ba2ff 0%,
    #355fd8 70%,
    #244aa8 100%
  );
}

.shield-quick-prompts__item:hover {
  border-color: #7f9ff0;
  background: linear-gradient(180deg, #ffffff 0%, #ebf2ff 100%);
  box-shadow: 0 10px 22px rgba(30, 64, 175, 0.16);
  transform: translateY(-1px);
}

.shield-quick-prompts__item:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.12);
}

.shield-quick-prompts__item:focus-visible {
  outline: none;
  border-color: #4b77eb;
  box-shadow: 0 0 0 3px rgba(75, 119, 235, 0.2);
}

@media (min-width: 760px) {
  .shield-quick-prompts {
    grid-template-columns: 1fr 1fr;
  }

  .shield-quick-prompts__label {
    grid-column: 1 / -1;
  }

  .shield-quick-prompts__item:last-child {
    grid-column: 1 / -1;
  }
}

/* Input */
.shield-chat-input {
  padding: 12px 14px;
  border-top: 1px solid var(--shield-border);
  display: flex;
  gap: 8px;
  background: var(--shield-bg-strong);
}

.shield-chat-input__field {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #cad6f2;
  border-radius: 9px;
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color 0.2s;
  background: white;
}

.shield-chat-input__field:focus {
  outline: none;
  border-color: var(--shield-accent);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.14);
}

.shield-chat-input__field:disabled {
  background: #f1f4fb;
  color: #9ca3af;
  cursor: not-allowed;
}

.shield-chat-input__send {
  padding: 10px 15px;
  background: var(--shield-accent);
  color: white;
  border: none;
  border-radius: 9px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.shield-chat-input__send:hover:not(:disabled) {
  background: var(--shield-accent-strong);
}

.shield-chat-input__send:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* Loading / Status */
.shield-chat-status {
  padding: 12px 16px;
  background: #f6faf7;
  border-top: 1px solid var(--shield-border);
  font-size: 0.85rem;
  color: var(--shield-muted);
  text-align: center;
}

.shield-chat-status__spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #d1d5db;
  border-top-color: var(--shield-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Gate Display */
.shield-gate-options {
  padding: 16px;
  border-top: 1px solid var(--shield-border);
  background: #f8faff;
}

.shield-gate-options__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #20325f;
  margin: 0 0 12px 0;
}

.shield-gate-options__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.shield-gate-option {
  padding: 12px;
  border: 1px solid #d2ddf7;
  border-radius: 10px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.shield-gate-option:hover {
  border-color: #9ab3eb;
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.08);
}

.shield-gate-option__title {
  font-weight: 600;
  color: #1f3b84;
  font-size: 0.95rem;
}

.shield-gate-option__desc {
  font-size: 0.85rem;
  color: #4a5879;
  margin-top: 2px;
}

/* Bridge Display */
.shield-bridge-display {
  padding: 16px;
  border-top: 1px solid #c8d8f8;
  background: #eff4ff;
}

.shield-bridge-display__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e3a8a;
  margin: 0 0 12px 0;
}

.shield-bridge-number {
  padding: 12px;
  background: white;
  border: 1px solid #c3d7ff;
  border-radius: 10px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}

.shield-bridge-number:hover {
  box-shadow: 0 6px 16px rgba(30, 64, 175, 0.14);
}

.shield-bridge-hint {
  font-size: 0.85rem;
  color: #4a5879;
  margin-top: 8px;
  text-align: center;
}

.shield-value-stack {
  margin: 6px 0 8px 38px;
  padding: 14px;
  border: 1px solid #c5d5ff;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
  box-shadow: 0 8px 20px rgba(30, 64, 175, 0.12);
  display: grid;
  gap: 10px;
}

.shield-value-stack__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1d3d8f;
}

.shield-value-stack__copy {
  font-size: 0.86rem;
  color: #45577f;
  line-height: 1.45;
}

.shield-value-stack__cta {
  border: none;
  border-radius: 10px;
  padding: 11px 14px;
  background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.shield-value-stack__cta:hover:not(:disabled) {
  filter: brightness(0.96);
}

.shield-value-stack__cta:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.shield-inline-error {
  font-size: 0.82rem;
  color: #b91c1c;
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes shieldDot {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: scale(0.9);
  }
  40% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* Responsive */
@media (max-width: 640px) {
  .shield-chat-container {
    max-height: 84vh;
    border-radius: 14px;
  }

  .shield-chat-message {
    max-width: 95%;
  }

  .shield-chat-message.shield-chat-message--lead {
    max-width: 95%;
  }

  .shield-quick-prompts {
    margin-left: 0;
    padding: 8px;
    border-radius: 12px;
  }

  .shield-value-stack {
    margin-left: 0;
    padding: 12px;
  }

  .shield-quick-prompts__label {
    font-size: 0.69rem;
  }

  .shield-quick-prompts__item {
    font-size: 0.82rem;
    padding: 9px 11px 9px 28px;
  }
}
