/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #25D366;
  --primary-dark: #1da851;
  --text: #111827;
  --text-muted: #6b7280;
  --bg: #ffffff;
  --bg-alt: #fafafa;
  --border: #e5e7eb;
  --radius: 8px;

  /* Legacy aliases — kept so older pages that reference --gray / --dark
     don't break. New code should use --text / --text-muted / --bg. */
  --gray: var(--text-muted);
  --gray-light: var(--bg-alt);
  --dark: var(--text);
  --dark-light: #1f2937;
  --white: var(--bg);
  --shadow: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.06);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  line-height: 1.6;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  border: 1px solid transparent;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  border-color: var(--border);
  color: var(--text);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--text);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn-block {
  display: block;
  text-align: center;
  width: 100%;
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo span {
  color: var(--text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a:not(.btn) {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
}

.nav-links a:not(.btn):hover {
  color: var(--text);
}

.nav-links .btn {
  padding: 7px 16px;
  font-size: 14px;
}

/* ===== Hero ===== */
.hero {
  padding: 140px 0 80px;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero h1 {
  font-size: 44px;
  line-height: 1.12;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.highlight {
  color: var(--primary);
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.6;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.hero-note {
  font-size: 13px;
  color: var(--text-muted);
}

/* Phone Mockup */
.phone-mockup {
  background: #111;
  border-radius: 32px;
  padding: 10px;
  max-width: 300px;
  margin: 0 auto;
  border: 1px solid var(--border);
}

.phone-screen {
  background: #e5ddd5;
  border-radius: 24px;
  overflow: hidden;
}

.chat-header {
  background: var(--primary-dark);
  color: white;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 15px;
}

.chat-messages {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 340px;
}

.chat-msg {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  max-width: 85%;
}

.chat-msg.bot {
  background: white;
  align-self: flex-start;
  border-bottom-left-radius: 3px;
}

.chat-msg.user {
  background: #dcf8c6;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}

/* ===== Sections ===== */
.features,
.pricing {
  padding: 80px 0;
}

.faq-section {
  padding: 80px 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.faq-list {
  max-width: 720px;
  margin: 40px auto 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 24px;
}

.faq-section .faq-item > summary {
  font-size: 16px;
  padding: 18px 28px 18px 0;
}

.faq-section .faq-item > p {
  padding: 0 0 20px;
  font-size: 15px;
}

.how-it-works {
  padding: 80px 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  text-align: center;
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.015em;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 48px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Features ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
}

.feature-icon {
  font-size: 22px;
  margin-bottom: 12px;
  color: var(--primary);
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
}

/* ===== How it works ===== */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 36px;
}

.step {
  text-align: center;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.step h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.step p {
  color: var(--text-muted);
  font-size: 14px;
}

.step-arrow {
  display: none;
}

/* ===== Pricing ===== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 720px;
  margin: 0 auto;
}

.pricing-card {
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  position: relative;
  background: var(--bg);
}

.pricing-card.featured {
  border-color: var(--primary);
}

.pricing-badge {
  position: absolute;
  top: -11px;
  left: 24px;
  background: var(--primary);
  color: white;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.pricing-card h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.price {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.price-period {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 14px;
}

.pricing-features {
  list-style: none;
  margin-bottom: 28px;
}

.pricing-features li {
  padding: 6px 0;
  font-size: 14px;
  color: var(--text);
}

.pricing-features li::before {
  content: "\2713 ";
  color: var(--primary);
  font-weight: 600;
  margin-right: 8px;
}

/* ===== Footer ===== */
.footer {
  background: var(--bg);
  color: var(--text);
  padding: 48px 0 24px;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand p {
  color: var(--text-muted);
  margin-top: 10px;
  font-size: 14px;
  max-width: 300px;
}

.footer-links h4 {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.footer-links a {
  display: block;
  color: var(--text);
  text-decoration: none;
  padding: 3px 0;
  font-size: 14px;
  transition: color 0.15s;
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== Auth Page ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  padding: 24px;
}

.auth-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}

.auth-card .logo {
  display: block;
  text-align: center;
  font-size: 24px;
  margin-bottom: 8px;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 28px;
  font-size: 20px;
  font-weight: 600;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  font-family: inherit;
}

.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

/* Password field with inline "Anzeigen/Ausblenden" toggle button. */
.password-field {
  position: relative;
}

.password-field input {
  padding-right: 76px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 4px;
}

.password-toggle:hover {
  color: var(--text);
  background: var(--bg-alt);
}

.auth-error {
  background: #fef2f2;
  color: #b91c1c;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
  border: 1px solid #fecaca;
}

.auth-success {
  background: #f0fdf4;
  color: #15803d;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
  border: 1px solid #bbf7d0;
}

.auth-toggle {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-toggle a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}

.auth-toggle a:hover {
  text-decoration: underline;
}

/* ===== Dashboard ===== */
.dashboard {
  padding-top: 80px;
  min-height: 100vh;
  background: var(--bg-alt);
}

.dashboard-header {
  padding: 32px 0 24px;
}

.dashboard-header h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.dashboard-header p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 2px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding-bottom: 48px;
}

.dash-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
}

.dash-card h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.dash-card p {
  font-size: 14px;
}

/* label/value rows */
.dash-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.dash-row:last-of-type {
  border-bottom: none;
}

.dash-row .label {
  color: var(--text-muted);
}

.dash-row .value {
  color: var(--text);
  font-weight: 500;
  text-align: right;
  margin-left: auto;
}

.dash-actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dash-actions .btn {
  padding: 6px 12px;
  font-size: 13px;
}

/* Inline pencil-style edit button for dash-row */
.edit-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  margin-left: 8px;
  font-size: 14px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.edit-btn:hover {
  color: var(--text);
  background: var(--bg-alt);
}

.edit-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===== Legal pages (Impressum / Datenschutz / AGB) ===== */
.legal-page {
  max-width: 760px;
  margin: 48px auto 80px;
  padding: 0 24px;
  line-height: 1.7;
  color: var(--text);
}

.legal-page h1 {
  font-size: 32px;
  margin-bottom: 8px;
}

.legal-page .last-updated {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 32px;
}

.legal-page h2 {
  font-size: 20px;
  margin-top: 32px;
  margin-bottom: 10px;
}

.legal-page h3 {
  font-size: 16px;
  margin-top: 20px;
  margin-bottom: 6px;
}

.legal-page p,
.legal-page ul,
.legal-page ol {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 12px;
}

.legal-page ul,
.legal-page ol {
  padding-left: 22px;
}

.legal-page li {
  margin-bottom: 4px;
}

.legal-page a {
  color: var(--primary-dark);
}

.legal-page .placeholder {
  background: #fff8dd;
  border-bottom: 1px dashed #d97706;
  padding: 0 2px;
}

.legal-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  font-size: 14px;
}

.legal-page th,
.legal-page td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.legal-page th {
  color: var(--text-muted);
  font-weight: 500;
  background: var(--bg-alt);
}

/* status dots */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.status-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.status-badge.active {
  color: #16a34a;
}

.status-badge.inactive {
  color: #dc2626;
}

.status-badge.trial {
  color: #d97706;
}

.dash-info {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.dash-value {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 14px;
}

.dash-card .dash-value:last-child {
  margin-bottom: 0;
}

.bot-number {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 18px !important;
  font-weight: 600 !important;
  padding: 10px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px !important;
  display: inline-block;
}

.account-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.account-select-row {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.account-select-row select {
  flex: 1;
  min-width: 200px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: white;
}

.help-text {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 6px;
}

.quickstart-list {
  list-style: none;
  counter-reset: qs;
  color: var(--text);
  font-size: 14px;
}

.quickstart-list li {
  counter-increment: qs;
  padding: 6px 0;
  padding-left: 28px;
  position: relative;
}

.quickstart-list li::before {
  content: counter(qs);
  position: absolute;
  left: 0;
  top: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quickstart-list code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
}

/* FAQ accordion (native <details>/<summary>) */
.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item:last-of-type {
  border-bottom: none;
}

.faq-item > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 28px 10px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  position: relative;
  user-select: none;
}

.faq-item > summary::-webkit-details-marker {
  display: none;
}

.faq-item > summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 400;
  color: var(--text-muted);
  transition: transform 0.15s, color 0.15s;
  line-height: 1;
}

.faq-item[open] > summary::after {
  content: "\2212"; /* minus sign */
  color: var(--text);
}

.faq-item > summary:hover {
  color: var(--primary-dark);
}

.faq-item > p {
  padding: 0 0 14px;
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.faq-item > p code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text);
}

.faq-item > p a {
  color: var(--primary-dark);
}

.sub-features {
  list-style: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.sub-features li {
  padding: 4px 0;
  font-size: 13px;
  color: var(--text);
}

.sub-features li::before {
  content: "\2713";
  color: var(--primary);
  margin-right: 8px;
  font-weight: 600;
}

.invoices-list {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.invoices-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.invoices-table th {
  text-align: left;
  padding: 6px 8px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.invoices-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.invoices-table tr:last-child td {
  border-bottom: none;
}

.invoices-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.invoices-table td.links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.invoices-table td.links a:hover {
  text-decoration: underline;
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}

.logout-btn:hover {
  color: var(--text);
}

.user-email {
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero {
    padding: 110px 0 60px;
  }

  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
  }

  .phone-mockup {
    max-width: 260px;
  }

  .features,
  .pricing,
  .how-it-works {
    padding: 60px 0;
  }

  .section-title {
    font-size: 24px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .nav-links a:not(.btn) {
    display: none;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dash-card {
    padding: 20px;
  }
}
