/* =============================================================
   PRODUCTS.CSS — Per-product classes for app switcher and branding
   Add a new block here for each product in your suite.
   These classes are reusable across all environments.
   ============================================================= */

/* =============================================================
   APP ICON BADGES
   Used in the product switcher dropdown.
   Each product gets a named class with its own background color.
   The icon inside inherits white via .icon-color-white.
   ============================================================= */

.app-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Current / default app — uses brand color from active theme */
.app-icon-default {
  background: var(--c-brand);
}

/* CRM */
.app-icon-crm {
  background: #7c3aed;
}

/* Website Editor */
.app-icon-editor {
  background: #0891b2;
}

/* Analytics */
.app-icon-analytics {
  background: #059669;
}

/* Support / Help desk — example for future product */
.app-icon-support {
  background: #d97706;
}

/* =============================================================
   APP SWITCHER ITEM LAYOUT
   Consistent padding and label structure for product list items.
   ============================================================= */

.app-switcher-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.app-switcher-item:hover {
  background: var(--c-hover);
}

.app-switcher-item.active {
  background: var(--c-brand-subtle);
}

.app-switcher-label {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.app-switcher-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-text);
}

.app-switcher-description {
  font-size: 0.75rem;
  color: var(--c-text-muted);
}

/* =============================================================
   APP SWITCHER DROPDOWN POSITIONING
   Left-anchored, wider than standard dropdowns.
   ============================================================= */

.app-switcher-menu {
  left: 0;
  right: auto;
  min-width: 280px;
}

/* =============================================================
   TOPBAR BRAND WRAPPER
   Flex container that holds the logo button and app name.
   ============================================================= */

.topbar-brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

/* =============================================================
   ORG BADGE — active state
   The currently selected org gets brand coloring.
   ============================================================= */

.org-badge-active {
  background: var(--c-brand-subtle);
  color: var(--c-brand);
}

/* =============================================================
   ORG BADGE COLORS
   Applied as org-style-{index % 12} on the org badge element.
   Color is deterministic — same org always gets same color.
   Add more classes in multiples of 12 to extend the palette.
   ============================================================= */

.org-style-0  { background: #2563eb; color: #ffffff; } /* Blue    */
.org-style-1  { background: #0891b2; color: #ffffff; } /* Teal    */
.org-style-2  { background: #059669; color: #ffffff; } /* Green   */
.org-style-3  { background: #7c3aed; color: #ffffff; } /* Purple  */
.org-style-4  { background: #dc2626; color: #ffffff; } /* Red     */
.org-style-5  { background: #ea580c; color: #ffffff; } /* Orange  */
.org-style-6  { background: #db2777; color: #ffffff; } /* Pink    */
.org-style-7  { background: #4338ca; color: #ffffff; } /* Indigo  */
.org-style-8  { background: #d97706; color: #ffffff; } /* Amber   */
.org-style-9  { background: #0e7490; color: #ffffff; } /* Cyan    */
.org-style-10 { background: #e11d48; color: #ffffff; } /* Rose    */
.org-style-11 { background: #047857; color: #ffffff; } /* Emerald */

/* =============================================================
   ORG SELECTOR PAGE
   Standalone page — no sidebar, minimal topbar.
   ============================================================= */

.org-select-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.org-select-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: var(--topbar-height);
  background: var(--c-topbar-bg);
  border-bottom: 1px solid var(--c-topbar-border);
  color: var(--c-topbar-text);
  position: sticky;
  top: 0;
  z-index: 100;
}

.org-select-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.org-select-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 1.5rem 3rem;
}

.org-select-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  text-align: center;
}

.org-select-subtitle {
  font-size: 0.9375rem;
  color: var(--c-text-muted);
  margin-bottom: 2rem;
  text-align: center;
}

.org-select-search-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin-bottom: 2.5rem;
}

.org-select-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--c-text-muted);
}

.org-select-search {
  width: 100%;
  padding: 0.625rem 0.75rem 0.625rem 2.5rem;
  font-size: 0.9375rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  background: var(--c-input-bg);
  color: var(--c-text);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.org-select-search::placeholder { color: var(--c-text-placeholder); }
.org-select-search:focus {
  outline: none;
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px var(--c-focus-ring);
}

.org-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 900px;
}

.org-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  padding: 2rem 1rem 1.5rem;
  background: var(--c-card-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.1s ease;
}

.org-card:hover {
  border-color: var(--c-brand);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.org-card:active {
  transform: translateY(0);
}

.org-card-badge {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.org-card-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--c-text);
  line-height: 1.3;
}

.org-select-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  border-top: 1px solid var(--c-border-subtle);
}

@media (max-width: 768px) {
  .org-select-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .org-select-title { font-size: 1.5rem; }
  .org-select-content { padding: 2.5rem 1rem 2rem; }
}

@media (max-width: 400px) {
  .org-select-grid { grid-template-columns: 1fr; }
}

/* =============================================================
   LOGIN PAGE
   Standalone page — no sidebar, minimal topbar, two-column layout.
   Left: brand presence and value proposition.
   Right: action card with SSO login/register.
   Collapses to single column on mobile.
   ============================================================= */

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-body-bg);
}

/* Topbar */
.login-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: var(--topbar-height);
  background: var(--c-topbar-bg);
  border-bottom: 1px solid var(--c-topbar-border);
  color: var(--c-topbar-text);
  position: sticky;
  top: 0;
  z-index: 100;
}

.login-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.login-topbar-brand-name {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--c-topbar-text);
}

.login-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Body */
.login-content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 4rem 2rem;
  gap: 4rem;
  align-items: center;
}

/* Left — brand and value prop */
.login-brand-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.login-brand-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-brand);
}

.login-brand-name {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--c-text);
  line-height: 1.1;
}

.login-brand-tagline {
  font-size: 1.125rem;
  color: var(--c-text-muted);
  line-height: 1.6;
  max-width: 420px;
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  color: var(--c-text-muted);
}

.login-feature-icon {
  color: var(--c-brand);
  flex-shrink: 0;
}

/* Right — action card */
.login-action-panel {
  display: flex;
  flex-direction: column;
}

.login-card {
  background: var(--c-card-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.login-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--c-text);
}

.login-card-subtitle {
  font-size: 0.875rem;
  color: var(--c-text-muted);
  margin-top: -0.75rem;
}

.login-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--c-text-muted);
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--c-border);
}

.login-card-footer {
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  text-align: center;
}

.login-card-footer a {
  color: var(--c-brand);
  font-weight: 500;
}

.login-card-footer a:hover {
  text-decoration: underline;
}

/* Footer */
.login-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  border-top: 1px solid var(--c-border-subtle);
}

/* Mobile */
@media (max-width: 768px) {
  .login-content {
    grid-template-columns: 1fr;
    padding: 2rem 1rem;
    gap: 2rem;
  }

  .login-brand-panel {
    align-items: center;
    text-align: center;
  }

  .login-brand-tagline { max-width: none; }

  .login-features { align-items: flex-start; }

  .login-brand-name { font-size: 1.5rem; }
}

/* =============================================================
   LEGAL PAGES (terms.html, privacy.html)
   Standalone pages — minimal topbar, no sidebar.
   Long-form document layout with strong typography hierarchy.
   ============================================================= */

.legal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-body-bg);
}

.legal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: var(--topbar-height);
  background: var(--c-topbar-bg);
  border-bottom: 1px solid var(--c-topbar-border);
  color: var(--c-topbar-text);
  position: sticky;
  top: 0;
  z-index: 100;
}

.legal-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.legal-topbar-brand-name {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--c-topbar-text);
}

.legal-topbar-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.875rem;
}

.legal-topbar-link {
  color: var(--c-topbar-text);
  opacity: 0.75;
  text-decoration: none;
  transition: opacity 0.12s ease;
}

.legal-topbar-link:hover { opacity: 1; }
.legal-topbar-link.active { opacity: 1; font-weight: 600; }

/* Content layout */
.legal-content {
  flex: 1;
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

.legal-eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-brand);
  margin-bottom: 0.75rem;
}

.legal-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--c-text);
  margin-bottom: 0.5rem;
}

.legal-meta {
  font-size: 0.875rem;
  color: var(--c-text-muted);
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--c-border);
}

/* Document body typography */
.legal-body h2 {
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--c-text);
  margin: 2.5rem 0 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--c-border-subtle);
}

.legal-body h2:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.legal-body h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-text);
  margin: 1.5rem 0 0.5rem;
}

.legal-body p {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--c-text-muted);
  margin-bottom: 1rem;
}

.legal-body p strong {
  color: var(--c-text);
  font-weight: 600;
}

.legal-body ul,
.legal-body ol {
  margin: 0.75rem 0 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.legal-body li {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--c-text-muted);
}

.legal-body a {
  color: var(--c-brand);
  text-decoration: none;
}

.legal-body a:hover { text-decoration: underline; }

.legal-highlight {
  background: var(--c-brand-subtle);
  border-left: 3px solid var(--c-brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
  color: var(--c-text);
  line-height: 1.7;
}

.legal-contact-block {
  background: var(--c-card-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--c-text-muted);
}

.legal-contact-block strong { color: var(--c-text); }

/* Footer */
.legal-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  border-top: 1px solid var(--c-border-subtle);
}

.legal-footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.legal-footer-link {
  color: var(--c-text-muted);
  text-decoration: none;
  font-size: 0.8125rem;
}

.legal-footer-link:hover { color: var(--c-brand); }

@media (max-width: 768px) {
  .legal-content { padding: 2rem 1rem 3rem; }
  .legal-title { font-size: 1.5rem; }
  .legal-topbar-links { display: none; }
}
