/* ============================================================
   FRONTEND CSS – "Abend für die Feuerwehr"
   Matches the official flyer layout (PDF)
   ============================================================ */

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

:root {
  /* Flyer colors */
  --yellow: #f0b800;
  --yellow-light: #f5c518;
  --red: #cc0000;
  --red-dark: #a00000;
  --dark: #1a1a1a;
  --gray-bg: #5a5a5a;
  --gray-footer: #6b6b6b;
  --gray-light: #e0e0e0;
  --white: #ffffff;
  --text-dark: #222;
  --text-gray: #444;

  /* Fonts */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans 3', 'Source Sans Pro', sans-serif;

  /* Layout */
  --photo-width: 38%;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--dark);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================================
   OFFLINE STATE
   ============================================================ */
.offline-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(145deg, var(--dark) 0%, #2a2a2a 100%);
  padding: 2rem;
}

.offline-card {
  background: var(--white);
  border-radius: 4px;
  padding: 3rem 4rem;
  text-align: center;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.offline-card h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--dark);
  margin-bottom: 1rem;
}

.offline-divider {
  width: 60px;
  height: 4px;
  background: var(--red);
  margin: 0 auto 1.5rem;
  border-radius: 2px;
}

.offline-message {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.offline-sub {
  font-size: 0.95rem;
  color: #777;
  font-weight: 300;
}

/* ============================================================
   HERO SECTION – Two-column: Photo Left | Yellow Right
   Matches the PDF layout exactly
   ============================================================ */
.hero {
  display: flex;
  min-height: 72vh;
  position: relative;
}

/* Left column: Rathaus photo */
.hero-photo {
  width: var(--photo-width);
  min-height: 100%;
  background: url('../img/rathaus.png') center center / cover no-repeat;
  background-color: #3a4a5a; /* fallback */
  position: relative;
  flex-shrink: 0;
}

/* Subtle overlay to blend photo edge */
.hero-photo::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 30px;
  height: 100%;
  background: linear-gradient(to right, transparent, var(--yellow));
  pointer-events: none;
}

/* Right column: Yellow area */
.hero-main {
  flex: 1;
  background: var(--yellow);
  padding: 2.5rem 3rem 2rem 3rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Title */
.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3.2rem);
  color: var(--white);
  text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.15);
  margin-bottom: 0.4rem;
  line-height: 1.15;
}

/* Date & Location */
.hero-date {
  font-family: var(--font-display);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(1rem, 2vw, 1.35rem);
  color: var(--white);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.12);
  margin-bottom: 1.5rem;
}

/* ============================================================
   WORD CLOUD – framed box on yellow background
   ============================================================ */
.wordcloud-frame {
  flex: 1;
  border: 2px solid var(--dark);
  border-radius: 3px;
  margin-top: 0.5rem;
  position: relative;
  min-height: 320px;
  overflow: hidden;
}

.wordcloud {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
  padding: 1rem;
}

/* Word cloud items base */
.wc {
  position: absolute;
  font-family: var(--font-body);
  color: var(--text-dark);
  white-space: nowrap;
  user-select: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  cursor: default;
}

.wc:hover {
  transform: scale(1.08);
  opacity: 0.8;
}

/* Size classes matching the flyer's hierarchy */
.wc-1 {
  font-size: clamp(0.85rem, 1.3vw, 1.1rem);
  font-weight: 400;
}

.wc-2 {
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  font-weight: 600;
}

.wc-3 {
  font-size: clamp(1.1rem, 2.2vw, 1.7rem);
  font-weight: 700;
}

.wc-4 {
  font-size: clamp(0.75rem, 1.1vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.wc-5 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
}

/* Red accent words (like in the flyer) */
.wc-red {
  color: var(--red);
}

/* ============================================================
   FORM SECTION – Gray bar at bottom (matching PDF)
   ============================================================ */
.form-section {
  background: var(--gray-bg);
  padding: 2rem 3rem;
}

.form-container {
  max-width: 1200px;
  margin: 0 auto;
}

.form-headline {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--yellow-light);
  margin-bottom: 1.2rem;
}

/* Inline form row (Vorname, Name, Mail, BF/FF) */
.form-row-inline {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-group {
  flex: 1;
  min-width: 160px;
}

.form-group-email {
  flex: 1.5;
}

.form-group-unit {
  flex: 0 0 auto;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--white);
  margin-bottom: 0.35rem;
}

.form-group input[type="text"],
.form-group input[type="email"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  font-family: var(--font-body);
  border: 2px solid transparent;
  border-radius: 3px;
  background: var(--white);
  color: var(--text-dark);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(240, 184, 0, 0.25);
}

/* BF / FF radio buttons styled as boxes (matching PDF) */
.bf-ff-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.checkbox-card {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.cb-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--white);
}

.cb-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cb-box input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cb-visual {
  width: 36px;
  height: 36px;
  background: var(--white);
  border: 2px solid transparent;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.cb-check {
  opacity: 0;
  transition: opacity 0.15s ease;
  color: var(--dark);
}

.cb-box input[type="radio"]:checked ~ .cb-visual {
  border-color: var(--yellow);
}

.cb-box input[type="radio"]:checked ~ .cb-visual .cb-check {
  opacity: 1;
}

.checkbox-card.checked .cb-visual {
  border-color: var(--yellow);
}

.checkbox-card.checked .cb-check {
  opacity: 1;
}

/* Submit button */
.btn-submit {
  display: inline-block;
  margin-top: 1.2rem;
  padding: 0.7rem 2.5rem;
  background: var(--yellow);
  color: var(--dark);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-submit:hover {
  background: var(--yellow-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-submit:active {
  transform: translateY(0);
}

/* Field errors */
.field-error {
  font-size: 0.8rem;
  color: #ff6b6b;
  margin-top: 0.25rem;
  min-height: 1em;
}

/* Error box (server-side) */
.error-box {
  background: rgba(204, 0, 0, 0.15);
  border-left: 4px solid var(--red);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 2px;
}

.error-box p {
  color: #ffcccc;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.error-box p:last-child {
  margin-bottom: 0;
}

/* Success card */
.success-card {
  text-align: center;
  padding: 2rem;
}

.success-icon {
  margin-bottom: 1rem;
}

.success-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.success-card p {
  color: var(--gray-light);
  font-size: 1rem;
}

/* ============================================================
   FOOTER – Gray bar with three logos
   ============================================================ */
.site-footer {
  background: var(--gray-footer);
  padding: 1.5rem 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 2rem;
}

.footer-logo {
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.footer-logo:hover {
  opacity: 1;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablets */
@media (max-width: 1024px) {
  .hero-main {
    padding: 2rem 2rem 1.5rem 2rem;
  }

  .form-section {
    padding: 1.5rem 2rem;
  }

  .site-footer {
    padding: 1.5rem 2rem;
  }
}

/* Mobile landscape / small tablets */
@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    min-height: auto;
  }

  .hero-photo {
    width: 100%;
    height: 35vh;
    min-height: 220px;
  }

  .hero-photo::after {
    width: 100%;
    height: 30px;
    top: auto;
    bottom: 0;
    right: 0;
    background: linear-gradient(to bottom, transparent, var(--yellow));
  }

  .hero-main {
    padding: 1.5rem 1.5rem 1.5rem 1.5rem;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .hero-date {
    font-size: 1rem;
  }

  .wordcloud-frame {
    min-height: 280px;
  }

  .wordcloud {
    min-height: 280px;
  }

  .form-section {
    padding: 1.5rem 1.5rem;
  }

  .form-row-inline {
    flex-direction: column;
    gap: 0.75rem;
  }

  .form-group,
  .form-group-email {
    min-width: 100%;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1.5rem;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.5rem;
  }

  .hero-date {
    font-size: 0.9rem;
  }

  .wc-5 {
    font-size: 1.4rem;
  }

  .wc-3 {
    font-size: 1.1rem;
  }

  .wc-2 {
    font-size: 0.95rem;
  }

  .wc-1 {
    font-size: 0.8rem;
  }

  .form-headline {
    font-size: 1.05rem;
  }

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

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  body {
    background: white;
  }

  .hero-photo {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .btn-submit {
    display: none;
  }
}