/* ═══════════════════════════════════════════════════════
   Feuerwehr Meschede – Portal Stylesheet
   ═══════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --red:        #CC0000;
  --red-dark:   #a80000;
  --red-light:  #f9eded;
  --bg:         #F0F2F5;
  --surface:    #FFFFFF;
  --surface2:   #F4F5F7;
  --border:     #E2E5EA;
  --text:       #111318;
  --text-soft:  #374151;
  --muted:      #6B7280;
  --ok:         #166534;
  --ok-bg:      #dcfce7;
  --err-bg:     #fee2e2;
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg:  0 10px 40px rgba(0,0,0,0.12);
  --radius:     10px;
  --radius-lg:  14px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ─── HEADER ─── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 100;
}
.header-top { background: var(--red); height: 4px; }
.header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px;
}
.header-logo { height: 44px; width: auto; flex-shrink: 0; }
.header-title { flex: 1; }
.header-title h1 {
  font-weight: 800; font-size: 1.1rem;
  letter-spacing: -0.3px;
  color: var(--text); line-height: 1.15;
}
.header-title p {
  font-size: 0.7rem; color: var(--muted);
  letter-spacing: 0.2px; margin-top: 1px;
  font-weight: 400;
}
.btn-admin-trigger {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted); padding: 7px 13px;
  border-radius: var(--radius); cursor: pointer;
  font-size: 0.78rem; font-weight: 600;
  text-decoration: none;
  transition: all 0.15s; display: inline-flex;
  align-items: center; gap: 5px;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.1px;
}
.btn-admin-trigger:hover {
  background: #e9ebee; border-color: #c5c9d0; color: var(--text);
}
.btn-admin-trigger .lbl { font-size: 0.78rem; }

/* ─── HERO ─── */
.hero {
  background: linear-gradient(160deg, #CC0000 0%, #8a0000 100%);
  color: #fff; padding: 32px 28px; text-align: center;
}
.hero h2 {
  font-weight: 800; font-size: 1.6rem;
  letter-spacing: -0.5px; margin-bottom: 6px;
  line-height: 1.2;
}
.hero p { font-size: 0.9rem; opacity: 0.85; font-weight: 400; }

/* ─── MAIN ─── */
main {
  flex: 1; max-width: 1200px;
  margin: 0 auto; width: 100%;
  padding: 0 28px 56px;
}
.admin-body main { max-width: 740px !important; }

/* ─── SECTION LABEL ─── */
.section-label {
  margin: 36px 0 16px;
  display: flex; align-items: center; gap: 12px;
}
.section-label .lt {
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
.section-label::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ─── GRID ─── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

/* ─── TILE ─── */
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 20px 20px;
  text-decoration: none; color: var(--text);
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  gap: 0;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform 0.17s ease, box-shadow 0.17s ease;
}
.tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* Icon – large, centered */
.tile-icon {
  font-size: 2.8rem; line-height: 1;
  margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center;
  min-height: 3rem;
}
.tile-icon img  { max-height: 3rem; width: auto; display: block; }
.tile-icon svg  { height: 3rem;  width: auto; display: block; }

/* Title */
.tile-title {
  font-weight: 700; font-size: 0.97rem;
  letter-spacing: -0.2px;
  color: var(--text); line-height: 1.25;
  margin-bottom: 8px;
}

/* Description */
.tile-desc {
  font-size: 0.78rem; color: var(--muted);
  line-height: 1.5; margin-bottom: 18px;
  flex: 1;
}

/* CTA button at bottom */
.tile-btn {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.3px;
  padding: 7px 16px;
  border-radius: 20px;
  transition: background 0.15s;
  margin-top: auto;
}
.tile:hover .tile-btn { background: var(--red-dark); }

/* Badge (top-right, small) */
.tile-badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 0.58rem; font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase;
  padding: 2px 8px; border-radius: 20px;
  background: var(--surface2); color: var(--muted);
  border: 1px solid var(--border);
}
.tile-badge.auth {
  background: var(--red-light); color: var(--red); border-color: #f5c0c0;
}

/* ─── FOOTER ─── */
footer {
  text-align: center; padding: 16px;
  font-size: 0.68rem; color: #aaa; font-weight: 400;
  border-top: 1px solid var(--border); background: var(--surface);
  letter-spacing: 0.3px; margin-top: auto;
}

/* ─── ADMIN STYLES ─── */
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 24px;
  box-shadow: var(--shadow-sm);
}
.admin-h2 {
  font-weight: 800; font-size: 1.15rem;
  letter-spacing: -0.3px; color: var(--text);
}
.admin-h3 {
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--red); margin-bottom: 14px;
}

.inp {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: 'Inter', sans-serif; font-size: 0.84rem;
  color: var(--text); background: var(--surface2); outline: none;
  transition: border-color .18s;
}
.inp:focus { border-color: var(--red); background: var(--surface); }
.inp-check {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; color: var(--muted); cursor: pointer;
  padding: 9px 0;
}

.btn-primary {
  padding: 10px 20px; background: var(--red); color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.84rem; font-weight: 700; letter-spacing: 0.2px;
  border: none; border-radius: var(--radius); cursor: pointer; transition: background .15s;
}
.btn-primary:hover { background: var(--red-dark); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-full { width: 100%; }
.btn-sm {
  padding: 7px 13px; border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem; font-weight: 600;
  cursor: pointer; border: none; white-space: nowrap; transition: background .15s;
}
.btn-danger  { background: #fee2e2; color: #991b1b; }
.btn-danger:hover  { background: #fecaca; }
.btn-success { background: #dcfce7; color: #166534; }
.btn-success:hover { background: #bbf7d0; }

.alert {
  padding: 11px 15px; border-radius: var(--radius);
  font-size: 0.83rem; margin-bottom: 14px; margin-top: 16px;
  font-weight: 500;
}
.alert-ok  { background: var(--ok-bg);  color: var(--ok);  border: 1px solid #86efac; }
.alert-err { background: var(--err-bg); color: #991b1b;    border: 1px solid #fca5a5; }

.grid-pw {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 8px; align-items: end;
}
.grid-4 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.grid-2b { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid-2b .btn-success { grid-column: span 2; }

.add-tile-form {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.form-label {
  font-size: 0.7rem; color: var(--muted); font-weight: 500;
  letter-spacing: 0.3px; margin-bottom: 10px;
}

/* Kachel-Liste Admin */
.tile-list { list-style: none; }
.tile-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.82rem;
}
.tile-list li:last-child { border-bottom: none; }
.tl-icon { font-size: 1.2rem; flex-shrink: 0; min-width: 24px; }
.tl-icon img { height: 1.4rem; width: auto; }
.tl-name { flex: 1; font-weight: 600; color: var(--text); }
.tl-url  { flex: 2; color: var(--muted); font-size: 0.73rem; word-break: break-all; }

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
  .header-inner { padding: 12px 16px; }
  .header-title p { display: none; }
  .hero { padding: 24px 16px; }
  .hero h2 { font-size: 1.3rem; }
  main { padding: 0 16px 40px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tile { padding: 22px 14px 16px; }
  .tile-icon { font-size: 2.2rem; }
  .grid-pw { grid-template-columns: 1fr; }
  .grid-4, .grid-2b { grid-template-columns: 1fr; }
  .admin-card { padding: 16px; }
  .tl-url { display: none; }
}
@media (max-width: 360px) {
  .grid { grid-template-columns: 1fr; }
}
