/*
 * Self-contained styles for the Sales Chat modal on renotechtools.com.
 * Kept separate from assets/styles.css because styles.css is precompiled Tailwind
 * and would purge classes injected dynamically by sales-chat.js.
 */

.sc-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

@media (min-width: 640px) {
  .sc-overlay {
    align-items: center;
  }
}

.sc-overlay.sc-open {
  opacity: 1;
  pointer-events: auto;
}

.sc-dialog {
  width: 100%;
  max-width: 28rem;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  overflow: hidden;
  transform: translateY(8px);
  transition: transform 0.16s ease;
}

.sc-overlay.sc-open .sc-dialog {
  transform: translateY(0);
}

.sc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.sc-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #2563eb;
}

.sc-title {
  margin: 0.125rem 0 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
}

.sc-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #64748b;
}

.sc-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #475569;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.sc-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.sc-body {
  padding: 1rem;
}

.sc-step {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sc-hidden {
  display: none !important;
}

.sc-copy {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #475569;
}

.sc-copy strong {
  color: #0f172a;
  font-weight: 600;
}

.sc-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sc-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.sc-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
}

.sc-label {
  font-weight: 500;
  color: #1e293b;
}

.sc-label-alt {
  font-size: 0.75rem;
  color: #64748b;
}

.sc-input,
.sc-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: #0f172a;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sc-input:focus,
.sc-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.sc-input-otp {
  letter-spacing: 0.25em;
  font-variant-numeric: tabular-nums;
}

.sc-textarea {
  resize: vertical;
  min-height: 4rem;
}

.sc-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sc-link-btn {
  border: none;
  background: transparent;
  padding: 0.25rem 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: #2563eb;
  text-decoration: underline;
  cursor: pointer;
}

.sc-link-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sc-primary-btn {
  width: 100%;
  border: none;
  border-radius: 0.5rem;
  padding: 0.7rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #ffffff;
  background: #2563eb;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.sc-primary-btn:hover:not(:disabled) {
  background: #1d4ed8;
}

.sc-primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sc-error {
  margin: 0;
  font-size: 0.75rem;
  color: #dc2626;
}

.sc-status {
  margin: 0;
  font-size: 0.75rem;
  color: #15803d;
}

.sc-connected-box {
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #f8fafc;
  padding: 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #334155;
}

.sc-connected-title {
  margin: 0 0 0.25rem;
  font-weight: 600;
  color: #0f172a;
}

.sc-connected-box p:last-child {
  margin: 0;
}

.sc-messages {
  max-height: 16rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding-right: 0.25rem;
}

.sc-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

.sc-msg-support {
  align-self: flex-start;
}

.sc-msg-visitor {
  align-self: flex-end;
  align-items: flex-end;
}

.sc-msg-meta {
  font-size: 0.6875rem;
  color: #64748b;
  margin-bottom: 0.2rem;
}

.sc-bubble {
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.sc-msg-support .sc-bubble {
  background: #f1f5f9;
  color: #0f172a;
  border-bottom-left-radius: 0.2rem;
}

.sc-msg-visitor .sc-bubble {
  background: #2563eb;
  color: #ffffff;
  border-bottom-right-radius: 0.2rem;
}

.sc-launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  border-radius: 9999px;
  padding: 0.7rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: #2563eb;
  box-shadow: 0 12px 24px -6px rgba(37, 99, 235, 0.45);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.sc-launcher:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.sc-launcher-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  background: #4ade80;
  flex-shrink: 0;
}
