/* Helmer Workspace Legal & Compliance Stylesheet */
:root {
  color-scheme: light;
  --bg-page: #f8f9fb;
  --bg-card: #ffffff;
  --bg-soft: #f1f3f6;
  --bg-accent-soft: #eef2ff;
  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --primary: #4f6ee8;
  --primary-hover: #3b5bdb;
  --accent-blue-border: #c7d2fe;
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 12px;
  --shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.legal-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 24px;
}

.legal-header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.legal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.legal-brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}

.legal-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.legal-nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.legal-nav-link:hover {
  color: var(--primary);
}

.legal-nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2px 3px;
  gap: 2px;
}

.lang-btn {
  background: none;
  border: none;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 16px;
  color: var(--text-light);
  transition: all 0.15s ease;
}

.lang-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Main Container */
.legal-container {
  max-width: 860px;
  margin: 40px auto 60px;
  padding: 0 20px;
}

.legal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px 48px;
}

/* Headings & Document Meta */
.legal-title-section {
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
}

.legal-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  background: var(--bg-accent-soft);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.legal-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 10px;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 13.5px;
  color: var(--text-light);
}

.legal-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Legal Metadata Table */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 24px;
  font-size: 14px;
}

.legal-table th,
.legal-table td {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  text-align: left;
  line-height: 1.5;
}

.legal-table th {
  background: var(--bg-soft);
  font-weight: 600;
  color: var(--text-main);
  width: 38%;
}

.legal-table td {
  color: var(--text-muted);
}

/* Highlight / Compliance Alert Box */
.legal-highlight-box {
  background: var(--bg-accent-soft);
  border: 1px solid var(--accent-blue-border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 24px 0;
  color: #1e293b;
  font-size: 14.5px;
  line-height: 1.6;
}

.legal-highlight-box strong {
  display: block;
  font-size: 15px;
  color: var(--primary);
  margin-bottom: 6px;
}

/* Content Sections */
.legal-content {
  color: var(--text-muted);
}

.legal-content h2,
.legal-content h3 {
  color: var(--text-main);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.4;
  margin-top: 32px;
  margin-bottom: 12px;
}

.legal-content p {
  margin-bottom: 14px;
}

.legal-content p:last-child {
  margin-bottom: 0;
}

.legal-content strong {
  color: var(--text-main);
}

.legal-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.legal-content a:hover {
  color: var(--primary-hover);
}

.legal-content ul,
.legal-content ol {
  margin: 12px 0 16px 24px;
}

.legal-content li {
  margin-bottom: 8px;
}

.legal-doc-section {
  margin-bottom: 24px;
}

.legal-doc-note {
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px 20px;
  margin-top: 28px;
  font-size: 13.5px;
}

.legal-doc-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-main);
}

.legal-doc-precedence {
  background: var(--bg-soft);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  padding: 14px 18px;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-light);
}

/* Footer */
.legal-footer {
  border-top: 1px solid var(--border-color);
  background: #ffffff;
  padding: 32px 24px;
  font-size: 13.5px;
  color: var(--text-light);
  text-align: center;
}

.legal-footer-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.legal-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.legal-footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

.legal-footer-links a:hover {
  color: var(--primary);
}

@media (max-width: 640px) {
  .legal-card {
    padding: 24px 20px;
  }
  .legal-title {
    font-size: 24px;
  }
  .legal-header {
    padding: 12px 16px;
  }
  .legal-header-inner {
    flex-wrap: wrap;
  }
}

/* ==========================================================================
   Support Chat Bubble (Minimalist & Premium Floating Action)
   ========================================================================== */

.support-chat-widget {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 95;
  display: flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.support-chat-widget:hover {
  transform: translateY(-2px);
}

.support-chat-bubble {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 9999px;
  background: #0b1f3a;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px -4px rgba(11, 31, 58, 0.3), 0 4px 10px -2px rgba(11, 31, 58, 0.18);
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.support-chat-widget:hover .support-chat-bubble {
  background: #132d52;
  box-shadow: 0 14px 32px -4px rgba(11, 31, 58, 0.38), 0 6px 14px -2px rgba(11, 31, 58, 0.22);
  transform: scale(1.04);
}

.support-chat-widget:active .support-chat-bubble {
  transform: scale(0.96);
}

.support-chat-icon {
  width: 22px;
  height: 22px;
  transition: transform 200ms ease;
}

.support-chat-widget:hover .support-chat-icon {
  transform: scale(1.05);
}

.support-chat-status-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3);
}

/* Tooltip speech bubble */
.support-chat-tooltip {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.1), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
  color: #0f172a;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 550;
  letter-spacing: -0.01em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 180ms cubic-bezier(0.16, 1, 0.3, 1),
              visibility 180ms;
}

/* Tail pointing toward bubble */
.support-chat-tooltip::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -5px;
  transform: translateY(-50%) rotate(45deg);
  width: 9px;
  height: 9px;
  background: rgba(255, 255, 255, 0.95);
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.support-chat-widget:hover .support-chat-tooltip,
.support-chat-widget:focus-visible .support-chat-tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .support-chat-widget {
    right: 18px;
    bottom: 18px;
  }
  .support-chat-bubble {
    width: 46px;
    height: 46px;
  }
  .support-chat-icon {
    width: 20px;
    height: 20px;
  }
  .support-chat-tooltip {
    right: 0;
    top: auto;
    bottom: calc(100% + 10px);
    transform: translateY(6px);
    max-width: calc(100vw - 36px);
  }
  .support-chat-tooltip::after {
    top: auto;
    bottom: -5px;
    right: 18px;
    transform: rotate(45deg);
    border-top: none;
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }
  .support-chat-widget:hover .support-chat-tooltip,
  .support-chat-widget:focus-visible .support-chat-tooltip {
    transform: translateY(0);
  }
}

/* When popover is open, suppress hover tooltip */
.support-chat-widget.is-popover-open .support-chat-tooltip {
  display: none !important;
}

/* Popover Card */
.support-chat-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  width: 320px;
  max-width: calc(100vw - 36px);
  padding: 16px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(15, 23, 42, 0.04);
  animation: popoverFadeIn 180ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 100;
}

@keyframes popoverFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.support-popover-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.support-popover-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.support-popover-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--text-main, #0f172a);
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.support-popover-subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
}

.support-popover-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  transition: all 140ms ease;
  margin-top: -2px;
  margin-right: -2px;
}

.support-popover-close:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-main, #0f172a);
}

.support-popover-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Email Option Link */
.support-email-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(11, 31, 58, 0.04);
  border: 1px solid rgba(11, 31, 58, 0.08);
  color: var(--text-main, #0f172a);
  text-decoration: none;
  cursor: pointer;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.support-email-option:hover {
  background: rgba(11, 31, 58, 0.08);
  border-color: rgba(11, 31, 58, 0.18);
  transform: translateY(-1px);
}

.support-email-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 9px;
  background: #0b1f3a;
  color: #ffffff;
}

.support-email-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.support-email-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main, #0f172a);
  letter-spacing: -0.01em;
}

.support-email-address {
  font-size: 11.5px;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.support-email-arrow {
  color: var(--text-muted, #94a3b8);
  display: flex;
  align-items: center;
  transition: transform 140ms ease, color 140ms ease;
}

.support-email-option:hover .support-email-arrow {
  transform: translateX(2px);
  color: var(--text-main, #0f172a);
}

/* Copy email button */
.support-copy-email-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 32px;
  border: 1px dashed rgba(15, 23, 42, 0.15);
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
  transition: all 140ms ease;
}

.support-copy-email-btn:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text-main, #0f172a);
  border-color: rgba(15, 23, 42, 0.25);
}


