/* ============================ */
/* Variablen & Grund-Reset      */
/* ============================ */

:root {
    --primary-color:   #84d6e8;
    --secondary-color: #01192C;   /* War vorher #1a2432 */
    --background-color:#01172B;   /* War vorher #0a1520 */
    --accent-color:    #ffffff;
    --text-color:      #ffffff;
    --border-radius:   4px;
    --circuit-color:   rgba(1, 31, 37, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================= */
/* Body / Hintergrund            */
/* ============================= */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* OPTIONAL: Circuit-Hintergrund */
.circuit-background {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
      radial-gradient(circle at 25% 25%, var(--circuit-color) 1px, transparent 1px) 0 0 / 50px 50px,
      radial-gradient(circle at 75% 75%, var(--circuit-color) 1px, transparent 1px) 0 0 / 50px 50px,
      linear-gradient(45deg, transparent 48%, var(--circuit-color) 48%, var(--circuit-color) 52%, transparent 52%) 0 0 / 50px 50px;
    pointer-events: none;
    opacity: 0.2;
    z-index: -1;
}

/* =========================== */
/* Template-Form spezifisch    */
/* =========================== */

/* Gesamter Formular-Container */
.template-form {
    max-width: 800px;
    margin: 120px auto 2rem;
    padding: 2rem;
    background: var(--secondary-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--primary-color);
}

.template-form h2 {
    margin-bottom: 2rem;
    color: var(--primary-color);
    text-align: center;
}

/* Form-Sektionen */
.form-section {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
}

.form-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Gemeinsame Abstände für Gruppen */
.form-group {
    margin-bottom: 1rem;
}

/* Zur Entfernung des Abstands – neue Klasse */
.no-margin {
    margin: 0;
}

/* Label & Input */
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.5rem;
    background: var(--background-color);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    color: var(--text-color);
}

/* Grid für "Small/Middle/Large" Inputs */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem; 
}

/* Error-Config: 3-Spalten-Layout */
.error-config {
    display: grid;
    grid-template-columns: auto 100px 150px;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.error-config label {
    margin: 0;
    cursor: help;
    transition: color 0.3s, text-decoration 0.3s;
}
.error-config label:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.error-config input[type="number"] {
    width: 100px;
}
.error-config input[type="checkbox"] {
    width: auto;
}

/* Zusätzliche Felder */
.additional-fields {
    display: none;
}
.error-config.has-additional .additional-fields {
    display: block;
    grid-column: 1 / -1;
    margin-top: 0.5rem;
    padding-left: 1rem;
}

/* Submit-Button-Bereich */
/* Aktualisierte .submit-section: ersetzt das alte Inline-Style */
.submit-section {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
    margin-top: 2rem;
}
.submit-section button {
    padding: 0.8rem 2rem;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    background: var(--primary-color);
    color: var(--background-color);
    cursor: pointer;
    transition: all 0.3s;
}
.submit-section button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--primary-color);
}

/* Neue Klasse für die Zeile mit Username und Password */
.auth-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* =========================== */
/* Overlay (während Analyse)   */
/* =========================== */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    display: none; /* standardmäßig versteckt */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    z-index: 9999;
    text-align: center;
}
.overlay h3 {
    margin-bottom: 1rem;
}
.overlay p {
    max-width: 600px;
    margin-bottom: 2rem;
    line-height: 1.4;
}
.spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid var(--primary-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================== */
/* Optional: Responsive        */
/* =========================== */
@media (max-width: 768px) {
    .template-form {
        margin: 80px auto 2rem;
        width: 90%;
    }
    .sites-grid {
        grid-template-columns: 1fr; 
    }
}

/* ============================= */
/* Footer (index.html)           */
/* ============================= */
footer {
  background: #1e1e1e;
  color: white;
  padding: 4rem 2rem 2rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.footer-links {
  display: flex;
  gap: 4rem;
}
.footer-links h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}
.footer-links ul {
  list-style: none;
}
.footer-links a {
  color: #fff;
  text-decoration: none;
  transition: color 0.3s;
}
.footer-links a:hover {
  color: var(--primary-color);
}
.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #333;
}
.footer-logo img {
  height: auto;
  display: block;
  margin-bottom: 1rem;
  max-width: 120px; /* oder ein anderer Wert */
}
/* ===========================
   Mobile/Tablet Fixes (Template)
   =========================== */

/* Tablet: weniger Breite, angenehmere Typo */
@media (max-width: 992px) {
  .template-form {
    margin: 90px auto 2rem;
    width: min(92%, 760px);
    padding: 1.25rem;
  }

  .template-form h2 {
    font-size: clamp(1.35rem, 2.2vw + 1rem, 1.75rem);
    line-height: 1.2;
  }

  .form-group label {
    font-size: 0.95rem;
  }

  .form-group input,
  .form-group select {
    font-size: 1rem;          /* iOS Zoom vermeiden */
    min-height: 44px;         /* bessere Touch-Ziele */
  }

  /* “Small / Middle / Large” nebeneinander -> 2 Spalten */
  .sites-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
  }

  /* Username + Password in eine Spalte, damit nichts gequetscht wird */
  .auth-row {
    flex-direction: column;
    align-items: stretch;
  }

  /* Dreispaltige Fehler-Konfig kompakter */
  .error-config {
    grid-template-columns: 1fr 90px 120px;
    gap: .75rem;
  }
  .error-config input[type="number"] { width: 100%; }
}

/* Phone: alles einspaltig, große Buttons */
@media (max-width: 600px) {
  .template-form {
    margin: 78px auto 1.5rem;
    width: 92%;
    padding: 1rem;
  }

  .template-form h2 {
    font-size: clamp(1.25rem, 5vw + .5rem, 1.6rem);
  }

  .form-section {
    padding: .75rem;
  }

  .form-group {
    margin-bottom: .85rem;
  }

  .sites-grid {
    grid-template-columns: 1fr; /* 1 Spalte */
    gap: .65rem;
  }

  .error-config {
    grid-template-columns: 1fr; /* 1 Spalte */
    gap: .5rem;
    align-items: start;
  }
  .error-config .additional-fields {
    padding-left: 0;
  }

  .auth-row {
    gap: .65rem;
  }

  .submit-section {
    gap: .65rem;
    margin-top: 1.25rem;
  }
  .submit-section button {
    width: 100%;
    min-height: 46px;
    font-size: 1rem;
  }

  /* Checkboxen etwas größer, besser klickbar */
  input[type="checkbox"] {
    inline-size: 20px;
    block-size: 20px;
  }

  /* Overlay-Texte etwas kleiner, damit nichts überläuft */
  .overlay { padding: 0 1rem; }
  .overlay p { max-width: 95vw; font-size: .95rem; }
}
/* Mobile Fix: Checkboxen & kleine Inputfelder skalieren */
@media (max-width: 600px) {

  /* Checkboxen größer machen */
  input[type="checkbox"] {
    width: 24px;
    height: 24px;
    accent-color: #4db8ff; /* passt zur Theme-Farbe */
    transform: scale(1.2);
  }

  /* Alle Number/Text Inputs kompakter, aber fingerfreundlich */
  input[type="number"],
  input[type="text"],
  input[type="password"],
  input[type="email"] {
    font-size: 1rem;
    min-height: 44px;     /* Touch-Ziel mind. 44px */
    width: 100%;          /* vollbreit im Container */
    box-sizing: border-box;
  }

  /* Die ganz kleinen "Zähler" rechts vom Label sollen nicht 100% sein */
  .error-config input[type="number"] {
    max-width: 80px;
    text-align: center;
  }

}
/* === MOBILE FORM FIX (<= 600px) ========================================= */
@media (max-width: 600px) {

  /* Layout: alles einspaltig, keine engen Rows nebeneinander */
  .form-row,
  .row,
  .form-group {
    display: block !important;
    width: 100% !important;
  }

  /* Spalten-/Grid-Container auf 1 Spalte zwingen (falls vorhanden) */
  .two-col,
  .columns,
  .form-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Label oben, Feld darunter */
  .form-row label,
  .form-group label {
    display: block;
    margin-bottom: 6px;
    line-height: 1.2;
  }

  /* Alle Text/Number-Inputs auf volle Breite und touch-freundlich */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  input[type="search"],
  select,
  textarea {
    width: 100% !important;
    min-height: 44px;           /* Finger friendly */
    box-sizing: border-box;
    font-size: 1rem;
  }

  /* Checkbox-Zeilen kompakt und klar anklickbar */
  .checkbox-row,
  .form-row input[type="checkbox"] + label,
  .form-group input[type="checkbox"] + label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
  }
  input[type="checkbox"] {
    width: 24px;
    height: 24px;
    accent-color: #4db8ff;
  }

  /* Die „Zähler“/kleinen Number-Felder rechts klein lassen */
  /* Falls du eine Klasse benutzt (z. B. error-config), hier anpassen */
  .error-config input[type="number"],
  .tiny,
  .count,
  .short {
    max-width: 90px !important;
    min-width: 70px;
    text-align: center;
    display: inline-block;
  }

  /* Sicherheitsnetz: rechts ausgerichtete, schmale Inputs, die
     im Desktop floaten, sollen auf Mobile nicht mehr „kleben“ */
  .form-row [style*="float:right"],
  .form-group [style*="float:right"] {
    float: none !important;
  }
}
