/* Widget flotante GTCargas Assistant */
.gtcb-root {
  --gtcb-primary: #128C7E;
  --gtcb-primary-dark: #0d6b61;
  --gtcb-bg: #ffffff;
  --gtcb-text: #1f2937;
  --gtcb-muted: #6b7280;
  --gtcb-border: #e5e7eb;
  --gtcb-radius: 14px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  z-index: 99990;
}

.gtcb-launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--gtcb-primary), #25d366);
  color: #fff;
  box-shadow: 0 10px 25px rgba(18, 140, 126, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gtcb-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(18, 140, 126, 0.45);
}

.gtcb-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.5rem;
  width: min(100vw - 2rem, 400px);
  max-height: min(560px, calc(100vh - 7rem));
  background: var(--gtcb-bg);
  border-radius: var(--gtcb-radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--gtcb-border);
}

.gtcb-panel[hidden] {
  display: none !important;
}

.gtcb-header {
  background: linear-gradient(135deg, var(--gtcb-primary), #1a9d8c);
  color: #fff;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.gtcb-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.gtcb-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gtcb-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #f9fafb;
}

.gtcb-step {
  background: #fff;
  border: 1px solid var(--gtcb-border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.gtcb-step h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--gtcb-text);
}

.gtcb-role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.gtcb-role-btn {
  padding: 0.65rem;
  border-radius: 10px;
  border: 2px solid var(--gtcb-border);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  color: var(--gtcb-text);
  transition: border-color 0.15s, background 0.15s;
}

.gtcb-role-btn:hover,
.gtcb-role-btn.is-active {
  border-color: var(--gtcb-primary);
  background: rgba(18, 140, 126, 0.06);
}

.gtcb-field {
  margin-bottom: 0.65rem;
}

.gtcb-field label {
  display: block;
  font-size: 0.8rem;
  color: var(--gtcb-muted);
  margin-bottom: 0.25rem;
}

.gtcb-field input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--gtcb-border);
  border-radius: 8px;
  box-sizing: border-box;
}

.gtcb-btn-primary {
  width: 100%;
  padding: 0.6rem;
  border: none;
  border-radius: 10px;
  background: var(--gtcb-primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.25rem;
}

.gtcb-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.gtcb-msg {
  max-width: 92%;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  margin-bottom: 0.5rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.gtcb-msg.bot {
  background: #fff;
  border: 1px solid var(--gtcb-border);
  align-self: flex-start;
}

.gtcb-msg.user {
  background: rgba(18, 140, 126, 0.12);
  border: 1px solid rgba(18, 140, 126, 0.25);
  margin-left: auto;
}

.gtcb-msgs {
  display: flex;
  flex-direction: column;
  min-height: 120px;
}

.gtcb-compose {
  padding: 0.65rem 0.85rem;
  border-top: 1px solid var(--gtcb-border);
  background: #fff;
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.gtcb-compose textarea {
  flex: 1;
  min-height: 40px;
  max-height: 100px;
  resize: vertical;
  border: 1px solid var(--gtcb-border);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  font-family: inherit;
  font-size: 0.9rem;
}

.gtcb-compose button {
  border: none;
  background: var(--gtcb-primary);
  color: #fff;
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  font-weight: 600;
}

.gtcb-feedback {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
  align-items: center;
}

.gtcb-feedback button {
  border: 1px solid var(--gtcb-border);
  background: #fff;
  border-radius: 8px;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
  font-size: 1rem;
}

.gtcb-feedback button:hover {
  background: #f3f4f6;
}

.gtcb-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.gtcb-quick button {
  border: 1px solid var(--gtcb-border);
  background: #fff;
  color: var(--gtcb-text);
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.gtcb-quick button:hover {
  border-color: var(--gtcb-primary);
  background: rgba(18, 140, 126, 0.06);
}

.gtcb-hint {
  font-size: 0.75rem;
  color: var(--gtcb-muted);
  margin-top: 0.35rem;
}

.gtcb-welcome {
  margin: 0 0 0.85rem;
  line-height: 1.45;
  color: var(--gtcb-text);
  font-size: 0.95rem;
}

.gtcb-role-msg {
  margin: 0 0 0.75rem;
  line-height: 1.45;
  color: var(--gtcb-text);
  font-size: 0.9rem;
}

.gtcb-wait {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  color: var(--gtcb-primary);
  font-style: italic;
}

.gtcb-error {
  color: #b91c1c;
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

@media (max-width: 480px) {
  .gtcb-panel {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    bottom: 5rem;
  }
}
