/* =========================================================
   GLOBAL STYLE
========================================================= */

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont;
  background: radial-gradient(circle at top, #eef3ff 0%, #e8edff 40%, #f8f9fa 100%);
  min-height: 100vh;
  margin: 0;
}

/* =========================================================
   TOP NAVIGATION
========================================================= */

.topnav {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 50;

  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(13, 110, 253, 0.15);

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.topnav-inner {
  height: 80px;
  padding-left: 12px;
  padding-right: 12px;
}

.topnav-logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0d6efd;
  letter-spacing: 0.5px;
}

.topnav-user {
  font-size: 1rem;
  font-weight: 500;
  color: #334155;
}

/* =========================================================
   LOGOUT BUTTON (BLUE ANIMATED)
========================================================= */

.logout-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;

  padding: 12px 28px;
  border: 3px solid transparent;
  border-radius: 100px;

  font-size: 15px;
  font-weight: 600;
  text-decoration: none;

  background-color: transparent;
  color: #0d6efd;

  box-shadow: 0 0 0 2px #0d6efd;

  cursor: pointer;
  overflow: hidden;

  transition: all 0.55s cubic-bezier(0.23, 1, 0.32, 1);
}

.logout-btn svg {
  position: absolute;
  width: 20px;
  fill: #0d6efd;
  z-index: 9;
  transition: all 0.55s cubic-bezier(0.23, 1, 0.32, 1);
}

.logout-btn .arr-1 { right: 14px; }
.logout-btn .arr-2 { left: -25%; }

.logout-btn .text {
  position: relative;
  z-index: 3;
  transform: translateX(-12px);
  transition: all 0.55s cubic-bezier(0.23, 1, 0.32, 1);
}

.logout-btn .circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  background-color: #0d6efd;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: all 0.55s cubic-bezier(0.23, 1, 0.32, 1);
}

.logout-btn:hover {
  color: white;
  background-color: #0d6efd;
  box-shadow: 0 4px 20px rgba(13, 110, 253, 0.4);
}

.logout-btn:hover .circle {
  width: 240px;
  height: 240px;
  opacity: 1;
}

.logout-btn:hover .text {
  transform: translateX(8px);
}

.logout-btn:hover .arr-1 {
  right: -30%;
}

.logout-btn:hover .arr-2 {
  left: 12px;
}

.logout-btn:hover svg {
  fill: white;
}

.logout-btn:active {
  scale: 0.95;
  box-shadow: 0 0 0 4px #0d6efd;
}

/* =========================================================
   PRIMÄRER ACTION BUTTON (GLEICHER STYLE WIE LOGOUT)
========================================================= */

.primary-action-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;

  padding: 12px 32px;
  border: 3px solid transparent;
  border-radius: 100px;

  font-size: 15px;
  font-weight: 600;
  text-decoration: none;

  background-color: transparent;
  color: #0d6efd;

  box-shadow: 0 0 0 2px #0d6efd;

  cursor: pointer;
  overflow: hidden;

  border: none;
  outline: none;

  transition: all 0.55s cubic-bezier(0.23, 1, 0.32, 1);
}

.primary-action-btn svg {
  position: absolute;
  width: 20px;
  fill: #0d6efd;
  z-index: 9;
  transition: all 0.55s cubic-bezier(0.23, 1, 0.32, 1);
}

.primary-action-btn .arr-1 { right: 14px; }
.primary-action-btn .arr-2 { left: -25%; }

.primary-action-btn .text {
  position: relative;
  z-index: 3;
  transform: translateX(-10px);
  transition: all 0.55s cubic-bezier(0.23, 1, 0.32, 1);
}

.primary-action-btn .circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  background-color: #0d6efd;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: all 0.55s cubic-bezier(0.23, 1, 0.32, 1);
}

.primary-action-btn:hover {
  color: white;
  background-color: #0d6efd;
  box-shadow: 0 4px 20px rgba(13, 110, 253, 0.4);
}

.primary-action-btn:hover .circle {
  width: 240px;
  height: 240px;
  opacity: 1;
}

.primary-action-btn:hover .text {
  transform: translateX(8px);
}

.primary-action-btn:hover .arr-1 {
  right: -30%;
}

.primary-action-btn:hover .arr-2 {
  left: 12px;
}

.primary-action-btn:hover svg {
  fill: white;
}

.primary-action-btn:active {
  scale: 0.95;
  box-shadow: 0 0 0 4px #0d6efd;
}

/* =========================================================
   DASHBOARD / STAT CARDS
========================================================= */

.login-card {
  background: #ffffff;
}

.role-badge {
  background: #e7f1ff;
  color: #0d6efd;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.dash-hero {
  background: linear-gradient(135deg, #f5f8ff, #fefefe);
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
}

.stat-card .stat-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6c757d;
  margin-bottom: .35rem;
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1.1;
  color: #000000;
  margin-bottom: 0.3rem;
  text-shadow: 0 1px 3px rgba(80, 80, 80, 0.493);
}

.stat-card .stat-hint {
  font-size: 0.85rem;
  color: #6c757d;
}

/* =========================================================
   LEAD-FORM / TIPPGEGER
========================================================= */

.lead-form-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 22px;
}

.section-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6b7280;
  font-weight: 700;
}

/* --- Produkt-Kacheln --- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
  margin-top: 0.5rem;
}

.product-tile {
  border-radius: 18px;
  padding: 0.9rem 1rem;
  border: 1.5px solid rgba(15, 23, 42, 0.1);
  background: linear-gradient(135deg, #ffffff, #f9fbff);
  cursor: pointer;
  display: block;
  min-height: 70px;
  transition: all 0.18s ease-out;
}

.product-tile:hover {
  border-color: rgba(13, 110, 253, 0.7);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.product-tile .product-checkbox {
  display: none;
}

.product-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.product-pill {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #ffffff, #0d6efd);
  opacity: 0.2;
  flex-shrink: 0;
}

.product-main {
  flex: 1;
}

.product-name {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.98rem;
  margin-bottom: 0.15rem;
}

.product-tagline {
  font-size: 0.78rem;
  color: #6b7280;
}

/* VISUELLE MARKIERUNG – bleibt aktiv bei Auswahl */

.product-tile.is-selected {
  border-color: #0d6efd;
  background: linear-gradient(135deg, #e0ecff, #f1f6ff);
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.22);
}

.product-tile.is-selected .product-pill {
  opacity: 0.9;
}

/* =========================================================
   LEADS-TABELLE / VERTRIEBLER
========================================================= */

.leads-card {
  background: #ffffff;
  border-radius: 22px;
}

.leads-table thead tr th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #6b7280;
  border-bottom-width: 1px;
}

.leads-table tbody tr td {
  border-color: #e5e7eb;
  font-size: 0.9rem;
}

.leads-table tbody tr:hover td {
  background-color: #f9fafb;
}

/* Chips für Produkte in der Tabelle */

.product-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 0.2rem;
  margin-bottom: 0.15rem;
}

/* Status-Badges */

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-neu {
  background: #dcfce7;
  color: #166534;
}

.status-in-bearbeitung {
  background: #fef9c3;
  color: #854d0e;
}

.status-abgeschlossen {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-unknown {
  background: #e5e7eb;
  color: #374151;
}

/* =========================================================
   WAVE-GROUP INPUTS (Login)
========================================================= */

.wave-group {
  position: relative;
}

.wave-group .input {
  font-size: 16px;
  padding: 10px 10px 10px 5px;
  width: 100%;
  border: none;
  border-bottom: 1px solid #515151;
  background: transparent;
  color: #212529;
}

.wave-group .input:focus {
  outline: none;
}

.wave-group .label {
  position: absolute;
  pointer-events: none;
  left: 5px;
  top: 10px;
  display: flex;
  color: #999;
  font-size: 18px;
}

.wave-group .label-char {
  transition: 0.2s ease;
  transition-delay: calc(var(--index) * .05s);
}

.wave-group .input:focus ~ .label .label-char,
.wave-group .input:not(:placeholder-shown) ~ .label .label-char {
  transform: translateY(-20px);
  font-size: 14px;
  color: #0d6efd;
}

.wave-group .bar {
  position: relative;
  width: 100%;
}

.wave-group .bar:before,
.wave-group .bar:after {
  content: "";
  height: 2px;
  width: 0;
  bottom: 1px;
  position: absolute;
  background: #0d6efd;
  transition: 0.2s ease;
}

.wave-group .bar:before { left: 50%; }
.wave-group .bar:after  { right: 50%; }

.wave-group .input:focus ~ .bar:before,
.wave-group .input:focus ~ .bar:after {
  width: 50%;
}

/* Abstand nach oben */
.tippgeber-card {
    margin-top: 40px !important;
}

/* Grundstruktur */
.dashboard-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: 0.25s ease;
}

.dashboard-card h3 {
    margin-bottom: 10px;
    font-size: 20px;
    color: #1a1a1a;
}

.dashboard-card p {
    font-size: 15px;
    color: #555;
    margin-bottom: 20px;
}

/* Button im gleichen Stil wie Logout / Absenden */
.action-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 14px 28px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    background: #ffffff;
    color: #1e90ff;
    border: 2px solid #1e90ff;
    overflow: hidden;
    transition: 0.3s ease;
}

.action-button:hover {
    background: #1e90ff;
    color: white;
}

.action-button svg {
    width: 20px;
    transition: 0.3s ease;
    fill: #1e90ff;
}

.action-button:hover svg {
    transform: translateX(4px);
    fill: white;
}

.auth-links {
  margin-top: 16px;
  text-align: right;
}

.auth-link {
  font-size: 14px;
  color: #1e90ff;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}


.auth-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 60px;
  padding-bottom: 60px;
}

.auth-card {
  background: white;
  width: 420px;
  padding: 40px 35px;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
}

.auth-subtitle {
  font-size: 15px;
  color: #555;
  margin-bottom: 25px;
}

.form-row {
  margin-bottom: 25px;
}

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 14px;
  color: #667;
  margin-bottom: 20px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.stat-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #889;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #124ea8;
}

.stat-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  font-size: 14px;
}

.card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  margin-bottom: 20px;
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid #e5e9f0;
}

.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-body {
  padding: 16px 18px 18px;
}

.rank-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.rank-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 14px;
}

.rank-list .pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #124ea8;
  font-size: 12px;
}

/* Tabelle responsive */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e9f0;
  white-space: nowrap;
}

.data-table th {
  text-align: left;
  font-weight: 600;
  color: #556;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: #124ea8;
  color: #fff;
  font-size: 14px;
  text-decoration: none;
}

.btn-primary:hover {
  background: #0f3f86;
}

.btn-secondary {
  display: inline-block;
  margin-left: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #e5e9f0;
  color: #333;
  font-size: 14px;
  text-decoration: none;
}

.btn-secondary:hover {
  background: #d4d9e2;
}

/* Mobile */
@media (max-width: 768px) {
  .page-container {
    padding: 16px 10px 30px;
  }
}

/* --- Einwilligungs-Checkbox (Uiverse Stil) --- */
/* From Uiverse.io by mrhyddenn */
.check {
  cursor: pointer;
  position: relative;
  margin: 0;
  width: 18px;
  height: 18px;
  -webkit-tap-highlight-color: transparent;
  transform: translate3d(0, 0, 0);
}

.check:before {
  content: "";
  position: absolute;
  top: -15px;
  left: -15px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(34, 50, 84, 0.03);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.check svg {
  position: relative;
  z-index: 1;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke: #c8ccd4;
  stroke-width: 1.5;
  transform: translate3d(0, 0, 0);
  transition: all 0.2s ease;
}

.check svg path {
  stroke-dasharray: 60;
  stroke-dashoffset: 0;
}

.check svg polyline {
  stroke-dasharray: 22;
  stroke-dashoffset: 66;
}

.check:hover:before {
  opacity: 1;
}

.check:hover svg {
  stroke: #4285f4;
}

/* generisch statt #cbx, damit wir WTForms-ID nutzen können */
.consent-wrapper input[type="checkbox"]:checked + label.check svg {
  stroke: #4285f4;
}

.consent-wrapper input[type="checkbox"]:checked + label.check svg path {
  stroke-dashoffset: 60;
  transition: all 0.3s linear;
}

.consent-wrapper input[type="checkbox"]:checked + label.check svg polyline {
  stroke-dashoffset: 42;
  transition: all 0.2s linear;
  transition-delay: 0.15s;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
}

.consent-text {
  font-size: 13px;
  color: #444;
  line-height: 1.4;
}

.consent-error {
  margin-top: 6px;
  font-size: 12px;
  color: #d9534f;
}

/* =========================================================
   ADMIN BUTTON (RED ANIMATED)
========================================================= */

.admin-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;

  padding: 12px 28px;
  border: 3px solid transparent;
  border-radius: 100px;

  font-size: 15px;
  font-weight: 600;
  text-decoration: none;

  background-color: transparent;
  color: #ff0000;

  box-shadow: 0 0 0 2px #ff0000;

  cursor: pointer;
  overflow: hidden;

  transition: all 0.55s cubic-bezier(0.23, 1, 0.32, 1);
}

.admin-btn svg {
  position: absolute;
  width: 20px;
  fill: #ff0000;
  z-index: 9;
  transition: all 0.55s cubic-bezier(0.23, 1, 0.32, 1);
}

.admin-btn .arr-1 { right: 14px; }
.admin-btn .arr-2 { left: -25%; }

.admin-btn .text {
  position: relative;
  z-index: 3;
  transform: translateX(-12px);
  transition: all 0.55s cubic-bezier(0.23, 1, 0.32, 1);
}

.admin-btn .circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  background-color: #ff0000;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: all 0.55s cubic-bezier(0.23, 1, 0.32, 1);
}

.admin-btn:hover {
  color: white;
  background-color: #ff0000;
  box-shadow: 0 4px 20px rgba(160, 0, 0, 0.4);
}

.admin-btn:hover .circle {
  width: 240px;
  height: 240px;
  opacity: 1;
}

.admin-btn:hover .text {
  transform: translateX(8px);
}

.admin-btn:hover .arr-1 {
  right: -30%;
}

.admin-btn:hover .arr-2 {
  left: 12px;
}

.admin-btn:hover svg {
  fill: white;
}

.admin-btn:active {
  scale: 0.95;
  box-shadow: 0 0 0 4px #ff0000;
}

.table .primary-action-btn,
.table .admin-btn {
    padding: 6px 14px !important;
    font-size: 13px !important;
    border-width: 2px !important;
}