/* === A4 Medical Protocol Page — Isolated Stylesheet === */
/* Separated from styles.css for cross-browser compatibility (Zen, Firefox, Chrome, Safari) */

.a4-page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.a4-page {
    width: 794px;
    min-height: 1123px;
    background: #ffffff !important;
    color: #1a1a2e !important;
    border-radius: 4px;
    box-shadow:
        0 4px 6px rgba(0,0,0,0.07),
        0 20px 60px rgba(0,0,0,0.25),
        0 0 0 1px rgba(0,0,0,0.05);
    padding: 136px 106px 106px 106px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    position: relative;
    overflow: hidden;
    /* Hard resets — prevent dark theme leaking */
    -webkit-text-fill-color: initial;
    text-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
}

/* Kill any inherited pseudo-element overlays */
.a4-page-wrapper::after,
.a4-page::after,
.a4-page-wrapper::before,
.a4-page::before {
    content: none !important;
    display: none !important;
}

/* ---- Header ---- */
.protocol-header {
    margin: -136px -106px 0 -106px;
    padding: 0;
}

.protocol-header-stripe {
    height: 5px;
    background: linear-gradient(90deg, #1a5276 0%, #2e86c1 35%, #48c9b0 65%, #1a5276 100%);
}

.protocol-header-stripe-bottom {
    height: 2px;
    background: linear-gradient(90deg, #1a5276 0%, #2e86c1 50%, #1a5276 100%);
    opacity: 0.5;
}

.protocol-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 106px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    border-bottom: 1px solid #e8eef5;
}

.protocol-logo-area {
    display: flex;
    align-items: center;
    gap: 14px;
}

.protocol-logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1a5276, #2e86c1);
    color: #fff !important;
    -webkit-text-fill-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(26, 82, 118, 0.3);
}

.protocol-logo-text {
    display: flex;
    flex-direction: column;
}

.protocol-clinic-name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #1a5276 !important;
    -webkit-text-fill-color: #1a5276;
    background: none;
    font-family: 'Inter', sans-serif;
}

.protocol-clinic-sub {
    font-size: 11px;
    color: #5d7b93 !important;
    -webkit-text-fill-color: #5d7b93;
    background: none;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.protocol-doc-label {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 19px;
    font-weight: 700;
    color: #1a5276 !important;
    -webkit-text-fill-color: #1a5276;
    background: none;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-left: 3px solid #2e86c1;
    padding-left: 14px;
}

/* ---- Title ---- */
.protocol-title-section {
    margin-top: 28px;
    margin-bottom: 20px;
    text-align: center;
}

.protocol-field-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #8fa3b8 !important;
    -webkit-text-fill-color: #8fa3b8;
    background: none;
    margin-bottom: 5px;
}

.protocol-title-value {
    font-size: 20px;
    font-weight: 700;
    color: #1a2a3a !important;
    -webkit-text-fill-color: #1a2a3a;
    background: none;
    padding: 6px 12px;
    border-bottom: 2px solid #2e86c1;
    display: inline-block;
    outline: none;
    min-width: 200px;
    transition: background 0.2s;
}

.protocol-title-value:hover,
.protocol-title-value:focus {
    background: #f0f7ff;
    border-radius: 4px;
}

/* ---- Info Grid ---- */
.protocol-info-grid {
    margin-bottom: 20px;
    border: 1px solid #e2eaf2;
    border-radius: 8px;
    overflow: hidden;
}

.protocol-info-row {
    display: flex;
    border-bottom: 1px solid #e2eaf2;
}

.protocol-info-row:last-child {
    border-bottom: none;
}

.protocol-info-cell {
    flex: 1;
    padding: 10px 16px;
    border-right: 1px solid #e2eaf2;
}

.protocol-info-cell:last-child {
    border-right: none;
}

.protocol-info-cell-wide {
    flex: 2;
}

.protocol-field-value {
    font-size: 14px;
    font-weight: 500;
    color: #1a2a3a !important;
    -webkit-text-fill-color: #1a2a3a;
    background: none;
    outline: none;
    padding: 3px 6px;
    border-radius: 3px;
    transition: background 0.2s;
    min-height: 1.4em;
}

.protocol-field-value:hover,
.protocol-field-value:focus {
    background: #f0f7ff;
}

.protocol-field-value-time {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.proto-time-block {
    white-space: nowrap;
}

.proto-time-block b {
    color: #5d7b93 !important;
    -webkit-text-fill-color: #5d7b93;
    font-weight: 600;
}

.proto-time-sep {
    color: #b0c4d8 !important;
    -webkit-text-fill-color: #b0c4d8;
    font-size: 19px;
    line-height: 1;
}

/* ---- Divider ---- */
.protocol-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #c8d8e8, transparent);
    margin: 20px 0;
}

/* ---- Sections ---- */
.protocol-section {
    margin-bottom: 18px;
}

.protocol-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2eaf2;
}

.protocol-section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a5276, #2e86c1);
    color: #fff !important;
    -webkit-text-fill-color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(26, 82, 118, 0.25);
}

.protocol-section-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #1a5276 !important;
    -webkit-text-fill-color: #1a5276;
    background: none;
    text-transform: uppercase;
}

.protocol-section-body {
    font-size: 14px;
    line-height: 1.65;
    color: #2c3e50 !important;
    -webkit-text-fill-color: #2c3e50;
    padding: 10px 14px;
    border-left: 3px solid #e2eaf2;
    border-radius: 0 6px 6px 0;
    background: #fafcfe;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    min-height: 2em;
}

.protocol-section-body:hover {
    border-left-color: #a8c6e0;
}

.protocol-section-body:focus {
    border-left-color: #2e86c1;
    background: #f0f7ff;
}

.protocol-section-body b {
    color: #1a5276 !important;
    -webkit-text-fill-color: #1a5276;
    font-weight: 600;
}

/* ---- Signatures ---- */
.protocol-signatures {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-top: 28px;
    padding-top: 10px;
}

.protocol-signature-block {
    flex: 1;
    text-align: center;
}

.protocol-signature-role {
    font-size: 11px;
    color: #8fa3b8 !important;
    -webkit-text-fill-color: #8fa3b8;
    background: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 24px;
}

.protocol-signature-line {
    height: 1px;
    background: #1a2a3a;
    margin-bottom: 8px;
}

.protocol-signature-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a2a3a !important;
    -webkit-text-fill-color: #1a2a3a;
    background: none;
    outline: none;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background 0.2s;
}

.protocol-signature-name:hover,
.protocol-signature-name:focus {
    background: #f0f7ff;
}

.protocol-signature-detail {
    font-size: 11px;
    color: #8fa3b8 !important;
    -webkit-text-fill-color: #8fa3b8;
    background: none;
    margin-top: 4px;
}

/* ---- Footer ---- */
.protocol-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 12px;
    border-top: 1px solid #e2eaf2;
    font-size: 10px;
    color: #b0c4d8 !important;
    -webkit-text-fill-color: #b0c4d8;
}

/* ---- A4 actions bar ---- */
.a4-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 794px;
    padding: 10px 0 30px;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .a4-page {
        width: 100%;
        min-height: auto;
        padding: 76px 60px 60px 60px;
        border-radius: 4px;
    }
    .protocol-header {
        margin: -76px -60px 0 -60px;
    }
    .protocol-header-content {
        padding: 14px 60px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    .protocol-info-row {
        flex-direction: column;
    }
    .protocol-info-cell {
        border-right: none;
        border-bottom: 1px solid #e2eaf2;
    }
    .protocol-info-cell:last-child {
        border-bottom: none;
    }
    .protocol-signatures {
        flex-direction: column;
        gap: 24px;
    }
    .protocol-field-value-time {
        flex-direction: column;
        align-items: flex-start;
    }
    .proto-time-sep {
        display: none;
    }
    .a4-actions {
        max-width: 100%;
    }
}
