/* Shared company email connect UI — onboarding page + Parameters side panel.
   WIX tokens carry hex fallbacks because the onboarding page does not load wix.css. */

.company-email-panel {
  padding: 1.1rem;
  min-height: 100%;
  background: var(--wix-color-gray-50, #fafafa);
  font-family: var(--wix-font-family, 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif);
  color: var(--wix-color-gray-800, #333333);
}

.cep-streamlined .cep-streamlined-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Pills */
.cep-streamlined .cep-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.cep-streamlined .cep-pill--success {
  background: #dcfce7;
  color: var(--wix-color-success, #16a34a);
}

.cep-streamlined .cep-pill--info {
  background: var(--wix-color-blue-100, #dbeafe);
  color: var(--wix-color-blue-700, #1a56db);
}

.cep-streamlined .cep-pill--neutral {
  background: var(--wix-color-gray-100, #f4f4f4);
  color: var(--wix-color-gray-700, #4a4a4a);
}

/* Connected state */
.cep-streamlined .cep-connected-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--wix-color-white, #ffffff);
  border: 1px solid var(--wix-color-gray-200, #e0e0e0);
  border-left: 4px solid var(--wix-color-success, #16a34a);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.cep-streamlined .cep-connected-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.cep-streamlined .cep-status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.cep-streamlined .cep-status-dot.connected {
  background: var(--wix-color-success, #16a34a);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15);
}

.cep-streamlined .cep-connected-email {
  font-weight: 700;
  color: var(--wix-color-black-soft, #111111);
  font-size: 0.95rem;
  word-break: break-all;
}

.cep-streamlined .cep-connected-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.cep-streamlined .cep-connected-provider {
  font-size: 0.8rem;
  color: var(--wix-color-gray-600, #666666);
}

.cep-streamlined .cep-btn-disconnect {
  flex-shrink: 0;
  padding: 0.4rem 0.95rem;
  border: 1px solid #fecaca;
  background: var(--wix-color-white, #ffffff);
  color: var(--wix-color-danger, #dc2626);
  font-weight: 600;
}

.cep-streamlined .cep-btn-disconnect:hover {
  background: var(--wix-color-danger, #dc2626);
  border-color: var(--wix-color-danger, #dc2626);
  color: var(--wix-color-white, #ffffff);
}

.cep-streamlined .cep-error-banner {
  padding: 0.75rem 1rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  color: #92400e;
  font-size: 0.85rem;
}

/* Hero / trust banner */
.cep-streamlined .co-trust-banner {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin: 0;
  padding: 1.05rem 1.15rem;
  background: var(--wix-color-gray-900, #212121);
  border-radius: 14px;
  font-size: 0.92rem;
  color: var(--wix-color-white, #ffffff);
  line-height: 1.5;
}

.cep-streamlined .co-trust-banner p {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--wix-color-gray-300, #cccccc);
}

.cep-streamlined .co-trust-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: var(--wix-color-blue-500, #2563eb);
  color: var(--wix-color-white, #ffffff);
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

/* Connect CTA */
.cep-streamlined .co-connect-zone {
  text-align: center;
}

.cep-streamlined .co-btn-connect {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--wix-color-blue-500, #2563eb);
  color: #fff !important;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 1.5rem;
  border: none;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.cep-streamlined .co-btn-connect:hover {
  background: var(--wix-color-blue-600, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.32);
}

.cep-streamlined .co-connect-hint {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: var(--wix-color-gray-600, #666666);
}

.cep-streamlined .co-connect-terms {
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
  color: var(--wix-color-gray-500, #888888);
  line-height: 1.45;
}

.cep-streamlined .co-connect-terms a {
  color: var(--wix-color-blue-500, #2563eb);
  text-decoration: none;
  font-weight: 600;
}

.cep-streamlined .co-connect-terms a:hover {
  text-decoration: underline;
}

/* Flow cards (email → provider → OAuth / SMTP) */
.cep-streamlined .cep-flow-panel {
  display: none;
}

.cep-streamlined .cep-flow-panel.is-active,
.cep-streamlined .cep-flow-panel:has(.cep-connected-card),
.cep-streamlined .cep-flow-panel:has(#companyEmailOAuthCard:not(.d-none)),
.cep-streamlined .cep-flow-panel:has(#companyEmailSmtpCard:not(.d-none)) {
  display: block;
}

.cep-streamlined .cep-card {
  background: var(--wix-color-white, #ffffff);
  border: 1px solid var(--wix-color-gray-200, #e0e0e0);
  border-radius: 14px;
  padding: 1.1rem 1.15rem;
  margin-bottom: 0.75rem;
}

.cep-streamlined .cep-flow-panel .cep-card:last-of-type {
  margin-bottom: 0;
}

.cep-streamlined .cep-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--wix-color-gray-700, #4a4a4a);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cep-streamlined .cep-input {
  border-radius: 10px;
  border: 1px solid var(--wix-color-gray-300, #cccccc);
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  color: var(--wix-color-black-soft, #111111);
}

.company-email-panel #companyEmailAddress.cep-input-email {
  border-radius: var(--bs-border-radius-pill, 50rem) !important;
}

.cep-streamlined .cep-input:focus {
  border-color: var(--wix-color-blue-500, #2563eb);
  box-shadow: 0 0 0 0.18rem rgba(37, 99, 235, 0.15);
}

.cep-streamlined .cep-input-row {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.cep-streamlined .cep-input-row .cep-input {
  flex: 1;
}

.cep-streamlined .cep-next-btn,
.cep-streamlined .cep-btn-save {
  background: var(--wix-color-black-soft, #111111);
  border: 1px solid var(--wix-color-black-soft, #111111);
  color: var(--wix-color-white, #ffffff);
  font-weight: 600;
}

.cep-streamlined .cep-next-btn {
  white-space: nowrap;
  padding: 0.7rem 1.2rem;
}

.cep-streamlined .cep-btn-save {
  padding: 0.7rem 1rem;
}

.cep-streamlined .cep-next-btn:hover,
.cep-streamlined .cep-btn-save:hover {
  background: var(--wix-color-blue-500, #2563eb);
  border-color: var(--wix-color-blue-500, #2563eb);
  color: var(--wix-color-white, #ffffff);
}

.cep-streamlined .cep-cancel-connect-btn {
  font-weight: 600;
  padding: 0.65rem 1rem;
}

.cep-streamlined .cep-detecting {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  color: var(--wix-color-blue-500, #2563eb);
  font-weight: 500;
}

.cep-streamlined .cep-action-card {
  text-align: center;
}

.cep-streamlined .cep-oauth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  border: 1px solid var(--wix-color-gray-300, #cccccc);
  background: var(--wix-color-white, #ffffff);
  color: var(--wix-color-black-soft, #111111);
  font-weight: 600;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.15s;
}

.cep-streamlined .cep-oauth-btn:hover {
  border-color: var(--wix-color-blue-500, #2563eb);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
  background: var(--wix-color-blue-50, #eff6ff);
}

.cep-streamlined .cep-oauth-brand-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.cep-streamlined .cep-action-hint {
  margin: 0.7rem 0 0;
  font-size: 0.82rem;
  color: var(--wix-color-gray-600, #666666);
}

.cep-streamlined .cep-edit-link {
  display: block;
  margin: 0.5rem auto 0;
  padding: 0;
  background: none;
  border: none;
  color: var(--wix-color-blue-500, #2563eb);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
}

.cep-streamlined .cep-edit-link:hover {
  text-decoration: underline;
}

.cep-streamlined #cepConnectionFollowupHint {
  display: none !important;
}

/* Permissions requested (scopes) */
.cep-streamlined .cep-section {
  border: 1px solid var(--wix-color-gray-200, #e0e0e0);
  border-radius: 14px;
  background: var(--wix-color-white, #ffffff);
  overflow: hidden;
}

.cep-streamlined .cep-section__header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.1rem;
  background: var(--wix-color-gray-900, #212121);
  color: var(--wix-color-white, #ffffff);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cep-streamlined .cep-section__header i {
  color: var(--wix-color-blue-300, #93c5fd);
}

.cep-streamlined .cep-section__body {
  padding: 0.85rem 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cep-streamlined .cep-scope-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--wix-color-gray-200, #e0e0e0);
  border-radius: 10px;
  background: var(--wix-color-gray-50, #fafafa);
}

.cep-streamlined .cep-scope-icon {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--wix-color-white, #ffffff);
  border: 1px solid var(--wix-color-gray-200, #e0e0e0);
}

.cep-streamlined .cep-scope-icon--google { color: #4285f4; }
.cep-streamlined .cep-scope-icon--microsoft { color: #00a4ef; }

.cep-streamlined .cep-scope-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.cep-streamlined .cep-scope-text strong {
  font-size: 0.84rem;
  color: var(--wix-color-black-soft, #111111);
}

.cep-streamlined .cep-scope-text code {
  font-size: 0.74rem;
  color: var(--wix-color-gray-600, #666666);
  background: none;
  padding: 0;
}

.cep-streamlined .cep-section__note {
  font-size: 0.78rem;
  color: var(--wix-color-gray-600, #666666);
}

/* Collapsible info cards */
.cep-streamlined .co-permissions-details {
  border: 1px solid var(--wix-color-gray-200, #e0e0e0);
  border-radius: 14px;
  background: var(--wix-color-white, #ffffff);
  overflow: hidden;
}

.cep-streamlined .co-permissions-details summary {
  cursor: pointer;
  padding: 0.85rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--wix-color-black-soft, #111111);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.cep-streamlined .co-permissions-details summary::-webkit-details-marker {
  display: none;
}

.cep-streamlined .co-permissions-details summary::after {
  content: '+';
  font-size: 1.1rem;
  color: var(--wix-color-gray-500, #888888);
  font-weight: 400;
}

.cep-streamlined .co-permissions-details[open] summary::after {
  content: '−';
}

.cep-streamlined .co-permissions-body {
  padding: 0 1.1rem 1.1rem;
  border-top: 1px solid var(--wix-color-gray-200, #e0e0e0);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.cep-streamlined .co-permissions-col h6 {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0.85rem 0 0.5rem;
}

.cep-streamlined .co-permissions-col--yes h6 { color: var(--wix-color-success, #16a34a); }
.cep-streamlined .co-permissions-col--no h6 { color: var(--wix-color-danger, #dc2626); }

.cep-streamlined .co-permissions-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  color: var(--wix-color-gray-700, #4a4a4a);
  line-height: 1.45;
}

.cep-streamlined .co-permissions-col li {
  position: relative;
  padding-left: 1.3rem;
  margin-bottom: 0.4rem;
}

.cep-streamlined .co-permissions-col li::before {
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 800;
}

.cep-streamlined .co-permissions-col--yes li::before {
  content: '✓';
  color: var(--wix-color-success, #16a34a);
}

.cep-streamlined .co-permissions-col--no li::before {
  content: '✕';
  color: var(--wix-color-danger, #dc2626);
}

.cep-streamlined .co-permissions-note {
  grid-column: 1 / -1;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  background: var(--wix-color-gray-100, #f4f4f4);
  font-size: 0.78rem;
  color: var(--wix-color-gray-700, #4a4a4a);
  line-height: 1.5;
}

.cep-streamlined .co-permissions-body--single {
  grid-template-columns: 1fr;
}

.cep-streamlined .co-disconnect-intro {
  margin: 0.85rem 0 0.25rem;
  font-size: 0.84rem;
  color: var(--wix-color-gray-700, #4a4a4a);
  line-height: 1.5;
}

.cep-streamlined .co-disconnect-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cep-streamlined .co-disconnect-list li {
  padding: 0.75rem 0.85rem;
  background: var(--wix-color-gray-50, #fafafa);
  border: 1px solid var(--wix-color-gray-200, #e0e0e0);
  border-radius: 10px;
  font-size: 0.82rem;
  color: var(--wix-color-gray-700, #4a4a4a);
  line-height: 1.45;
}

.cep-streamlined .co-disconnect-list strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wix-color-black-soft, #111111);
}

.cep-streamlined .co-disconnect-list span {
  display: block;
}

.cep-streamlined .co-disconnect-list a,
.cep-streamlined .cep-google-api-policy a {
  color: var(--wix-color-blue-500, #2563eb);
  font-weight: 600;
  text-decoration: none;
}

.cep-streamlined .co-disconnect-list a:hover,
.cep-streamlined .cep-google-api-policy a:hover {
  text-decoration: underline;
}

/* Limited Use footer */
.cep-streamlined .cep-google-api-policy {
  margin: 0;
  padding: 0.8rem 0.95rem;
  border-left: 3px solid var(--wix-color-blue-500, #2563eb);
  border-radius: 0 10px 10px 0;
  background: var(--wix-color-blue-50, #eff6ff);
  font-size: 0.75rem;
  color: var(--wix-color-gray-700, #4a4a4a);
  line-height: 1.5;
}

@media (max-width: 540px) {
  .cep-streamlined .co-trust-banner,
  .cep-streamlined .cep-connected-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .cep-streamlined .co-permissions-body {
    grid-template-columns: 1fr;
  }

  .cep-streamlined .cep-input-row {
    flex-direction: column;
    align-items: stretch;
  }
}
