/*
 * theme.css – Bootstrap 5 Theme für Pfefferwerk Mediengestaltung
 * Primärfarbe: #e3000f (Pfefferwerk-Rot)
 */

/* ── CSS-Variablen Override ─────────────────────────────────────────────────── */
:root {
    --pw-red: #e3000f;
    --pw-red-dark: #b5000c;
    --pw-red-light: #fde8e9;
    --pw-text: #1a1a1a;
    --pw-muted: #6c757d;
    --pw-border: #dee2e6;
    --pw-bg: #f0f2f5;
    --pw-bg-gradient: linear-gradient(var(--pw-bg), #fff);

    /* Bootstrap 5 Überschreibungen */
    --bs-primary: #e3000f;
    --bs-primary-rgb: 227, 0, 15;
    --bs-link-color: #e3000f;
    --bs-link-hover-color: #b5000c;
    --bs-focus-ring-color: rgba(227, 0, 15, 0.25);
}

/* ── Typografie & Basis ───────────────────────────────────────────────────────  */

/* Puffin Display wird über fonts/fonts.css eingebunden (siehe index.php <head>). */
body {
    font-family: 'Puffin Display', 'Segoe UI', Arial, sans-serif;
    background-color: var(--pw-bg);
    color: var(--pw-text);
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
.pw-branding .contact,
.card-title {
    font-family: 'Puffin Display', 'Segoe UI', Arial, sans-serif;
    font-weight: 700;
}

a {
    color: var(--pw-red);
}

a:hover {
    color: var(--pw-red-dark);
}

/* ── Header / Branding ───────────────────────────────────────────────────────  */
.pw-branding {
    background: #fff;
    border-bottom: 1px solid #ccc;
    padding: 2rem 0;
}

.pw-branding .logo img {
    max-height: 56px;
    width: auto;
}

.pw-branding .contact {
    font-size: 0.875rem;
    line-height: 1.6;
    text-align: right;
}

.pw-branding .contact a {
    color: var(--pw-red);
    text-decoration: none;
}

/* ── Flash-Overlay (zentrierte Erfolgs-/Fehlermeldung) ───────────────────────  */
.pw-flash-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.pw-flash-card {
    background: #fff;
    border-radius: 0;
    max-width: 480px;
    width: 100%;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    animation: pw-flash-in 0.25s ease;
}

@keyframes pw-flash-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pw-flash-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1.25rem;
}

.pw-flash-success .pw-flash-icon {
    background: #e8f5e9;
    color: #388e3c;
}

.pw-flash-error .pw-flash-icon {
    background: #fde8e9;
    color: var(--pw-red);
}

.pw-flash-title {
    font-family: 'Puffin Display', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: var(--pw-text);
}

.pw-flash-msg {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin: 0 0 1.75rem;
}

.pw-flash-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--pw-red);
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-family: 'Puffin Display', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.pw-flash-btn:hover {
    background: var(--pw-red-dark);
    color: #fff;
}

/* ── Gate Card (Intro-Hinweis) ───────────────────────────────────────────────  */
.pw-gate-wrap {
    max-width: 620px;
    margin: 2.5rem auto;
}

.pw-gate-card {
    background: #fff;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e3e8;
}

.pw-gate-header {
    background: var(--pw-red);
    /* Extra padding-bottom creates the slope space (tan(14°) × 620px ≈ 9.7rem) */
    padding: 2rem 2rem calc(1.75rem + 9.7rem);
}

.pw-gate-title {
    font-family: 'Puffin Display', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: #fff;
    margin: 0 0 0.3rem;
}

.pw-gate-sub {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.875rem;
    margin: 0;
}

.pw-gate-body {
    position: relative;
    z-index: 1;
    /* Overlaps the header by the slope height, clip removes the top-left triangle */
    margin-top: -9.7rem;
    padding: calc(9.7rem + 1.75rem) 2rem 2rem;
    clip-path: polygon(0 5.7rem, 101% 0, 100% 100%, 0 100%);
    background: #fff;
}

.pw-gate-body p {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--pw-text);
    margin-bottom: 0.8rem;
}

.pw-gate-body a {
    color: var(--pw-red);
    text-decoration: none;
}

.pw-gate-body a:hover {
    text-decoration: underline;
}

.pw-gate-pdf-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border: 1.5px solid var(--pw-border);
    text-decoration: none !important;
    color: var(--pw-text) !important;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 1.25rem 0;
    transition: border-color 0.15s, background 0.15s;
}

.pw-gate-pdf-link:hover {
    border-color: var(--pw-red);
    background: var(--pw-red-light);
    color: var(--pw-red-dark) !important;
}

.pw-gate-pdf-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.pw-gate-pdf-arrow {
    margin-left: auto;
    color: var(--pw-muted);
    font-size: 0.9rem;
}

.pw-gate-check {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #f8f9fa;
    border: 1.5px solid var(--pw-border);
    padding: 1rem 1.25rem;
    cursor: pointer;
    margin-bottom: 1.25rem;
    transition: border-color 0.15s, background 0.15s;
}

.pw-gate-check:has(input:checked) {
    border-color: var(--pw-red);
    background: var(--pw-red-light);
}

.pw-gate-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-top: 2px;
    accent-color: var(--pw-red);
    cursor: pointer;
}

.pw-gate-check-text {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--pw-text);
}

.pw-gate-btn {
    display: block;
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: var(--pw-red);
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-family: 'Puffin Display', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s, opacity 0.2s;
    text-align: center;
}

.pw-gate-btn:not(:disabled):hover {
    background: var(--pw-red-dark);
}

.pw-gate-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ── Stepper ─────────────────────────────────────────────────────────────────  */
.pw-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 1.5rem 2.2rem 2rem;
    overflow-x: auto;
}

.pw-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.pw-step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    color: var(--pw-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background 0.25s, color 0.25s, transform 0.2s;
    border: none;
}

.pw-step-label {
    font-size: 0.75rem;
    color: var(--pw-muted);
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.25s;
}

.pw-step.active .pw-step-num {
    background: #444;
    color: #fff;
    transform: scale(1.12);
}

.pw-step.active .pw-step-label {
    color: #444;
    font-weight: 700;
}

.pw-step.completed .pw-step-num {
    background: #6abf7b;
    color: #fff;
    border-color: #6abf7b;
}

.pw-step.completed .pw-step-label {
    color: #6abf7b;
}

.pw-step-line {
    flex: 1;
    min-width: 32px;
    height: 2px;
    background: var(--pw-border);
    align-self: center;
    margin-bottom: 20px;
    transition: background 0.25s;
}

.pw-step-line.completed {
    background: #6abf7b;
}

/* ── Formular-Card ───────────────────────────────────────────────────────────  */
.pw-form-card {
    border: 1px solid #e8eaed;
    border-radius: 0;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

.pw-form-card .card-body {
    padding: 2.25rem;
}

/* ── Bootstrap Primary Overrides ─────────────────────────────────────────────  */
.btn {
    border-radius: 9999px;
}

.btn-primary {
    --bs-btn-bg: var(--pw-red);
    --bs-btn-border-color: var(--pw-red);
    --bs-btn-hover-bg: var(--pw-red-dark);
    --bs-btn-hover-border-color: var(--pw-red-dark);
    --bs-btn-active-bg: var(--pw-red-dark);
    --bs-btn-focus-shadow-rgb: 227, 0, 15;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--pw-red);
    box-shadow: 0 0 0 0.2rem rgba(227, 0, 15, 0.2);
}

.form-check-input:checked {
    background-color: var(--pw-red);
    border-color: var(--pw-red);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(227, 0, 15, 0.2);
    border-color: var(--pw-red);
}

/* ── Produkt-Detailbereiche ──────────────────────────────────────────────────  */
.product-details {
    background: #fafafa;
    border: 1px solid var(--pw-border);
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.product-details h5 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--pw-muted);
    margin-bottom: 1rem;
}

/* ── Richtpreis-Badge ────────────────────────────────────────────────────────  */
#preis-info {
    border-left: 4px solid var(--pw-red) !important;
    background: var(--pw-red-light) !important;
}

#preis-value {
    background-color: var(--pw-red) !important;
    font-size: 0.875rem !important;
    padding: 0.3em 0.65em;
}

/* ── Zusammenfassung ─────────────────────────────────────────────────────────  */
.summary-section {
    border: 1px solid var(--pw-border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.summary-section-header {
    /* background: var(--pw-red-light); */
    background: transparent;
    border-bottom: 1px solid var(--pw-border);
    padding: 0.6rem 1rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--pw-red-dark);
    cursor: pointer;
}

.summary-section-body {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.summary-section-body dl {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 0.25rem 0.75rem;
    margin: 0;
}

.summary-section-body dt {
    color: var(--pw-muted);
    font-weight: 500;
}

.summary-section-body dd {
    margin: 0;
}

/* ── Prozessschritte (Info-Box unten) ────────────────────────────────────────  */
.process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.process-step {
    background: #fff;
    border: 1px solid var(--pw-border);
    border-radius: 6px;
    padding: 0.75rem;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.4;
}

.process-step strong {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 2px;
    color: var(--pw-red);
}

/* ── Validierungsfehler ──────────────────────────────────────────────────────  */
.is-invalid~.invalid-feedback {
    display: block;
}

.step-error-summary {
    font-size: 0.9rem;
}

/* ── Datei-Vorschau ──────────────────────────────────────────────────────────  */
.file-preview-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: #f8f9fa;
    border: 1px solid var(--pw-border);
    border-radius: 4px;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
}

.file-preview-item .file-icon {
    font-size: 1.1rem;
}

.file-preview-item .file-name {
    flex: 1;
}

.file-preview-item .file-size {
    color: var(--pw-muted);
    font-size: 0.8rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────────  */
@media (max-width: 576px) {
    .pw-form-card .card-body {
        padding: 1.25rem;
    }

    .pw-step-label {
        display: none;
    }

    .pw-step-line {
        min-width: 16px;
    }

    .summary-section-body dl {
        grid-template-columns: 1fr;
    }

    .summary-section-body dt::after {
        content: ':';
    }
}