@font-face {
    font-family: Roboto;
    src: url(../_fonts/roboto-v29-latin-ext_latin-regular.woff);
}

@font-face {
    font-family: Roboto-Medium;
    src: url(../_fonts/Roboto-Medium.woff);
}

html,
body {
    background: url(../_img/bg.jpg) no-repeat center center fixed;
    background-size: cover;
    font-family: Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 15px;
    line-height: 1.6;
    color: #1f2937;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: #f3f4f6;
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

p {
    margin-top: 0;
    margin-bottom: 0.9rem;
}

h1,
h2,
h3,
h4,
h5 {
    font-family: Roboto-Medium, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 500;
    color: #111827;
    margin: 0;
}

h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

h2 {
    font-size: 1.45rem;
}

h3 {
    font-size: 1.05rem;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 16px;
}

.page-card {
    max-width: 960px;
    background: rgba(255, 255, 255, 0.96);
    padding: 36px 36px 28px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(2px);
}

.page-header,
.content-section {
    width: 100%;
}

.logo-row {
    text-align: right;
}

.header-logo {
    width: 72px !important;
    min-width: 72px;
    max-width: 72px;
    height: auto !important;
    display: inline-block;
}

.kicker {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: #6b7280;
}

.intro,
.section-intro,
.intro-note {
    display: block;
    width: 100%;
    max-width: none;
}

.intro-note,
.helper-text,
.status-inline {
    color: #4b5563;
}

.content-section {
    margin-bottom: 36px;
}

.section-heading {
    margin-top: 22px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.config-panel,
.table-card {
    padding: 18px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f8fafc;
}

.table-card {
    padding: 0;
}

.form-label-column {
    padding-top: 6px;
}

.field-label {
    font-family: Roboto-Medium, Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #111827;
    margin-bottom: 0;
}

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.action-bar-results {
    margin-bottom: 18px;
}

.action-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.signature-preview-shell {
    min-height: 92px;
    display: flex;
    align-items: center;
    padding: 18px 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
}

.signature-preview-shell img {
    max-height: 72px;
    max-width: 100%;
    object-fit: contain;
}

.preview-card {
    overflow: hidden;
}

.preview-pdf,
.preview-html {
    min-height: 620px;
    background: #e5e7eb;
}

.preview-pdf-frame {
    display: block;
    width: 100%;
    min-height: 720px;
    border: 0;
    background: #ffffff;
}

.preview-html {
    background: #eef2f7;
    padding: 24px;
}

.preview-document {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.letter-sheet {
    width: 100%;
    max-width: 794px;
    margin: 0 auto;
    padding: 28px 34px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

.letter-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.letter-affiliation {
    font-size: 0.92rem;
    color: #475569;
    white-space: pre-line;
}

.letter-logo {
    width: 72px;
    min-width: 72px;
    height: auto;
}

.letter-title {
    margin-bottom: 18px;
}

.participant-name {
    margin: 16px 0;
    font-family: Roboto-Medium, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.1rem;
    text-align: center;
    color: #111827;
}

.participant-name.is-blank {
    letter-spacing: 0.04em;
    font-weight: 400;
}

.contact-list,
.intro-list {
    margin: 0;
    padding-left: 1.2rem;
}

.contact-list li,
.intro-list li {
    margin-bottom: 0.45rem;
}

.signature-block {
    margin-top: 28px;
}

.signature-image {
    height: 56px;
    max-width: 220px;
    object-fit: contain;
}

.signature-line {
    width: 320px;
    max-width: 100%;
    margin-top: 4px;
    border-top: 1px solid #111827;
}

.signature-label {
    margin-top: 8px;
    color: #475569;
}

.resource-section {
    margin-top: 28px;
}

.resource-card {
    padding: 20px 24px;
}

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

.resource-item h3 {
    margin-bottom: 6px;
}

.resource-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.site-footer {
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
    color: #4b5563;
    font-size: 0.9rem;
}

.site-footer code {
    display: block;
    white-space: normal;
    font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #374151;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
}

.is-invalid-manual {
    border-color: #dc3545 !important;
}

@media only screen and (max-width: 991px) {
    .page-card {
        padding: 28px 20px 24px;
    }

    .letter-sheet {
        padding: 22px 20px;
    }

    .letter-header,
    .resource-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .preview-pdf-frame {
        min-height: 560px;
    }
}

@media only screen and (max-width: 576px) {
    .page-shell {
        padding: 0;
    }

    .page-card {
        border-radius: 0 !important;
        padding: 20px 16px;
    }

    .preview-html {
        padding: 12px;
    }

    .letter-sheet {
        padding: 18px 14px;
    }
}

@media print {
    html,
    body {
        background: #ffffff !important;
    }

    .page-shell,
    .page-card,
    .preview-html {
        padding: 0 !important;
        box-shadow: none !important;
        background: #ffffff !important;
    }

    #input,
    .resource-section,
    .site-footer,
    .action-bar-results,
    .nav-tabs {
        display: none !important;
    }

    #resultsView {
        display: block !important;
    }

    .tab-content,
    .tab-pane,
    #nav-profile {
        display: block !important;
        opacity: 1 !important;
    }

    #nav-home {
        display: none !important;
    }

    .letter-sheet {
        border: 0;
        box-shadow: none;
        padding: 0;
        page-break-after: always;
    }

    .letter-sheet:last-child {
        page-break-after: auto;
    }
}
