/*--------------------------------------------------------------
	Documents: the "Request a copy" pop-up on the Resources pages (assets/js/doc-request.js)
	and the online viewer page, view.php (assets/js/doc-viewer.js).
--------------------------------------------------------------*/

/* ================================================================
   1. Request a copy
   ================================================================ */
.drq { position: fixed; inset: 0; z-index: 3600; display: flex; align-items: center; justify-content: center; padding: 24px; }
.drq[hidden] { display: none; }
.drq-backdrop { position: absolute; inset: 0; background: rgba(13, 14, 67, 0.62); opacity: 0; transition: opacity 0.22s; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.drq.is-open .drq-backdrop { opacity: 1; }
.drq-dialog {
  position: relative; width: 100%; max-width: 640px; max-height: calc(100vh - 48px); overflow: auto; overscroll-behavior: contain;
  background: #fff; border-radius: var(--ort-r-lg, 16px); box-shadow: 0 30px 80px -20px rgba(8, 9, 50, 0.55);
  transform: translateY(12px) scale(0.99); opacity: 0; transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.24s;
}
.drq.is-open .drq-dialog { transform: none; opacity: 1; }
.drq-dialog:focus { outline: none; }
.drq-x { position: absolute; top: 14px; right: 14px; z-index: 2; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: #f1f3f9; color: #171a4a; font-size: 15px; cursor: pointer; transition: background 0.18s, color 0.18s; }
.drq-x:hover { background: #f4572e; color: #fff; }
.drq-form { padding: 28px 30px 26px; }
.drq-head { display: flex; align-items: center; gap: 16px; margin: 0 44px 22px 0; }
.drq-cover { flex: none; width: 56px; height: 74px; object-fit: cover; border-radius: 6px; background: #eef0f6; box-shadow: 0 8px 20px rgba(13, 14, 67, 0.2); }
.drq-cover[src=""] { visibility: hidden; }
.drq-head h2 { margin: 0; font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; color: #171a4a; text-transform: none; }
.drq-head p { margin: 3px 0 0; font-size: 15px; line-height: 1.45; color: #646d82; }
.drq fieldset { min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
.drq legend, .drq-field label { display: block; width: auto; margin: 0 0 8px; padding: 0; border: 0; font: 700 13.5px "Titillium Web", sans-serif; letter-spacing: 0.02em; color: #171a4a; }
.drq-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.drq-chip { position: relative; margin: 0; cursor: pointer; }
.drq-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drq-chip span { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 14px 6px 12px; border: 1.5px solid #dfe3ee; border-radius: 30px; background: #fff; color: #2e3192; font: 600 13.5px/1.25 "Titillium Web", sans-serif; transition: background 0.18s, border-color 0.18s, color 0.18s; }
.drq-chip span:before { content: "\f067"; font: 900 10px "Font Awesome 5 Free"; }
.drq-chip:hover span { border-color: #2e3192; }
.drq-chip input:checked + span { background: #2e3192; border-color: #2e3192; color: #fff; }
.drq-chip input:checked + span:before { content: "\f00c"; }
.drq-chip input:focus-visible + span { outline: 2px solid #f4572e; outline-offset: 2px; }
.drq-docs.is-invalid .drq-chip span { border-color: #d93025; }
.drq-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drq-seg label { position: relative; margin: 0; cursor: pointer; }
.drq-seg input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drq-seg span { display: flex; align-items: center; justify-content: center; gap: 10px; height: 54px; border: 1.5px solid #d7dce8; border-radius: var(--ort-r-sm, 8px); background: #fff; color: #171a4a; font: 700 15.5px "Titillium Web", sans-serif; transition: background 0.18s, border-color 0.18s, box-shadow 0.18s; }
.drq-seg span i { font-size: 19px; color: #2e3192; }
.drq-seg .fa-whatsapp { color: #1f9d55; }
.drq-seg label:hover span { border-color: #2e3192; }
.drq-seg input:checked + span { border-color: #2e3192; background: #eef0fb; box-shadow: 0 0 0 3px rgba(46, 49, 146, 0.12); }
.drq-seg input:focus-visible + span { outline: 2px solid #f4572e; outline-offset: 2px; }
.drq-via.is-invalid .drq-seg span { border-color: #d93025; }
.drq-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.drq-field { min-width: 0; }
.drq-field.is-wide { grid-column: 1 / -1; }
.drq-field input, .drq-field select { display: block; width: 100%; height: 50px; margin: 0; padding: 0 16px; border: 1.5px solid #d7dce8; border-radius: var(--ort-r-sm, 8px); background: #fff; color: #171a4a; font: 400 16px "Roboto", sans-serif; transition: border-color 0.18s, box-shadow 0.18s; }
.drq-field input::placeholder { color: #9aa3b8; }
.drq-field select { -webkit-appearance: none; appearance: none; padding-right: 42px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23171a4a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center; }
.drq-field input:focus, .drq-field select:focus { outline: 0; border-color: #2e3192; box-shadow: 0 0 0 4px rgba(46, 49, 146, 0.12); }
.drq-field .is-invalid { border-color: #d93025; box-shadow: 0 0 0 4px rgba(217, 48, 37, 0.1); }
.drq-check { display: flex; align-items: flex-start; gap: 12px; margin: 18px 0 0; font: 400 14px/1.55 "Roboto", sans-serif; color: #566074; cursor: pointer; }
.drq-check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: #2e3192; }
.drq-check input.is-invalid + span { color: #d93025; }
.drq-check a { color: #2e3192; text-decoration: underline; white-space: nowrap; }   /* a policy name stays on one line (with its asterisk) */
.drq-alert { margin: 16px 0 0; padding: 12px 16px; border: 1px solid #ffd3c6; border-radius: var(--ort-r-sm, 8px); background: #fff1ed; color: #b3361b; font-size: 15px; line-height: 1.5; }
.drq-alert[hidden] { display: none; }
.drq-submit { width: 100%; min-width: 0; height: 56px; margin-top: 20px; }
.drq-submit[disabled] { opacity: 0.7; cursor: wait; }
.drq-done { padding: 52px 32px 40px; text-align: center; }
.drq-done[hidden] { display: none; }
.drq-done-ic { display: inline-flex; align-items: center; justify-content: center; width: 68px; height: 68px; margin-bottom: 18px; border-radius: 50%; background: #e9f7ef; color: #157347; font-size: 26px; }
.drq-done h2 { margin: 0 0 10px; font-size: 26px; color: #171a4a; text-transform: none; }
.drq-done h2:focus { outline: none; }
.drq-done p { max-width: 440px; margin: 0 auto 26px; }
.drq-done .btn { min-width: 160px; }
html.drq-lock { overflow: hidden; }
@media (max-width: 575px) {
  .drq { align-items: flex-end; padding: 0; }
  .drq-dialog { max-height: 94vh; max-height: 94dvh; border-radius: var(--ort-r-lg, 16px) var(--ort-r-lg, 16px) 0 0; }
  .drq-form { padding: 22px 18px 24px; }
  .drq-head { gap: 12px; margin-bottom: 18px; }
  .drq-cover { width: 44px; height: 58px; }
  .drq-head h2 { font-size: 21px; }
  .drq-fields { grid-template-columns: 1fr; gap: 14px; }
  .drq-done { padding: 44px 20px 32px; }
}
@media (prefers-reduced-motion: reduce) { .drq-dialog, .drq-backdrop, .drq-chip span, .drq-seg span { transition: none; } }

/* ================================================================
   2. Online viewer (view.php): a reading page with a slim bar on top
   ================================================================ */
.dv-body { margin: 0; min-height: 100vh; background: #e8ebf2; color: #566074; font: 400 16px/1.6 "Roboto", sans-serif; -webkit-text-size-adjust: 100%; }
.dv-body *, .dv-body *:before, .dv-body *:after { box-sizing: border-box; }
.dv-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 16px; background: #171a4a; color: #fff; box-shadow: 0 2px 14px rgba(13, 14, 67, 0.28); }
.dv-back, .dv-tool { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--ort-r-sm, 8px); background: transparent; color: #fff; font-size: 16px; cursor: pointer; text-decoration: none; transition: background 0.15s; }
.dv-back:hover, .dv-tool:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.dv-back:focus-visible, .dv-tool:focus-visible, .dv-dl:focus-visible, .dv-pages input:focus-visible { outline: 2px solid #f4572e; outline-offset: 2px; }
.dv-tools[hidden], .dv-tool[hidden], .dv-pages[hidden] { display: none; }
.dv-logo { flex: none; display: block; padding: 0 4px; }
.dv-logo img { display: block; width: auto; height: 32px; }
.dv-title { flex: 1; min-width: 0; margin: 0; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, 0.16); font: 600 16px/1.3 "Titillium Web", sans-serif; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-tools { display: flex; flex: none; align-items: center; gap: 2px; }
.dv-pages { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; font: 600 14px "Titillium Web", sans-serif; color: rgba(255, 255, 255, 0.75); }
.dv-pages input { width: 52px; height: 32px; padding: 0 4px; border: 1px solid rgba(255, 255, 255, 0.24); border-radius: 8px; background: rgba(255, 255, 255, 0.08); color: #fff; font: inherit; text-align: center; -moz-appearance: textfield; }
.dv-pages input::-webkit-inner-spin-button, .dv-pages input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.dv-dl { display: inline-flex; flex: none; align-items: center; gap: 8px; height: 40px; margin-left: 4px; padding: 0 16px; border-radius: var(--ort-r-sm, 8px); background: #f4572e; color: #fff; font: 700 14px "Titillium Web", sans-serif; text-decoration: none; transition: background 0.15s, color 0.15s; }
.dv-dl:hover { background: #fff; color: #171a4a; }
.dv-main { padding: 24px 16px 64px; }
.dv-main:focus { outline: none; }
.dv-doc { overflow-x: auto; }
.dv-page { position: relative; margin: 0 auto 18px; background: #fff; box-shadow: 0 1px 3px rgba(13, 14, 67, 0.08), 0 10px 30px rgba(13, 14, 67, 0.12); }
.dv-page canvas { display: block; width: 100%; height: 100%; }
.dv-img { display: block; max-width: none; height: auto; margin: 0 auto; background: #fff; box-shadow: 0 10px 30px rgba(13, 14, 67, 0.12); }
.dv-state { display: flex; flex-direction: column; align-items: center; gap: 16px; max-width: 520px; margin: 0 auto; padding: 90px 20px; text-align: center; }
.dv-state[hidden] { display: none; }
.dv-state h2 { margin: 0; font: 700 22px/1.3 "Titillium Web", sans-serif; color: #171a4a; }
.dv-state p { margin: 0; }
.dv-state .dv-dl { height: 48px; padding: 0 22px; }
.dv-spin { width: 38px; height: 38px; border: 3px solid #cfd4e4; border-top-color: #2e3192; border-radius: 50%; animation: dvSpin 0.8s linear infinite; }
@keyframes dvSpin { to { transform: rotate(360deg); } }
/* Word documents (docx-preview): pages on the same grey as PDFs */
.dv-docx .docx-wrapper { display: block; padding: 0; background: transparent; }
.dv-docx .docx-wrapper > section.docx { margin: 0 auto 18px; box-shadow: 0 1px 3px rgba(13, 14, 67, 0.08), 0 10px 30px rgba(13, 14, 67, 0.12); }
.dv-body:fullscreen { overflow: auto; }
@media (max-width: 767px) {
  .dv-bar { gap: 6px; height: 56px; padding: 0 8px; }
  .dv-logo, .dv-dl span, .dv-tool[data-dv-fit] { display: none; }
  .dv-title { padding-left: 4px; border-left: 0; font-size: 15px; }
  .dv-pages { margin-right: 2px; }
  .dv-pages input { width: 40px; }
  .dv-dl { width: 40px; padding: 0; justify-content: center; }
  .dv-main { padding: 12px 8px 40px; }
  .dv-page, .dv-docx .docx-wrapper > section.docx { margin-bottom: 10px; }
}
@media (max-width: 420px) {
  .dv-tool[data-dv-full] { display: none; }
  .dv-back, .dv-tool, .dv-dl { width: 36px; height: 36px; }
  .dv-pages span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .dv-spin { animation-duration: 2.4s; } }
@media print { .dv-bar { display: none; } .dv-body { background: #fff; } .dv-page { box-shadow: none; margin: 0 auto; page-break-after: always; } }
