/* =============================================
   Telegemeinschaft.de – Hauptstylesheet
   Zielgruppe: ältere Menschen → große Schrift,
   klare Kontraste, ruhige Farben, barrierearm
   ============================================= */

/* ── Custom Properties ── */
:root {
  --color-brand: #1a5276;
  /* dunkles Blau – vertrauenswürdig */
  --color-brand-light: #2e86c1;
  --color-brand-dark: #0e3254;
  --color-accent: #27ae60;
  /* Grün – Freischalten / Erfolg */
  --color-warn: #e67e22;
  /* Orange – Sperren / Warnung */
  --color-danger: #c0392b;
  /* Rot – Löschen / Fehler */
  --color-bg: #f4f6f8;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-text-muted: #4a4a6a;
  --color-border: #c8d0dc;
  --color-success-bg: #d4efdf;
  --color-warn-bg: #fdebd0;
  --color-danger-bg: #fadbd8;
  --color-info-bg: #d6eaf8;

  --radius: 0.75rem;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);

  /* Große Schrift für Barrierefreiheit / ältere Nutzer */
  --fs-base: 19px;
  --fs-sm: 16px;
  --fs-lg: 22px;
  --fs-xl: 28px;
  --fs-2xl: 36px;
  --fs-hero: clamp(2rem, 5vw, 3.2rem);

  --max-width: 1100px;
  --header-h: 70px;
}

/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-brand-light);
  text-decoration: underline;
}

a:hover {
  color: var(--color-brand-dark);
}

a:focus-visible {
  outline: 3px solid var(--color-brand-light);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Utility ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.inline-form {
  display: inline;
  margin: 0;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.6rem;
  font-size: var(--fs-base);
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s, transform 0.1s, box-shadow 0.18s;
  line-height: 1.3;
  min-height: 52px;
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: 3px solid var(--color-brand-light);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--color-brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-brand-light);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-success {
  background: var(--color-accent);
  color: #fff;
}

.btn-success:hover {
  background: #1e8449;
  color: #fff;
}

.btn-warn {
  background: var(--color-warn);
  color: #fff;
}

.btn-warn:hover {
  background: #ca6f1e;
  color: #fff;
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}

.btn-danger:hover {
  background: #922b21;
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 2px solid #fff;
  color: #fff;
  min-height: 40px;
  padding: 0.3rem 1rem;
  font-size: var(--fs-sm);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-block {
  width: 100%;
  display: flex;
}

.btn-lg {
  font-size: var(--fs-lg);
  padding: 0.85rem 2.2rem;
  min-height: 58px;
}

.btn-sm {
  font-size: var(--fs-sm);
  padding: 0.3rem 0.9rem;
  min-height: 36px;
}

/* ── Header ── */
.site-header {
  background: var(--color-brand);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.logo-img {
  height: 44px;
  width: auto;
}

.logo-text {
  font-size: var(--fs-xl);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.logo-dot {
  color: #7fc3f7;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.main-nav a {
  color: #d6eaf8;
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: color 0.15s;
}

.main-nav a:hover {
  color: #fff;
}

.nav-admin {
  font-weight: 700 !important;
  color: #7fc3f7 !important;
}

/* ── Flash messages ── */
.flash-container {
  padding: 0.75rem 1.5rem;
}

.flash {
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  font-size: var(--fs-base);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.flash-success {
  background: var(--color-success-bg);
  color: #1a5c35;
  border-left: 5px solid var(--color-accent);
}

.flash-warning {
  background: var(--color-warn-bg);
  color: #784212;
  border-left: 5px solid var(--color-warn);
}

.flash-danger {
  background: var(--color-danger-bg);
  color: #7b241c;
  border-left: 5px solid var(--color-danger);
}

.flash-info {
  background: var(--color-info-bg);
  color: #1a4e78;
  border-left: 5px solid var(--color-brand-light);
}

/* ── Hero ── */
.hero {
  background:
    linear-gradient(135deg, rgba(14, 50, 84, 0.85) 0%, rgba(26, 82, 118, 0.75) 100%),
    url('../img/hero.jpg') center/cover no-repeat;
  min-height: 480px;
  display: flex;
  align-items: center;
}

.hero-overlay {
  width: 100%;
}

.hero-content {
  padding: 5rem 1.5rem;
  max-width: 780px;
}

.hero-title {
  font-size: var(--fs-hero);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: var(--fs-lg);
  color: #d6eaf8;
  max-width: 640px;
  margin-bottom: 2rem;
  line-height: 1.7;
}

/* ── Login-Card ── */
.login-section {
  padding: 3rem 0 4rem;
}

.login-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2.5rem;
  max-width: 500px;
  margin: 0 auto;
}

.login-card h2,
.login-card h1 {
  font-size: var(--fs-xl);
  margin-bottom: 0.5rem;
  color: var(--color-brand-dark);
}

.login-hint {
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  margin-bottom: 1.5rem;
}

.login-back {
  margin-top: 1.5rem;
  text-align: center;
  font-size: var(--fs-sm);
}

.standalone-login-section {
  min-height: calc(100vh - var(--header-h) - 80px);
  display: flex;
  align-items: center;
  padding: 3rem 0;
}

.login-card--standalone {
  margin-top: 0;
}

/* ── Forms ── */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: var(--fs-base);
  color: var(--color-text);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="tel"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: var(--fs-base);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--color-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-brand-light);
  box-shadow: 0 0 0 3px rgba(46, 134, 193, 0.25);
}

.form-inline {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-inline input[type="tel"] {
  flex: 1 1 260px;
}

/* ── Info-Kacheln ── */
.tiles-section {
  padding: 4rem 0;
  background: var(--color-surface);
}

.section-title {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--color-brand-dark);
  text-align: center;
  margin-bottom: 2.5rem;
}

.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.tile {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: box-shadow 0.2s, transform 0.2s;
  text-align: center;
}

.tile:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.tile-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  object-fit: contain;
}

.tile h3 {
  font-size: var(--fs-lg);
  margin-bottom: 0.75rem;
  color: var(--color-brand-dark);
}

.tile p {
  color: var(--color-text-muted);
  font-size: var(--fs-base);
}

/* ── Kontakt ── */
.contact-section {
  padding: 3.5rem 0;
  background: var(--color-brand-dark);
  color: #fff;
}

.contact-inner {
  text-align: center;
}

.contact-inner h2 {
  font-size: var(--fs-xl);
  margin-bottom: 0.75rem;
  color: #fff;
}

.contact-inner p {
  font-size: var(--fs-lg);
  color: #d6eaf8;
}

.contact-inner a {
  color: #7fc3f7;
}

/* ── Admin-Panel ── */
.admin-section {
  padding: 2.5rem 0 4rem;
}

.admin-header {
  margin-bottom: 2rem;
}

.admin-header h1 {
  font-size: var(--fs-2xl);
  color: var(--color-brand-dark);
}

.admin-subtitle {
  font-size: var(--fs-lg);
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.admin-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 2.25rem;
  margin-bottom: 2rem;
}

.admin-card h2 {
  font-size: var(--fs-xl);
  color: var(--color-brand-dark);
  margin-bottom: 0.5rem;
}

.admin-card>p {
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

/* ── Whitelist-Tabelle ── */
.table-responsive {
  overflow-x: auto;
}

.whitelist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-base);
}

.whitelist-table th {
  background: var(--color-brand);
  color: #fff;
  padding: 0.9rem 1.1rem;
  text-align: left;
  font-weight: 700;
  font-size: var(--fs-sm);
  letter-spacing: 0.5px;
}

.whitelist-table td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.whitelist-table tbody tr:hover {
  background: #f0f5ff;
}

.row-blocked td {
  opacity: 0.7;
  background: #fdf8f8;
}

.td-number {
  font-family: 'Courier New', monospace;
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--color-brand-dark);
  white-space: nowrap;
}

.td-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
}

.badge-ok {
  background: var(--color-success-bg);
  color: #1a5c35;
}

.badge-blocked {
  background: var(--color-danger-bg);
  color: #7b241c;
}

.no-entries {
  text-align: center;
  color: var(--color-text-muted);
  padding: 2rem;
  font-size: var(--fs-lg);
}

/* ── Impressum ── */
.impressum-section {
  padding: 4rem 0;
}

.impressum-inner {
  max-width: 640px;
}

.impressum-inner h1 {
  font-size: var(--fs-2xl);
  color: var(--color-brand-dark);
  margin-bottom: 1.5rem;
}

.impressum-inner address {
  font-style: normal;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  margin-bottom: 2rem;
  font-size: var(--fs-lg);
  line-height: 2;
  border-left: 5px solid var(--color-brand-light);
}

.impressum-back {
  margin-top: 1rem;
}

/* ── Footer ── */
.site-footer {
  background: #0e2038;
  color: #a9c4e0;
  padding: 1.5rem 0;
  font-size: var(--fs-sm);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-footer a {
  color: #7fc3f7;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 680px) {
  :root {
    --fs-base: 17px;
  }

  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 0.75rem 1.5rem;
  }

  .site-header {
    height: auto;
  }

  .hero-content {
    padding: 3rem 1rem;
  }

  .login-card {
    padding: 1.75rem 1.25rem;
  }

  .admin-card {
    padding: 1.25rem 1rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .btn {
    min-height: 48px;
  }

  /* Fix input height stretch on mobile */
  .form-inline {
    flex-direction: column;
  }

  .form-inline input[type="tel"] {
    width: 100%;
    flex: none;
  }

  /* Convert table to cards on mobile */
  .whitelist-table,
  .whitelist-table tbody,
  .whitelist-table tr,
  .whitelist-table td {
    display: block;
  }

  .whitelist-table thead {
    display: none;
  }

  .whitelist-table tr {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    margin-bottom: 1rem;
  }

  .whitelist-table td {
    padding: 0.25rem 0;
    border-bottom: none;
    text-align: center;
  }

  .td-number {
    font-size: var(--fs-xl);
    padding-bottom: 0.25rem;
  }

  .td-status {
    padding-bottom: 1.25rem;
  }

  .td-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .td-actions .inline-form,
  .td-actions .btn {
    width: 100%;
    display: block;
  }
}