/* ==========================================================================
   Company Profile page — brief introduction, the profile as named sections,
   and the secure full-screen viewer they open into.
   Loaded after style.css, so it inherits every brand token defined there.
   ========================================================================== */

/* ------------------------------------------------------------- introduction */

.profile-intro {
  max-width: 78ch;
  margin: 0 auto;
}
.profile-intro p {
  font-size: 1.04rem;
  line-height: 1.8;
}
.profile-intro p:first-child::first-letter {
  float: left;
  font-family: 'Poppins', sans-serif;
  font-size: 3.1rem;
  line-height: .86;
  font-weight: 700;
  color: var(--royal);
  padding: 6px 12px 0 0;
}
.profile-intro em { color: var(--royal-deep); font-style: italic; font-weight: 500; }
.profile-intro p:last-child {
  margin-bottom: 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: .97rem;
}

/* ------------------------------------------------------------ notice banner */

.cert-notice {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  max-width: 820px;
  margin: 40px auto 0;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  box-shadow: var(--shadow);
  text-align: left;
}
.cert-notice .ic { flex: none; color: var(--sky-dark); line-height: 1; }
.cert-notice p { margin: 0; font-size: .93rem; }
.cert-notice strong { color: var(--royal-deep); }

/* --------------------------------------------------------- downloadable docs */

.download-panel {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.download-panel__icon {
  flex: none;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--sky-tint);
  color: var(--royal);
}
.download-panel__icon svg { width: 30px; height: 30px; }
.download-panel__body {
  flex: 1;
  min-width: 0;
}
.download-panel__body h3 { font-size: 1.12rem; margin-bottom: 4px; }
.download-panel__body p { margin: 0; font-size: .9rem; }

/* ==========================================================================
   Section cards — one per part of the profile, and one per licence
   ========================================================================== */

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 26px;
}

.cert-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  text-align: left;
}
.cert-card:hover, .cert-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--sky);
  outline: none;
}

/* The thumbnail is a teaser: the top of the page, fading out into the card so
   it reads as a glimpse rather than a truncated document. */
.cert-thumb {
  display: block;
  position: relative;
  background: var(--sky-tint);
  aspect-ratio: 5 / 4;
  overflow: hidden;
}
.cert-thumb canvas {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .5s ease;
  /* Never a drag source, never a long-press save target. */
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.cert-card:hover .cert-thumb canvas { transform: scale(1.04); }

/* Transparent shield + fade. Long-press and drag land here, not on the canvas,
   on the browsers that still offer a save gesture for one. */
.cert-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 45%, rgba(255,255,255,.75) 78%, #fff 100%);
}

.cert-peek {
  position: absolute;
  z-index: 1;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.85);
  padding: 9px 22px;
  border-radius: 999px;
  background: var(--royal);
  color: var(--white);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  box-shadow: 0 10px 26px rgba(11,36,25,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.cert-card:hover .cert-peek,
.cert-card:focus-visible .cert-peek { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.cert-card.is-loading .cert-thumb {
  background: linear-gradient(100deg, var(--sky-tint) 30%, #FFFEF3 50%, var(--sky-tint) 70%);
  background-size: 220% 100%;
  animation: cert-shimmer 1.3s linear infinite;
}
.cert-card.is-failed .cert-thumb::before {
  content: "Preview unavailable";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--ink-soft);
  font-size: .85rem;
}
@keyframes cert-shimmer { to { background-position: -220% 0; } }

.cert-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  padding: 4px 22px 22px;
  margin-top: -18px;   /* lift the text into the thumbnail's fade */
  position: relative;
  z-index: 1;
}
.cert-body h3 { font-size: 1.02rem; margin-bottom: 6px; }
.cert-body p { margin: 0; font-size: .86rem; color: var(--ink-soft); }

.cert-pages {
  display: inline-block;
  margin-top: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--sky-tint);
  color: var(--sky-dark);
  font-size: .72rem;
  font-weight: 600;
}

.cert-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 14px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--sky-dark);
  transition: gap .2s ease, color .2s ease;
}
.cert-card:hover .cert-open { gap: 12px; color: var(--royal); }

.cert-lock {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(11, 36, 25, .82);
  color: var(--white);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .05em;
}
.cert-lock svg { width: 12px; height: 12px; }

/* ==========================================================================
   Secure full-screen viewer
   ========================================================================== */

body.no-scroll { overflow: hidden; }

.doc-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: rgba(8, 26, 17, .94);
  backdrop-filter: blur(4px);
}
.doc-modal[hidden] { display: none; }

/* Applied whenever the tab loses focus, so a background screen grab or a
   shared screen picks up nothing legible. */
.doc-modal.is-veiled .doc-stage canvas { filter: blur(26px); opacity: .3; }
.doc-modal.is-veiled .doc-veil-msg { opacity: 1; }

.doc-modal-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 14px;
  color: var(--white);
}
.doc-modal-titles { flex: 1; min-width: 0; }
.doc-modal-head h2 { color: var(--white); font-size: 1.15rem; margin: 0 0 3px; }
.doc-modal-head p { margin: 0; font-size: .85rem; color: rgba(255,255,255,.72); }

.doc-modal-close {
  flex: none;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.08);
  color: var(--white);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background .18s ease;
}
.doc-modal-close:hover { background: rgba(255,255,255,.22); }

.doc-modal-body {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  overflow: auto;
}

.doc-stage {
  position: relative;
  width: 100%;
  max-width: 820px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  cursor: zoom-in;
  transition: max-width .28s ease;
}
.doc-stage.is-zoomed { max-width: 1440px; cursor: zoom-out; }

#doc-canvas {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  opacity: 0;
  transition: opacity .3s ease, filter .25s ease;
}
#doc-canvas.is-ready { opacity: 1; }

/* Transparent shield: every pointer gesture aimed at the page lands here. */
.doc-shield { position: absolute; inset: 0; z-index: 2; }

/* Live on-screen watermark, on top of the one baked into the image itself. */
.doc-stamp {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  padding: 8px 14px;
  background: linear-gradient(to top, rgba(11,36,25,.8), rgba(11,36,25,0));
  color: rgba(255,255,255,.94);
  font-size: .72rem;
  letter-spacing: .03em;
  text-align: center;
  pointer-events: none;
}

.doc-veil-msg {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
  color: var(--royal-deep);
  font-weight: 600;
  font-size: .95rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.doc-nav {
  position: sticky;
  top: 42%;
  flex: none;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.32);
  background: rgba(255,255,255,.12);
  color: var(--white);
  cursor: pointer;
  transition: background .18s ease, opacity .18s ease;
}
.doc-nav svg { width: 20px; height: 20px; }
.doc-nav:hover:not(:disabled) { background: rgba(255,255,255,.28); }
.doc-nav:disabled { opacity: .25; cursor: default; }
.doc-nav[hidden] { display: none; }

.doc-loading {
  position: absolute;
  top: 45%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(11,36,25,.92);
  color: var(--white);
  font-size: .88rem;
}
.doc-loading[hidden] { display: none; }
.doc-loading::before {
  content: "";
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: var(--sky);
  animation: doc-spin .8s linear infinite;
}
@keyframes doc-spin { to { transform: rotate(360deg); } }

.doc-modal-foot {
  margin: 12px 0 0;
  text-align: center;
  font-size: .78rem;
  color: rgba(255,255,255,.6);
}

/* ------------------------------------------------------------------- toast */

.cert-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  z-index: 1100;
  background: var(--royal-deep);
  color: var(--white);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: .88rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.cert-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ printing */
/* Nothing on this page is printable. Replacing the whole document rather than
   hiding the images means a print or "save as PDF" produces the notice only. */
@media print {
  body > *, .wa-float { display: none !important; }
  body::after {
    content: "Kenya Skys Credit Ltd — these documents are intended for online viewing only. Printing, downloading, reproduction and redistribution are not permitted without prior written authorization. For a copy, please contact info@kenyaskyscredit.co.ke.";
    display: block;
    padding: 60px 40px;
    font: 15px/1.7 'Inter', Arial, sans-serif;
    color: #1E2A24;
  }
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 760px) {
  .profile-intro p { font-size: 1rem; }
  .doc-modal { padding: 12px; }
  .doc-stage.is-zoomed { max-width: none; }
  /* Arrows move below the page rather than crowding it on a narrow screen. */
  .doc-modal-body { flex-wrap: wrap; }
  .doc-nav { position: static; order: 2; }
  .doc-stage { order: 1; }
}
@media (max-width: 560px) {
  .cert-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
  .cert-body { padding: 4px 16px 18px; }
  .cert-body h3 { font-size: .92rem; }
  .cert-lock { font-size: .62rem; padding: 4px 8px; }
  .profile-intro p:first-child::first-letter { font-size: 2.6rem; }
  .download-panel {
    align-items: flex-start;
    flex-direction: column;
  }
  .download-panel .btn {
    width: 100%;
    justify-content: center;
  }
}
