/**
 * Sdílený styl pro právní dokumenty (Obchodní podmínky, Reklamační řád, GDPR, formuláře).
 * Umístění: /www/css/legal.css
 */

.legal-container {
    max-width: 920px;
    margin: 0 auto;
    padding: 60px 20px;
}

/* Hero */
.legal-hero {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}
.legal-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 900;
    color: #1a1a1a;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
    line-height: 1.1;
}
.legal-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 4px;
    background: linear-gradient(90deg, #FF6B00, #ff8533);
    border-radius: 2px;
}
.legal-subtitle {
    font-size: 16px;
    color: #666;
    margin-top: 30px;
}

/* Navigation pills mezi dokumenty */
.legal-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 36px;
    flex-wrap: wrap;
    justify-content: center;
}
.legal-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #fff;
    border: 1.5px solid #ececec;
    border-radius: 999px;
    color: #555;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}
.legal-nav a:hover {
    border-color: #FF6B00;
    color: #FF6B00;
    transform: translateY(-1px);
}
.legal-nav a.is-active {
    background: linear-gradient(135deg, #FF6B00 0%, #ff8533 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(255, 107, 0, 0.25);
}

/* Obsah dokumentu */
.legal-content {
    background: #fff;
    border-radius: 18px;
    padding: 48px 44px;
    box-shadow: 0 6px 28px rgba(15, 10, 6, 0.06);
    line-height: 1.65;
    color: #2a2a2a;
    font-size: 15.5px;
}

.legal-content h2 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 40px 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #FF6B00;
    letter-spacing: -0.01em;
}
.legal-content h2:first-child {
    margin-top: 0;
}
.legal-content h3 {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 26px 0 12px;
}
.legal-content h4 {
    font-size: 15px;
    font-weight: 700;
    color: #444;
    margin: 18px 0 8px;
}
.legal-content p {
    margin: 0 0 14px;
}
.legal-content ul, .legal-content ol {
    margin: 8px 0 18px;
    padding-left: 24px;
}
.legal-content li {
    margin: 6px 0;
}
.legal-content strong, .legal-content b {
    color: #1a1a1a;
    font-weight: 700;
}
.legal-content a {
    color: #FF6B00;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}
.legal-content a:hover {
    border-bottom-color: #FF6B00;
}

/* Důležité bloky */
.legal-note {
    background: linear-gradient(135deg, #fff7ed 0%, #ffe8d4 100%);
    border-left: 4px solid #FF6B00;
    padding: 18px 22px;
    margin: 22px 0;
    border-radius: 0 12px 12px 0;
    font-size: 14.5px;
}
.legal-note strong {
    color: #c2410c;
}
.legal-note-warning {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left-color: #dc2626;
}
.legal-note-warning strong {
    color: #991b1b;
}
.legal-note-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left-color: #2563eb;
}
.legal-note-info strong {
    color: #1d4ed8;
}

/* Tabulka */
.legal-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: 14px;
}
.legal-content table th,
.legal-content table td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid #ececec;
    vertical-align: top;
}
.legal-content table th {
    background: #fafafa;
    font-weight: 700;
    color: #1a1a1a;
}

/* Effective date label — pill nad titulkem, vlastni radek, centrovany */
.legal-effective {
    display: block;
    width: fit-content;
    background: #1a1a1a;
    color: #fff;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin: 0 auto 22px;
    white-space: nowrap;
}
@media (max-width: 480px) {
    .legal-effective {
        font-size: 10.5px;
        padding: 6px 12px;
        letter-spacing: 0.6px;
        margin-bottom: 18px;
    }
}

/* Form */
.legal-form {
    background: #fafafa;
    border: 1.5px solid #ececec;
    border-radius: 14px;
    padding: 24px;
    margin: 20px 0;
}
.legal-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 14px;
}
.legal-form-row--full {
    grid-template-columns: 1fr;
}
.legal-form-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}
.legal-form-field input,
.legal-form-field textarea,
.legal-form-field select {
    width: 100%;
    max-width: 100%;
    padding: 11px 14px;
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
    /* 16px je MINIMUM aby iOS Safari pri focusu auto-nezoomoval */
    font-size: 16px;
    color: #1a1a1a;
    transition: border-color 0.2s ease;
}
.legal-form-field input:focus,
.legal-form-field textarea:focus,
.legal-form-field select:focus {
    outline: none;
    border-color: #FF6B00;
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.12);
}
.legal-form-field textarea {
    min-height: 80px;
    resize: vertical;
}

/* Checkboxes / radios v legal formularich */
.legal-form-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.legal-form-checkboxes label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.45;
    flex-wrap: wrap;
}
.legal-form-checkboxes input[type="checkbox"],
.legal-form-checkboxes input[type="radio"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: #FF6B00;
    margin: 0;
}
/* Inline input uvnitr checkbox labelu (napr. "Jine: ___") */
.legal-form-checkboxes label input[type="text"] {
    flex: 1;
    min-width: 0;
    max-width: 320px;
    padding: 8px 12px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 16px; /* zase 16px proti iOS zoom */
    font-family: inherit;
}
.legal-form-checkboxes label input[type="text"]:focus {
    outline: none;
    border-color: #FF6B00;
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.12);
}
.legal-form-actions {
    display: flex;
    justify-content: center;
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1.5px solid #ececec;
}
.legal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 38px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    text-decoration: none;
    border: 1.5px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    font-family: inherit;
    min-width: 260px;
    line-height: 1;
}
.legal-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.legal-btn--primary {
    background: linear-gradient(135deg, #FF6B00 0%, #ff8533 100%);
    color: #fff;
    box-shadow: 0 10px 24px rgba(255, 107, 0, 0.32);
}
.legal-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(255, 107, 0, 0.42);
    color: #fff;
}
.legal-btn--primary:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(255, 107, 0, 0.36);
}
.legal-btn--secondary {
    background: #fff;
    color: #555;
    border-color: #ddd;
}
.legal-btn--secondary:hover {
    border-color: #FF6B00;
    color: #FF6B00;
}
@media (max-width: 600px) {
    .legal-form-actions {
        margin-top: 24px;
        padding-top: 22px;
    }
    .legal-btn {
        width: 100%;
        min-width: 0;
        padding: 16px 24px;
        font-size: 14.5px;
    }
}

/* Závěr / podpis */
.legal-signature {
    margin-top: 50px;
    padding-top: 24px;
    border-top: 2px solid #ececec;
    text-align: right;
    font-size: 14px;
    color: #666;
}
.legal-signature strong {
    display: block;
    color: #1a1a1a;
    font-size: 15.5px;
    margin-bottom: 4px;
}

/* TOC / anchor links */
.legal-toc {
    background: #fafafa;
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 30px;
    font-size: 14px;
}
.legal-toc-title {
    font-weight: 700;
    margin-bottom: 8px;
    color: #1a1a1a;
}
.legal-toc ol {
    margin: 0;
    padding-left: 24px;
    columns: 2;
    column-gap: 24px;
}
.legal-toc li {
    margin: 4px 0;
    break-inside: avoid;
}
.legal-toc a {
    color: #555;
    text-decoration: none;
}
.legal-toc a:hover {
    color: #FF6B00;
}

/* Tiskovy view pro PDF generovani — skryty na obrazovce, viditelny pouze pri tisku */
.legal-print-view {
    display: none;
}

.legal-form-hint {
    margin-top: 14px;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    text-align: center;
    padding: 12px 18px;
    background: #fff8f1;
    border-radius: 10px;
    border-left: 3px solid #FF6B00;
}
.legal-form-hint strong {
    color: #1a1a1a;
}

/* ========== PRINT / PDF generovani ========== */
/* JS pred tiskem presune .legal-print-view jako primy potomek <body>,
   takze staci skryt vsechny ostatni primy potomky body. Tim se z layoutu
   uplne odstrani (zadne prazdne stranky kvuli vyske formulare). */
@media print {
    /* A4 layout */
    @page {
        size: A4;
        margin: 14mm 16mm;
    }

    html, body {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Skryt vse na strance KROME tiskoveho view */
    body > *:not(.legal-print-view) {
        display: none !important;
    }

    .legal-print-view {
        display: block !important;
        background: #fff;
        color: #000;
        font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
        font-size: 10.5pt;
        line-height: 1.5;
    }

    /* Hlavicka — adresat + datum */
    .print-header {
        display: flex;
        justify-content: space-between;
        gap: 18mm;
        padding-bottom: 5mm;
        border-bottom: 1.5pt solid #000;
        margin-bottom: 7mm;
    }
    .print-sender {
        font-size: 9.5pt;
        line-height: 1.4;
    }
    .print-sender strong {
        display: block;
        font-size: 11pt;
        text-transform: uppercase;
        letter-spacing: 0.4pt;
        margin-bottom: 1mm;
    }
    .print-date {
        font-size: 9.5pt;
        text-align: right;
        white-space: nowrap;
        line-height: 1.4;
    }

    /* Titulek dokumentu */
    .print-title {
        font-size: 16pt;
        font-weight: 800;
        text-align: center;
        margin: 0 0 2pt;
        text-transform: uppercase;
        letter-spacing: 0.4pt;
    }
    .print-subtitle {
        font-size: 9.5pt;
        text-align: center;
        color: #555;
        margin: 0 0 9mm;
        font-style: italic;
    }

    /* Sekce */
    .print-section {
        margin-bottom: 5mm;
        page-break-inside: avoid;
    }
    .print-section-title {
        font-size: 9pt;
        font-weight: 800;
        letter-spacing: 0.8pt;
        text-transform: uppercase;
        color: #444;
        margin: 0 0 2.5mm;
        padding-bottom: 1mm;
        border-bottom: 0.5pt solid #bbb;
    }

    /* Tabulka klic-hodnota */
    .print-table {
        width: 100%;
        border-collapse: collapse;
    }
    .print-table td {
        padding: 1.5pt 3pt;
        vertical-align: top;
        font-size: 10.5pt;
    }
    .print-table td:first-child {
        width: 42%;
        color: #555;
    }
    .print-table td:last-child {
        font-weight: 600;
        color: #000;
    }

    /* Telo dokumentu (souvisly text) */
    .print-body p {
        text-align: justify;
        margin: 0 0 3mm;
    }
    .print-bank {
        font-size: 12pt;
        font-weight: 800;
        margin: 3mm 0;
        letter-spacing: 0.4pt;
    }

    /* Checkboxy v tiskovem view */
    .print-checkboxes {
        margin: 0;
        padding: 0;
        list-style: none;
    }
    .print-checkboxes li {
        margin: 1.5mm 0;
        padding-left: 6mm;
        position: relative;
        font-size: 10.5pt;
    }
    .print-checkboxes li::before {
        content: '\2610'; /* prazdny ramecek */
        position: absolute;
        left: 0;
        top: -0.5pt;
        font-size: 13pt;
        line-height: 1;
    }
    .print-checkboxes li.is-checked::before {
        content: '\2612'; /* zaskrtnuty */
    }

    /* Podpis */
    .print-signature-area {
        margin-top: 14mm;
        display: flex;
        justify-content: flex-end;
    }
    .print-signature {
        text-align: center;
        width: 60mm;
    }
    .print-signature-line {
        border-bottom: 0.8pt solid #000;
        height: 12mm;
    }
    .print-signature-label {
        font-size: 9pt;
        color: #555;
        margin-top: 1.5mm;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .legal-container { padding: 30px 14px; }
    .legal-content { padding: 26px 18px; border-radius: 14px; }
    .legal-form { padding: 18px 16px; }
    .legal-form-row { grid-template-columns: 1fr; gap: 12px; }
    .legal-toc ol { columns: 1; }
}
@media (max-width: 420px) {
    .legal-container { padding: 24px 10px; }
    .legal-content { padding: 22px 14px; }
    .legal-form { padding: 16px 12px; }
    .legal-form-checkboxes label input[type="text"] {
        max-width: 100%;
    }
}
