/* Utility — cb-page dışında da kullanılır (i18n span'ları) */
.cb-hidden {
  display: none !important;
}

/* Chatbot sayfaları — site CSS'inden izole (.cb-page) */
.cb-page {
  --cb-primary: #1f12fd;
  --cb-primary-dark: #1509d8;
  --cb-blue: #2563c7;
  --cb-bg: #f4f8ff;
  --cb-border: #e2e8f0;
  --cb-text: #1e293b;
  --cb-muted: #64748b;
  --cb-radius: 16px;
  --cb-shadow: 0 8px 32px rgba(31, 18, 253, 0.08);
  color: var(--cb-text);
  line-height: 1.6;
}

.cb-page *,
.cb-page *::before,
.cb-page *::after {
  box-sizing: border-box;
}

.cb-page h1,
.cb-page h2,
.cb-page h3,
.cb-page p {
  margin-top: 0;
}

/* ── Hero ── */
.cb-page .cb-hero {
  background: linear-gradient(135deg, #140a9e 0%, var(--cb-primary) 45%, var(--cb-blue) 100%);
  color: #fff;
  padding: 72px 0 64px;
  position: relative;
  overflow: hidden;
}

.cb-page .cb-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 10% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 40%);
  pointer-events: none;
}

.cb-page .cb-hero .container {
  position: relative;
  z-index: 1;
}

.cb-page .cb-hero-inner {
  max-width: 720px;
}

.cb-page .cb-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
  color: #fff;
}

.cb-page .cb-hero p {
  font-size: 1.05rem;
  opacity: 0.92;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.92);
  max-width: 600px;
}

.cb-page .cb-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  margin-bottom: 1rem;
}

/* ── Sections ── */
.cb-page .cb-section {
  padding: 56px 0;
}

.cb-page .cb-section-alt {
  background: var(--cb-bg);
}

.cb-page .cb-section-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--cb-text);
}

.cb-page .cb-section-desc {
  text-align: center;
  color: var(--cb-muted);
  margin-bottom: 2.5rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Cards ── */
.cb-page .cb-card {
  background: #fff;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  padding: 28px;
  box-shadow: var(--cb-shadow);
}

.cb-page .cb-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--cb-text);
}

.cb-page .cb-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.cb-page .cb-feature-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.cb-page .cb-feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(31, 18, 253, 0.12);
}

.cb-page .cb-feature-icon {
  width: 52px;
  height: 52px;
  background: rgba(31, 18, 253, 0.1);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 14px;
}

.cb-page .cb-feature-card p {
  color: var(--cb-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

.cb-page .text-muted {
  color: var(--cb-muted) !important;
}

/* ── Auth area ── */
.cb-page .cb-auth-wrap {
  max-width: 460px;
  margin: 0 auto;
}

.cb-page .cb-auth-card {
  padding: 32px;
}

.cb-page .cb-auth-card > h3 {
  text-align: center;
  font-size: 1.35rem;
  margin-bottom: 1.25rem;
}

.cb-page .cb-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  padding: 4px;
  background: var(--cb-bg);
  border-radius: 999px;
}

.cb-page .cb-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--cb-muted);
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
  line-height: 1.2;
}

.cb-page .cb-tab.active,
.cb-page .cb-tab:hover {
  background: #fff;
  color: var(--cb-primary);
  box-shadow: 0 2px 8px rgba(31, 18, 253, 0.12);
}

.cb-page .cb-form-group {
  margin-bottom: 18px;
}

.cb-page .cb-form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--cb-text);
  font-size: 0.875rem;
}

.cb-page .cb-form-group input,
.cb-page .cb-form-group textarea,
.cb-page .cb-form-group select {
  display: block;
  width: 100%;
  border: 1px solid var(--cb-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.95rem;
  color: var(--cb-text);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  height: auto;
  line-height: 1.4;
}

.cb-page .cb-form-group input:focus,
.cb-page .cb-form-group textarea:focus,
.cb-page .cb-form-group select:focus {
  outline: none;
  border-color: var(--cb-primary);
  box-shadow: 0 0 0 3px rgba(31, 18, 253, 0.12);
}

.cb-page .cb-form-actions {
  margin-top: 8px;
}

.cb-page .cb-btn {
  display: inline-block;
  background: var(--cb-primary);
  color: #fff !important;
  border: none;
  border-radius: 35px;
  padding: 12px 28px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
  line-height: 1.4;
  text-align: center;
}

.cb-page .cb-btn:hover {
  background: var(--cb-primary-dark);
  color: #fff !important;
  transform: translateY(-1px);
}

.cb-page .cb-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.cb-page .cb-btn-block {
  display: block;
  width: 100%;
}

.cb-page .cb-btn-outline {
  background: transparent;
  color: var(--cb-primary) !important;
  border: 2px solid var(--cb-primary);
}

.cb-page .cb-btn-outline:hover {
  background: var(--cb-primary);
  color: #fff !important;
}

.cb-page .cb-btn-sm {
  padding: 8px 18px;
  font-size: 0.875rem;
}

/* ── Alerts ── */
.cb-page .cb-alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.cb-page .cb-alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.cb-page .cb-alert-success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.cb-page .cb-alert-info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* ── User bar & status ── */
.cb-page .cb-user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--cb-border);
  border-radius: 12px;
  box-shadow: var(--cb-shadow);
}

.cb-page .cb-user-bar strong {
  color: var(--cb-text);
  font-weight: 600;
}

.cb-page .cb-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cb-page .cb-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.cb-page .cb-plan-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(31, 18, 253, 0.1);
  color: var(--cb-primary);
}

/* ── Plans ── */
.cb-page .cb-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
}

.cb-page .cb-plan {
  text-align: center;
  transition: transform 0.2s;
}

.cb-page .cb-plan:hover {
  transform: translateY(-4px);
}

.cb-page .cb-plan-price {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--cb-primary);
  margin: 12px 0;
}

.cb-page .cb-plan-price span {
  font-size: 0.9rem;
  color: var(--cb-muted);
  font-weight: 400;
}

.cb-page .cb-plan ul {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  text-align: left;
}

.cb-page .cb-plan ul li {
  padding: 8px 0;
  color: var(--cb-muted);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--cb-border);
}

.cb-page .cb-plan ul li:last-child {
  border-bottom: none;
}

.cb-page .cb-plan ul li::before {
  content: "✓ ";
  color: var(--cb-primary);
  font-weight: 700;
}

/* ── Panel (panel.ejs) ── */
.cb-page .cb-panel-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  min-height: 500px;
}

.cb-page .cb-panel-nav .cb-nav-item {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--cb-muted);
  cursor: pointer;
  margin-bottom: 4px;
  font-size: 0.95rem;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.cb-page .cb-panel-nav .cb-nav-item.active,
.cb-page .cb-panel-nav .cb-nav-item:hover {
  background: rgba(31, 18, 253, 0.08);
  color: var(--cb-primary);
  font-weight: 600;
}

.cb-page .cb-panel-section {
  display: none;
}

.cb-page .cb-panel-section.active {
  display: block;
}

.cb-page .cb-usage-bar {
  background: #e2e8f0;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin: 8px 0 16px;
}

.cb-page .cb-usage-bar-fill {
  background: var(--cb-primary);
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s;
}

.cb-page .cb-embed-box {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.cb-page .cb-loading {
  text-align: center;
  padding: 40px;
  color: var(--cb-muted);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .cb-page .cb-hero {
    padding: 48px 0 40px;
  }

  .cb-page .cb-auth-card {
    padding: 24px 20px;
  }

  .cb-page .cb-panel-layout {
    grid-template-columns: 1fr;
  }

  .cb-page .cb-panel-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .cb-page .cb-panel-nav .cb-nav-item {
    flex: 1 1 auto;
    text-align: center;
  }

  .cb-page .cb-status-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}
