/* Derkonig welcome screens. Loaded by templates/page-login.php. */

/* ============================================================================
   Welcome screens, shown before the login form (see assets/js/onboarding.js)
   ========================================================================== */

/* The photos are shown whole, never cropped: each is width:100% at its own natural height, pinned
   to the top of the card. On a phone the card is the full screen and the space under the photo is
   the same dark ink the gradient fades into; on a wider screen the card takes the photos' own
   1536x2752 shape, so the photo fills it exactly. */
.dk-onboarding {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #030712;
  font-family: var(--dk-font-family), sans-serif;
  color: #FFFFFF;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.dk-onboarding.is-open {
  opacity: 1;
}

.dk-onboarding:focus {
  outline: none;
}

html.dk-onboarding-lock,
html.dk-onboarding-lock body {
  overflow: hidden;
}

.dk-onboarding-card {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #060B16;
  touch-action: pan-y;
}

.dk-onboarding-track {
  display: flex;
  height: 100%;
  transition: transform 0.4s ease;
}

.dk-onboarding-slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
}

.dk-onboarding-photo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  max-width: none;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* Dark fade over the lower part of the photo, under the text. */
.dk-onboarding-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(6, 11, 22, 0) 38%, rgba(6, 11, 22, 0.78) 60%, #060B16 76%);
  pointer-events: none;
}

.dk-onboarding-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(132px + env(safe-area-inset-bottom, 0px));
  z-index: 1;
  padding: 0 24px;
}

.dk-onboarding-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 500;
  color: #E5E7EB;
}

.dk-onboarding-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3B82F6;
}

.dk-onboarding-title {
  margin: 0 0 10px;
  font-size: clamp(28px, 8vw, 34px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: #FFFFFF;
}

/* Official brand blue, same as the button below. */
.dk-onboarding-title span {
  display: block;
  color: #1D4ED8;
}

.dk-onboarding-sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: #9CA3AF;
}

.dk-onboarding-header {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: 20px;
  right: 20px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dk-onboarding-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
}

.dk-onboarding-brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.dk-onboarding-skip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.6);
  color: #FFFFFF;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.dk-onboarding-footer {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  z-index: 2;
}

.dk-onboarding-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
}

.dk-onboarding-dot {
  width: 6px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  transition: width 0.3s ease, background-color 0.3s ease;
}

.dk-onboarding-dot.is-active {
  width: 22px;
  background: #FFFFFF;
}

.dk-onboarding-next {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  background: #1D4ED8;
  color: #FFFFFF;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.dk-onboarding-next:hover {
  background: #1E40AF;
}

.dk-onboarding-next svg {
  width: 18px;
  height: 18px;
}

.dk-onboarding :focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
}

/* Wider screens: a centred card in the photos' own shape, like the reference mockup. */
@media (min-width: 601px) and (min-height: 640px) {
  .dk-onboarding {
    background: rgba(3, 7, 18, 0.92);
  }

  .dk-onboarding-card {
    /* dvh with a vh fallback, same as .app-container: on a tablet browser 88vh is measured with
       the address bar hidden, so with it showing the card could run past the visible area. */
    height: min(88vh, 860px);
    height: min(88dvh, 860px);
    width: auto;
    aspect-ratio: 1536 / 2752;
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  }

  .dk-onboarding-header {
    top: 18px;
  }

  /* The card's width follows its height here, not the screen width, so the headline does too
     (keeps "Derkonig Logistics" on one line on a short, wide screen). */
  .dk-onboarding-title {
    font-size: clamp(22px, 3.9vh, 34px);
    font-size: clamp(22px, 3.9dvh, 34px);
  }

  .dk-onboarding-copy {
    bottom: 132px;
  }

  .dk-onboarding-footer {
    bottom: 28px;
  }
}

/* Phone turned sideways: the photo sized to the screen width would show only its top quarter, and
   the text would run into the header. Instead the whole photo sits on the left at full height and
   the text and button take the space to its right. The card is the full visible screen here
   (fixed, inset 0), so its height is 100dvh (100vh where dvh isn't supported). */
@media (orientation: landscape) and (max-height: 639px) {
  .dk-onboarding-card {
    --dk-ob-photo-w: calc(100vh * 1536 / 2752);
  }

  @supports (height: 100dvh) {
    .dk-onboarding-card {
      --dk-ob-photo-w: calc(100dvh * 1536 / 2752);
    }
  }

  .dk-onboarding-photo {
    width: auto;
    height: 100%;
  }

  .dk-onboarding-slide::after {
    background: linear-gradient(to right, rgba(6, 11, 22, 0) calc(var(--dk-ob-photo-w) - 48px), #060B16 var(--dk-ob-photo-w));
  }

  .dk-onboarding-copy {
    left: var(--dk-ob-photo-w);
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .dk-onboarding-footer {
    left: calc(var(--dk-ob-photo-w) + 24px);
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .dk-onboarding-badge {
    margin-bottom: 10px;
  }

  .dk-onboarding-title {
    margin-bottom: 8px;
    font-size: 24px;
  }

  .dk-onboarding-sub {
    font-size: 14px;
  }

  .dk-onboarding-dots {
    margin-bottom: 14px;
  }

  .dk-onboarding-next {
    min-height: 46px;
  }
}
