/* Globale Design-Variablen (Farben, Abstände, Radien) */
:root {
  --primary: #75c9dc; /* CICD Sachtblau*/
  --primary-hover: #c5f1fb; /* CICD Sachtblau 60%*/
  --bg-color: #fdf9f2; /* CICD Pergamentweiss 20%*/
  --surface: #ffffff;
  --text-main: #1d1d1d; /* CICD Dunkle Kohle*/
  --text-dark: #1d1d1d; /* CICD Dunkle Kohle*/
  --text-muted: #5d5d5d; /* CICD Dunkle Kohle 60%*/
  --border: #edc89d;
  --border-focus: #75c9dc; /* CICD Sachtblau*/
  --error: #ef4444;
  --error-bg: #fef2f2;
  --success: #d5e4ac; /* CICD Sachtgrün*/
  --success-bg: #e9eed9; /* CICD Sachtgrün 20%*/
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

/* Universeller Reset für Abstände und Box-Berechnung */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Layout und Standardwerte für die gesamte Seite */
body {
  font-family: helvetica, arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  max-width: 860px;
  margin: 60px auto;
  padding: 0 20px 0 100px; /* Platz für den Streifen links */
  line-height: 1.6;
  position: relative;
}

/* Fixierter Hintergrund-Zierstreifen */
.decoration-stripe {
  position: fixed;
  left: 0;
  top: 50%;
  width: auto;
  height: 80vh;
  z-index: -1;
  pointer-events: none;
  transform: translateY(-50%);
}

/* Hauptüberschriften */
h1 {
  font-size: 2.75rem;
  font-weight: 800;
  text-align: center;
  color: var(--text-dark);
  margin-bottom: 40px;
  letter-spacing: -0.03em;
}

/* Firmenlogo im Header */
img.logo {
  display: block;
  width: 450px;
  max-width: 100%;
  margin: 0 auto 20px;
  height: auto;
}

/* Formular-Container */
form {
  background: var(--surface);
  padding: 40px 48px;
  border-radius: var(--radius-lg);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 10px 15px -3px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.02);
}

/* Flexbox-Raster für zweispaltige Zeilen */
.row {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}

/* Spalten-Verhalten */
.col {
  flex: 1;
  min-width: 0;
}

/* Beschriftungen (Labels) */
label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-dark);
  margin-bottom: 8px;
}

/* Vertikale Abstände für direkt untereinanderliegende Formular-Elemente */
form > select,
form > input,
form > textarea {
  margin-bottom: 24px;
}

/* Styling für alle Standard-Eingabefelder, Dropdowns und Textbereiche */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-dark);
  background-color: #f8fafc;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease-in-out;
  font-family: inherit;
}

/* Spezifische Regeln für das Bemerkungsfeld */
textarea {
  resize: vertical;
  min-height: 120px;
}

/* Custom-Pfeil für Dropdowns (Select-Menüs) */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 48px;
}

/* Hover-Effekt für Eingabefelder */
input:hover,
select:hover,
textarea:hover {
  box-shadow: inset 0 0 0 1px #94a3b8;
}

/* Fokus-Effekt für aktive Eingabefelder */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow:
    inset 0 0 0 1px var(--border-focus),
    0 0 0 4px rgba(59, 130, 246, 0.15);
  background-color: #ffffff;
}

/* Schaltflächen und primäre/sekundäre Link-Buttons */
button,
a.primary,
a.secondary {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 16px 24px;
  font-size: 1.125rem;
  font-weight: 600;
  color: #ffffff;
  background-color: var(--primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

/* Sekundärer Button (z.B. "Zurück zum Bearbeiten") */
a.secondary {
  background-color: #f3a243;
  color: var(--text-dark);
}

/* Hover-Animationen für Buttons */
button:hover,
a.primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

a.secondary:hover {
  background-color: #f8b66a;
}

/* Klick-Effekt für Buttons */
button:active,
a:active {
  transform: translateY(0);
}

/* Kleine Hilfstexte und Zeichenzähler */
.small {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: -16px;
  margin-bottom: 24px;
  display: block;
}

/* CSS-Klasse für fehlerhafte Client-Eingaben (wird per JS zugewiesen) */
.invalid {
  box-shadow: inset 0 0 0 1px var(--error) !important;
  background-color: var(--error-bg) !important;
}

/* Allgemeine Fehlermeldungs-Texte */
.error {
  color: var(--error);
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 8px;
  display: block;
}

/* Spezifische Abstände für Fehlertexte innerhalb des Formulars */
form > .error {
  margin-top: -16px;
  margin-bottom: 24px;
}

/* Allgemeine Fehlermeldungs-Boxen außerhalb von Formularen */
div.error:not(form .error) {
  background-color: var(--error-bg);
  border: 1px solid #fecaca;
  color: var(--error);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  margin-top: 0;
}

/* Allgemeine Erfolgsmeldungs-Boxen */
div.success {
  background-color: var(--success-bg);
  border: 1px solid #a7f3d0;
  color: var(--success);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-weight: 500;
}

/* Zusammenfassende Datentabelle (validation.php) */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 30px 0;
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Zellen-Inhalte der Tabelle */
th,
td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

/* Tabellen-Kopfspalte für die Bezeichnungen */
th {
  background: #f8fafc;
  font-weight: 600;
  width: 35%;
  color: var(--text-dark);
}

/* Responsive Design: Tablet-Ansicht (max. 768px) */
@media (max-width: 768px) {
  form {
    padding: 32px 24px;
  }
  .row {
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
  }
}

/* Inhalts-Wrapper für Validierungs- und Erfolgsseiten */
.wrapper {
  max-width: 800px;
  margin: 0 auto;
}

/* Layout für die Aktions-Schaltflächen */
.actions {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

/* Reset für das unsichtbare Weiterleitungsformular auf der Validierungsseite */
.actions form {
  background: none;
  padding: 0;
  border: none;
  margin: 0;
  box-shadow: none;
}

/* Moderner Seiten-Footer */
footer {
  margin-top: 60px;
  padding: 30px;
  background-color: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

footer p {
  margin-bottom: 10px;
}

footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease-in-out;
}

footer a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Ausrichtung der Links im Footer */
footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* Korrektur für Buttons innerhalb von Aktionsbereichen */
.actions button {
  margin-top: 0;
}

/* Styling für die eigenständige Erfolgsseite (success.php) */
.success-page {
  text-align: center;
  max-width: 600px;
  margin: 80px auto;
  padding: 60px 40px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.success-page h1 {
  color: var(--success);
  margin-bottom: 24px;
}

.success-page p {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.success-page a {
  display: inline-block;
  background-color: var(--primary);
  color: #fff;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  text-decoration: none;
  margin-top: 0;
}

.success-page a:hover {
  background: #1e53d4;
}

/* Responsive Design: Smartphone-Ansicht (max. 720px) */
@media (max-width: 720px) {
  body {
    margin: 16px auto;
    padding: 0 12px;
  }

  .row {
    flex-direction: column;
    gap: 0;
    margin-right: 0;
  }

  button,
  a.primary,
  a.secondary {
    width: 100%;
  }

  .actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .actions a,
  .actions button {
    width: 100%;
  }

  table {
    font-size: 0.9em;
  }

  th,
  td {
    padding: 0.5rem;
  }
}

/* Styling für die Server-Fehlerübersichtsbox (validation.php) */
.validation-error-box {
  background: #fff5f5;
  border: 1px solid #f5c2c7;
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  color: #842029;
}

.validation-error-box strong {
  display: block;
  margin-bottom: 8px;
}

.validation-error-box ul {
  margin-left: 20px;
  margin-bottom: 12px;
}

.validation-error-box li {
  margin-bottom: 4px;
}
