body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 20px;
}

.form-container {
    max-width: 800px;
    margin: 0;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-title {
    font-size: 14pt;
    font-weight: bold;
    color: #000;
    text-align: center;
    margin-bottom: 30px;
    text-transform: uppercase;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 12pt;
    font-weight: bold;
    color: #000;
    margin-bottom: 8px;
}

/* Standard: Desktop */
.form-group input[type="text"] {
  width: 100%;
  max-width: 780px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12pt;
}

/* Mobile: Textfelder etwas schmaler */
@media (max-width: 768px) {
  .form-group input[type="text"] {
    width: 100%;
  }  
}

.file-upload-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.file-upload-label {
    display: inline-block;
    background: #0CA554;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
    min-width: 120px;
}

.file-upload-label:hover {
    background: white;
    color: #0CA554;
    border: 1px solid #0CA554;
}

.file-upload-label input[type="file"] {
    display: none;
}

.file-info {
    font-size: 0.8rem;
    color: #666;
}

.file-note {
    font-size: 0.7rem;
    color: #999;
    margin-top: 5px;
    font-style: italic;
}

.button-group {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
    padding: 0 10px;
}

.form-btn {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
    padding: 12px 5px;
    background: #0CA554;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-btn:hover {
    background: white;
    color: #0CA554;
    border: 1px solid #0CA554;
}

.back-btn {
    background: #f0f0f0 !important;
    color: #333 !important;
    border: 1px solid #ccc !important;
}

.back-btn:hover {
    background: #e0e0e0 !important;
    color: #000 !important;
    border-color: #aaa !important;
}

.date-group {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #ccc;
}

.date-display {
    padding: 10px;
    background-color: #f8f8f8;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 0.9rem;
    color: #333;
    margin-top: 5px;
}

.date-display::before {
    content: "🕒 ";
}

.date-display sup {
    font-size: 0.5em;
    vertical-align: super;
    line-height: 0;
    color: inherit;
}

#logoPreviewContainer img {
    background-color: white; /* Konsistenter Hintergrund */
    max-height: 100px;
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
} 

/* Responsive Button Group */
.button-group {
    flex-wrap: wrap; /* Erlaubt Umbruch der Buttons */
}

/* Responsive Button Group */
@media (max-width: 768px) {
    .button-group {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    /* Die ersten 3 Buttons (Embassy, Agreement, Declaration) */
    .button-group .form-btn:not(.back-btn) {
        flex: 1 1 calc(33.33% - 7px); /* 3 Buttons in einer Reihe mit minimalem Gap */
        min-width: 100px;
        max-width: none; /* Entfernt die max-width Beschränkung */
    }
    
    /* Back-Button - volle Breite */
     .button-group .back-btn {
        width: calc(100% - 20px); /* Containerbreite minus Padding */
        max-width: 500px; /* Maximalbreite für bessere Proportionen */
        margin: 10px auto 0; /* Zentrierung */
        order: 1;
    }
}

/* Konsistente Button-Höhe für alle Buttons */
.form-btn {
    height: 40px; /* Feste Höhe für alle Buttons */
    box-sizing: border-box;
}

/* Datumsanzeige in einer Linie */
@media (max-width: 768px) {
    .date-display {
        white-space: nowrap; /* Verhindert Zeilenumbruch */
        overflow-x: auto; /* Ermöglicht horizontales Scrollen falls nötig */
        padding: 10px 5px; /* Etwas weniger horizontales Padding */
        font-size: 0.8rem; /* Etwas kleinere Schrift */
        display: inline-block; /* Bessere Kontrolle über die Breite */
        max-width: 100%; /* Begrenzt auf Containerbreite */
    }

    .date-display sup {
        font-size: 0.5em; /* Etwas kleinere Hochstellung */
    }
}

/* Dropdown Menü für beide Formular  */

.dropdown-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
}
.dropdown-group label {
  font-weight: bold;
  margin-bottom: 0.25rem;
}
.dropdown-group select {
  padding: 0.5rem;
  font-size: 1rem;
}
@media (min-width: 768px) {
  .dropdown-group {
    max-width: 300px;
    margin-right: 2rem;
    float: left;
  }
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.dropdown-panel {
  flex: 1 1 250px;
  min-width: 200px;
}

.form-fields {
  flex: 3 1 500px;
  min-width: 300px;
}

.dropdown-panel label {
  font-weight: bold;
  display: block;
  margin-bottom: 0.5rem;
}

.dropdown-panel select {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
}

/* Layout Einstellung  */
.layout-container {
  display: flex;
  justify-content: center; /* zentriert beide Boxen */
  align-items: flex-start;
  gap: 16px; /* entspricht ca. 1 cm Abstand */
  padding: 2rem;
  background-color: #f0f0f0;
  flex-wrap: wrap;  
}

.form-container {
  flex: 0 1 65%;
  min-width: 320px;
  background: white;
  padding: 1.3rem;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  max-width: 800px;
        /* transform: scale(0.9); skaliert alles auf 90% */
  transform-origin: top center; /* skaliert vom oberen Zentrum */
}

.layout-container {
  overflow-y: auto; /* Scroll innerhalb des Containers */
  max-height: 90vh; /* auf Fensterhöhe begrenzen */
}

.side-panel {
  flex: 0 1 30%;
  min-width: 240px;
  max-width: 420px;
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

@media (max-width: 768px) {
  .layout-container {
    flex-direction: column;
    align-items: center;
  }

  .form-container,
  .side-panel {
    width: 100%;
    max-width: 100%;
  }
}

.side-panel h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.side-panel select {
  width: 100%;
  padding: 0.6rem;
  font-size: 1rem;
  border-radius: 5px;
  border: 1px solid #ccc;
}

/* Mobile: Dropdown unter die Eingabemaske */
@media (max-width: 768px) {
  .layout-container {
    display: block; /* Kein Flex mehr für Mobile */
  }

  .form-container {
    width: 100%;
    margin-bottom: 20px; /* Abstand nach unten */
  }

  .side-panel {
    width: 100%;
    max-width: 100%;
    margin-top: 10px; /* etwas Luft nach oben */
  }
}
#docgen-app select,
#docgen-app button {
    margin-top: 8px;
    margin-bottom: 12px;
}
/* ================================
   Styles für die Startseite (NICHT Canvas)
   ================================ */

/* Homepage-Layout beibehalten */
body:not(.docgen-canvas-page) .docgen-fullscreen-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body:not(.docgen-canvas-page) .docgen-fullscreen-canvas {
    width: 100%;
    margin: 0 auto;
}
