/* Oman Chamber certificate-status mirror */

:root {
  --occi-blue: #123d73;
  --title-blue: #24598f;
  --page-bg: #f4f7fb;
  --footer-blue: #14487c;
  --text: #202938;
  --content-width: 806px;
  --shell-width: 1138px;
  --pdf-width: 766px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: var(--page-bg);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

.portal-header {
  height: 57px;
  background: #fff;
  border-bottom: 1px solid #dfe6ef;
}

.header-wrap {
  width: 100%;
  max-width: var(--shell-width);
  height: 57px;
  margin: 0 auto;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: inline-flex;
  align-items: center;
  height: 51px;
  text-decoration: none;
}

.header-logo img {
  display: block;
  width: 186px;
  height: auto;
  object-fit: contain;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--occi-blue);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.is-arabic .header-links {
  direction: rtl;
}

.header-links a {
  text-decoration: none;
}

.header-links a:hover {
  text-decoration: underline;
}

.header-links span {
  color: #9aa6b5;
  font-weight: 600;
}

.page {
  width: 100%;
  max-width: var(--shell-width);
  margin: 0 auto;
  padding: 0 0 74px;
  flex: 1 0 auto;
}

.document-block {
  width: var(--content-width);
  margin: 45px 0 0;
  margin-left: 45px;
}

.verifier-panel {
  display: none;
  width: var(--content-width);
  margin: 72px 0 0;
  margin-left: 45px;
}

.verifier-route .verifier-panel,
.certificate-not-found .verifier-panel {
  display: block;
}

.verifier-route .document-block,
.certificate-not-found .document-block {
  display: none;
}

.document-block-first {
  margin-top: 36px;
}

.is-arabic .document-block,
.is-arabic .verifier-panel {
  margin-left: auto;
  margin-right: 45px;
}

h1,
h2 {
  margin: 0 0 10px;
  font-weight: 500;
  letter-spacing: 0;
}

h1 {
  color: var(--title-blue);
  font-size: 34px;
  line-height: 1.25;
  font-weight: 700;
}

h2 {
  color: #202938;
  font-size: 31px;
  line-height: 1.25;
}

.is-arabic h1,
.is-arabic h2 {
  text-align: right;
}

.verifier-card {
  padding: 30px;
  background: #fff;
}

.verifier-form {
  display: grid;
  gap: 12px;
}

.verifier-form label {
  color: #1f2b3d;
  font-size: 16px;
  font-weight: 700;
}

.verifier-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 136px;
  gap: 12px;
}

.verifier-row input {
  min-width: 0;
  height: 46px;
  padding: 0 13px;
  border: 1px solid #cbd6e4;
  border-radius: 3px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

.verifier-row button {
  height: 46px;
  border: 0;
  border-radius: 3px;
  color: #fff;
  background: var(--title-blue);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.verifier-help,
.verifier-error {
  margin: 0;
  font-size: 14px;
}

.verifier-help {
  color: #67778e;
}

.verifier-error {
  color: #b42318;
  font-weight: 700;
}

.document-canvas {
  width: 100%;
  padding: 27px 20px;
  background: #fff;
}

.document-stage {
  --zoom-width: 100%;
  position: relative;
  display: block;
  width: 100%;
  max-width: var(--pdf-width);
  margin: 0 auto;
}

.document-scroll {
  width: 100%;
  overflow: auto;
}

.document-zoom {
  position: relative;
  width: var(--zoom-width);
  min-width: 100%;
  transition: width 160ms ease;
}

.document-page {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 2px 8px rgba(28, 39, 53, 0.22);
}

.document-frame {
  aspect-ratio: 595 / 842;
  height: auto;
  min-height: 980px;
  border: 0;
}

.document-frame-shield {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: transparent;
}

.document-stage[data-pdf-only="true"] > .document-toolbar,
.document-stage[data-pdf-only="true"] .document-frame-shield {
  display: none;
}

.document-stage[data-watermark="duplicate"] .document-zoom::after {
  content: "DUPLICATE";
  position: absolute;
  left: 48.6%;
  top: 47.8%;
  z-index: 2;
  display: block;
  color: rgba(95, 184, 163, 0.28);
  font-size: calc(var(--pdf-width) * 0.1515);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-54deg);
  transform-origin: center;
  white-space: nowrap;
}

.certificate-route-pending .document-block:not(.document-block-first) {
  display: none;
}

.certificate-route-pending:not(.certificate-route-applied) .document-block-first .document-page {
  visibility: hidden;
}

.document-toolbar {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 106px;
  padding: 20px 26px;
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(38, 38, 38, 0.9);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  direction: ltr;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 130ms ease, transform 130ms ease;
}

.document-stage:hover .document-toolbar,
.document-stage:focus-within .document-toolbar,
.document-stage[data-active="true"] .document-toolbar {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.viewer-tool {
  appearance: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.viewer-tool:hover,
.viewer-tool:focus-visible {
  color: #fff;
  outline: none;
}

.viewer-tool svg {
  width: 45px;
  height: 45px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toolbar-divider {
  width: 2px;
  height: 62px;
  background: rgba(255, 255, 255, 0.35);
}

.portal-footer {
  min-height: 46px;
  background: var(--footer-blue);
  color: #fff;
}

.footer-wrap {
  width: 100%;
  max-width: var(--shell-width);
  min-height: 46px;
  margin: 0 auto;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-copy {
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
}

.footer-copy a {
  color: inherit;
  text-decoration: none;
}

.footer-copy a:hover {
  text-decoration: underline;
}

.is-arabic .footer-copy {
  direction: rtl;
}

.footer-powered {
  display: block;
  width: 170px;
  height: 38px;
  object-fit: contain;
}

@media (max-width: 900px) {
  .header-wrap,
  .footer-wrap {
    padding-inline: 16px;
  }

  .page {
    padding-inline: 16px;
  }

  .document-block {
    width: 100%;
    max-width: var(--content-width);
    margin-left: 0;
  }

  .verifier-panel {
    width: 100%;
    max-width: var(--content-width);
    margin-left: 0;
  }

  .document-canvas {
    padding: 22px 20px;
  }
}

@media (max-width: 680px) {
  .portal-header,
  .header-wrap {
    height: auto;
    min-height: 57px;
  }

  .header-wrap {
    flex-wrap: wrap;
    gap: 4px 16px;
    padding-block: 4px 7px;
  }

  .header-logo img {
    width: 174px;
    height: auto;
  }

  .header-links {
    width: 100%;
    justify-content: flex-start;
    gap: 9px;
    overflow-x: auto;
    padding-bottom: 2px;
    font-size: 13px;
  }

  .document-block-first {
    margin-top: 28px;
  }

  .document-block {
    margin-top: 36px;
  }

  .verifier-panel {
    margin-top: 42px;
  }

  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 29px;
  }

  .document-canvas {
    padding: 16px 12px;
  }

  .certificate-route-applied .document-block {
    width: var(--content-width);
    max-width: none;
  }

  .certificate-route-applied .document-canvas {
    width: var(--content-width);
  }

  .certificate-route-applied .document-stage {
    width: var(--pdf-width);
    max-width: none;
  }

  .certificate-route-applied .document-scroll {
    overflow: visible;
  }

  .certificate-route-applied .document-stage[data-watermark="duplicate"] .document-zoom::after {
    left: calc((100vw - 28px) / 2);
  }

  .verifier-card {
    padding: 22px 18px;
  }

  .verifier-row {
    grid-template-columns: 1fr;
  }

  .document-toolbar {
    bottom: 12px;
    gap: 10px;
    min-height: 74px;
    padding: 13px 16px;
    border-radius: 14px;
  }

  .viewer-tool {
    width: 36px;
    height: 36px;
  }

  .viewer-tool svg {
    width: 35px;
    height: 35px;
  }

  .toolbar-divider {
    height: 44px;
  }

  .footer-wrap {
    min-height: 58px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding-block: 8px;
  }

  .footer-copy {
    white-space: normal;
    font-size: 13px;
  }

  .footer-powered {
    width: 150px;
    height: 34px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .portal-header,
  .portal-footer {
    display: none;
  }

  .page {
    width: 100%;
    padding: 0;
  }

  .document-block {
    page-break-after: always;
    margin: 0;
  }

  h1,
  h2 {
    display: none;
  }

  .document-canvas {
    padding: 0;
  }

  .document-stage {
    width: 100%;
    box-shadow: none;
  }

  .document-toolbar {
    display: none;
  }
}
