* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    color: #333;
}

header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #400D69;
    padding-bottom: 20px;
}

h1 {
    color: #400D69;
    font-size: 24px;
}

h2 {
    color: #400D69;
    border-left: 4px solid #E769E4;
    padding-left: 10px;
    font-size: 20px;
    margin-top: 30px;
}

h3 {
    color: #400D69;
    font-size: 18px;
    margin-top: 20px;
}

section {
    margin-bottom: 25px;
}

.signature {
    margin-top: 50px;
    padding: 20px;
    background: #e9e9e9;
    border-radius: 10px;
}

.document-actions {
    position: sticky;
    top: 10px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    z-index: 100;
}

.action-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo-link {
    display: block;
    height: 50px;
    width: 150px;
    min-width: 150px;
}

.logo {
    width: 100%;
    height: 100%;
    background-image: url(/app/static/images/logo_scrolled.webp);
    background-size: contain;
    background-position: left center;
    background-repeat: no-repeat;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
    flex: 1;
}

.action-btn {
    padding: 10px 20px;
    background: #400D69;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    line-height: normal;
}

.action-btn:hover {
    background: #E769E4;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .action-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .logo-link {
        margin: 0 auto;
        height: 40px;
        width: 120px;
    }

    .action-buttons {
        justify-content: center;
        width: 100%;
    }

    .action-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .action-btn {
        width: 200px;
        margin: 5px 0;
    }
}

@media print {
    .document-actions {
        display: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }

    header {
        page-break-after: avoid;
    }

    section {
        page-break-inside: avoid;
    }

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

    a {
        color: #000;
        text-decoration: underline;
    }

    @page {
        margin: 2cm;
        @top-right {
            content: "Kodama";
            font-size: 10pt;
        }
        @bottom-right {
            content: "Страница " counter(page) " из " counter(pages);
            font-size: 10pt;
        }
    }
}