/* --- SCHRIFTARTEN --- */
@font-face {
    font-family: 'BSWFont';
    src: url('../assets/font.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}
@font-face {
    font-family: 'BSWFontBody';
    src: url('../assets/fontS.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* --- GRUNDLAYOUT --- */
:root {
    --bsw-violett: rgb(121, 35, 81);
    --bsw-pink: rgb(207, 0, 85);
    --bsw-orange: rgb(238, 116, 2);
    --bg-dark: #121212;
    --panel-bg: #1e1e1e;
    --text-main: #ffffff;
    --input-bg: #2b2b2b;
    --border-col: #444;
}

body {
    font-family: 'BSWFontBody', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 400px;
    background: var(--panel-bg);
    padding: 15px;
    border-right: 1px solid var(--border-col);
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-shrink: 0;
    overflow-y: auto;
}

.control-group {
    background: #252525;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #333;
}
.control-group label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #bbb;
    margin-bottom: 6px;
    font-weight: bold;
}

select, textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-col);
    color: white;
    padding: 10px;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
}
textarea { resize: vertical; }

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 8px;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: white;
}
.btn-primary {
    background: linear-gradient(90deg, var(--bsw-pink), var(--bsw-orange));
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 15px rgba(207,0,85,0.4); }
.btn-secondary { background: #444; border: 1px solid #666; color: #fff; }
.btn-secondary:hover { background: #555; }

/* --- HAUPTBEREICH (STAGE) --- */
.main-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #000;
    position: relative;
    overflow: hidden;
}

.toolbar {
    height: 45px;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

#canvasContainer {
    flex: 1;
    display: flex;
    align-items: flex-start; /* WICHTIG: Oben bündig */
    justify-content: center;
    overflow-y: auto;
    padding: 40px;
    box-sizing: border-box;
}

#printCanvas {
    background: white;
    box-shadow: 0 0 60px rgba(0,0,0,0.7);
    transform-origin: top center;
    transition: transform 0.2s;
    margin-bottom: 50px;
}

/* LOADING OVERLAY */
#loadingOverlay {
    position: fixed; top:0; left:0; width:100%; height:100%;
    background:rgba(0,0,0,0.85); color:white;
    display:none; align-items:center; justify-content:center;
    flex-direction:column; z-index:9999; backdrop-filter: blur(5px);
}

/* --- DRUCK & FORMULAR STYLES --- */
.content-scaler {
    width: 210mm; 
    min-height: 297mm;
    padding: 15mm 20mm;
    box-sizing: border-box;
    background: white;
    transform-origin: top left;
}

/* Typografie im Formular */
.form-h1 {
    font-family: 'Helvetica Neue LT Heavy Condensed', 'Arial Narrow', sans-serif;
    text-transform: uppercase;
    font-size: 22pt;
    color: var(--bsw-violett);
    margin: 0 0 5px 0;
    letter-spacing: -0.5px;
}
.form-h2 {
    font-family: 'Helvetica Neue LT Heavy', Arial, sans-serif;
    font-size: 11pt;
    color: var(--bsw-orange);
    border-bottom: 1px solid #ddd;
    padding-bottom: 2px;
    margin-top: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
}
.form-p, .form-label, .form-div, .checkbox-item { 
    font-size: 9pt; color: #000; font-family: Arial, sans-serif; 
}

/* Header im Formular */
.form-header {
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; /* Logo und Adressbox oben bündig */
    border-bottom: 2px solid #333; 
    padding-bottom: 10px; 
    margin-bottom: 15px;
}

/* NEU: Bild Logo statt Text */
.form-logo-img {
    width: 60mm; /* Breite des Logos */
    height: auto;
    display: block;
}

.design-bar {
    height: 8px; width: 100%;
    background: linear-gradient(90deg, #792351 0%, #CF0055 50%, #EE7402 100%);
    margin-bottom: 15px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 80%);
}

/* Empfänger Box */
.recipient-box {
    border: none;              /* Kein Rahmen mehr */
    background-color: #fff;    /* Weißer Hintergrund */
    color: #000;               /* WICHTIG: Schwarze Schrift erzwingen */
    padding: 0;                /* Padding auf 0, damit der Text bündig mit dem Logo steht */
    width: 80mm; 
    font-size: 9pt; 
    line-height: 1.2; 
    font-family: Arial, sans-serif;
    min-height: 40mm;
}
.clean-print .recipient-box { border: none; background: none; padding: 0; }

/* Form Elements */
.form-row { display: flex; gap: 10px; margin-bottom: 6px; }
.form-group { flex: 1; }
.form-group label {
    display: block; font-size: 7.5pt; font-weight: bold;
    margin-bottom: 1px; color: #555; text-transform: uppercase;
    font-family: Arial, sans-serif;
}
.form-input {
    width: 100%; border: 1px solid #aaa; background: #f0f0f0;
    height: 22px; padding: 0 5px; box-sizing: border-box;
}
.checkbox-group { display: flex; gap: 15px; align-items: center; height: 22px; }
.box {
    width: 10px; height: 10px; border: 1px solid #000;
    background: #fff; display: inline-block; margin-right: 4px;
}
.legal-text {
    font-size: 6.5pt; text-align: justify; color: #444;
    line-height: 1.2; margin-top: 8px; font-family: Arial, sans-serif;
}
.signature-row { margin-top: 25px; display: flex; gap: 20px; font-family: Arial, sans-serif;}
.signature-line { border-top: 1px solid #000; flex: 1; padding-top: 4px; font-size: 7.5pt; }
