/* ==========================================================
   MARINEROTRADE PURCHASE AGREEMENT - STYLE.CSS
   Version: 2025.1
   ========================================================== */

/* ------------------------- */
/* GENERAL STYLES (Bildschirm) */
/* ------------------------- */
#marinerotrade-vertrag {
    font-family: Arial, sans-serif;
    line-height: 1.4;
    color: #333;
    width: 100%;
    max-width: 850px;
    margin: 20px auto;
    padding: 30px;
    border: 1px solid #ccc;
    background: #fff;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

#marinerotrade-vertrag h1 {
    text-align: center;
    font-size: 1.6em;
    color: #2c3e50;
}

#marinerotrade-vertrag h2.subtitle {
    text-align: center;
    font-size: 1.2em;
    color: #555;
    margin-bottom: 20px;
}

#marinerotrade-vertrag h3 {
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
    margin-top: 25px;
    color: #2c3e50;
}

#marinerotrade-vertrag .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

#marinerotrade-vertrag .form-group {
    width: 48%;
    min-width: 200px;
}

#marinerotrade-vertrag input,
#marinerotrade-vertrag select,
#marinerotrade-vertrag textarea {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* CHECKLIST */
#marinerotrade-vertrag .checklist {
    list-style: none;
    padding-left: 0;
}

#marinerotrade-vertrag .checklist li {
    margin-bottom: 5px;
}

/* SPEC GRID */
#marinerotrade-vertrag .spec-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

#marinerotrade-vertrag .spec-item {
    display: flex;
    flex-direction: column;
}

/* SIGNATURES */
#marinerotrade-vertrag .signature-section .form-group div {
    height: 60px;
    border-bottom: 2px dotted #000;
    margin-top: 20px;
}

#marinerotrade-vertrag .signature-section .form-group div span {
    font-size: 0.9em;
    color: #555;
}

/* BUTTON */
.print-button-container {
    margin-top: 40px;
    text-align: center;
}

.print-button-container button {
    font-size: 1.2em;
    padding: 15px 30px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.print-button-container button:hover {
    background: #2980b9;
}

/* ------------------------- */
/* RESPONSIVE - MOBILE/TABLET */
/* ------------------------- */
@media (max-width: 768px) {
    #marinerotrade-vertrag {
        padding: 15px;
    }

    #marinerotrade-vertrag h1 { font-size: 1.4em; }
    #marinerotrade-vertrag h2.subtitle { font-size: 1em; }
    #marinerotrade-vertrag h3 { font-size: 1.1em; }

    #marinerotrade-vertrag .form-group {
        width: 100%;
    }

    #marinerotrade-vertrag .spec-grid {
        grid-template-columns: 1fr !important;
    }
}


/* ========================================================== */
/* ------------------------- */
/* NEUE, ROBUSTE PRINT STYLES */
/* ------------------------- */
@media print {

    /* 1. Verstecke ALLES auf der Seite */
    body * {
        visibility: hidden !important;
    }

    /* 2. Mache NUR den Vertrag (#marinerotrade-vertrag) 
          und ALLES INNENDRIN wieder sichtbar */
    #marinerotrade-vertrag,
    #marinerotrade-vertrag * {
        visibility: visible !important;
    }

    /* 3. Platziere den Vertrag oben links auf der leeren Seite */
    #marinerotrade-vertrag {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: #fff !important;
        font-size: 12pt !important;
    }

    /* 4. Grundlegendes Seiten-Setup */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }
    
    @page {
        size: A4 portrait;
        margin: 15mm; /* Rand für den Drucker */
    }

    /* 5. Stelle sicher, dass ausgefüllte Felder (Text, Zahlen etc.) 
          korrekt gedruckt werden */
    #marinerotrade-vertrag input[type="text"],
    #marinerotrade-vertrag input[type="email"],
    #marinerotrade-vertrag input[type="date"],
    #marinerotrade-vertrag input[type="number"],
    #marinerotrade-vertrag input[type="tel"],
    #marinerotrade-vertrag textarea,
    #marinerotrade-vertrag select {
        border: none !important;
        border-bottom: 1px dotted #333 !important; 
        background: transparent !important;
        width: 100% !important;
        padding: 2px 0 !important;
        margin: 0 !important;
        font-size: 12pt !important;
        color: #000 !important;
    }
    
    /* WICHTIG: Checkboxen und Radio-Buttons werden hier NICHT
       formatiert, damit der Browser ihren 'angehakten' Status drucken kann. */

    /* 6. Verhindere, dass Elemente unschön umbrochen werden */
    .form-row, .form-group, .spec-grid, .spec-item, .signature-section {
        page-break-inside: avoid !important;
    }

    h1, h2, h3, h4 {
        page-break-after: avoid;
    }

    /* 7. Der Druck-Button ist durch Schritt 1 schon versteckt,
       aber wir fügen es zur Sicherheit hinzu. */
    .print-button-container {
        display: none !important;
    }
}