/* Product film on /login/ and /tilmeld/ (approved design "B v3", 27 Sep 2026).
   Loaded by login.php and tilmeld.php only, after every other stylesheet.

   Desktop (> 900px): the left panel (.login-hero--video) becomes a dark teal
   media panel. A silent 12 s loop of real product moments plays; the whole
   picture is one play button that opens the full film with sound in a
   <dialog> theater. A small pause button stays (WCAG 2.2.2).
   Phones (<= 900px): mobile-login.css hides the left panel, so a compact
   "Se hvordan det virker" row under the form opens the same theater. */

.auth-video-mobile,
.auth-video-theater:not([open]) {
  display: none;
}

/* ===== DESKTOP: media panel ===== */
@media (min-width: 901px) {
  /* the panel comes after the form in the DOM (form first for keyboard and screen readers); show it on the left */
  .login-hero.login-hero--video {
    order: -1;
    justify-content: flex-start;
    padding: 40px 40px 44px;
    background:
      radial-gradient(120% 80% at 0% 0%, rgba(42, 159, 192, 0.35) 0%, rgba(42, 159, 192, 0) 60%),
      linear-gradient(160deg, #135566 0%, #0E3E4B 55%, #0B2F3A 100%);
  }

  .auth-video-stage {
    position: relative;
    width: 100%;
    margin-top: 28px;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    background: #0A2530;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.08),
      0 26px 50px -22px rgba(0, 0, 0, 0.6);
  }

  .auth-video-loop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
  }

  /* the whole picture is the play button; the icon sits in the middle */
  .auth-video-play {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: radial-gradient(circle at 50% 50%, rgba(8, 26, 33, 0.32) 0%, rgba(8, 26, 33, 0.1) 45%, rgba(8, 26, 33, 0.06) 100%);
    box-shadow: none;
    cursor: pointer;
  }

  .auth-video-play-icon {
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.55);
    transition: transform 0.18s ease;
  }

  /* triangle ~37 % of the circle; its centroid is the viewBox centre, so no nudge */
  .auth-video-play-icon svg {
    width: 34px;
    height: 34px;
    fill: #168CA4;
    stroke: #168CA4;
  }

  .auth-video-play:hover .auth-video-play-icon {
    transform: scale(1.07);
  }

  .auth-video-play:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -6px;
  }

  .auth-video-pause {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(8, 26, 33, 0.5);
    color: #fff;
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 0.15s ease;
  }

  .auth-video-pause:hover,
  .auth-video-pause:focus-visible {
    opacity: 1;
  }

  .auth-video-pause:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
  }

  .auth-video-pause svg {
    width: 13px;
    height: 13px;
    fill: #fff;
  }

  .auth-video-pause .i-play {
    stroke: #fff;
  }

  .auth-video-pause .i-play,
  .auth-video-pause[aria-pressed="true"] .i-pause {
    display: none;
  }

  .auth-video-pause[aria-pressed="true"] .i-play {
    display: block;
  }

  /* no loop running (phone-sized start, reduced motion, Save-Data): keep the pause button out of the way */
  .auth-video-stage.is-still .auth-video-pause {
    display: none;
  }

  .auth-video-copy {
    margin-top: auto;
    padding-top: 26px;
  }

  .login-hero.login-hero--video h1 {
    margin: 0;
    padding: 0;
    font-size: clamp(24px, 2.35vw, 30px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: #fff;
    white-space: normal;
  }

  .login-hero.login-hero--video .auth-video-lead {
    max-width: none;
    margin: 8px 0 0;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.72);
  }
}

/* ===== PHONES: compact row under the form ===== */
@media (max-width: 900px) {
  .auth-right .auth-video-mobile {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 44px;
    margin: 22px 0 0;
    padding: 10px;
    border: 1px solid rgba(27, 39, 51, 0.1);
    border-radius: 16px;
    background: #FAF8F5;
    box-shadow: none;
    font: inherit;
    text-align: left;
    color: #1B2733;
    cursor: pointer;
  }

  .auth-right .auth-video-mobile:focus-visible {
    outline: none;
    border-color: #168CA4;
    box-shadow: 0 0 0 3px rgba(22, 140, 164, 0.14);
  }

  .auth-video-mobile-thumb {
    position: relative;
    flex: none;
    width: 112px;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: #0A2530;
  }

  .auth-video-mobile-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .auth-video-mobile-play {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    transform: translate(-50%, -50%);
    box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.5);
  }

  .auth-video-mobile-play svg {
    width: 16px;
    height: 16px;
    fill: #168CA4;
    stroke: #168CA4;
  }

  .auth-video-mobile-text {
    font-size: 15px;
    font-weight: 650;
    line-height: 1.3;
    color: #1B2733;
  }
}

/* ===== THEATER (all screens) ===== */
.auth-video-theater {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.auth-video-theater::backdrop {
  background: rgba(9, 18, 25, 0.84);
}

.auth-video-theater-inner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(1120px, calc(100vw - 48px), calc((100vh - 140px) * 16 / 9));
  transform: translate(-50%, -50%);
}

.auth-video-theater-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.auth-video-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}

.auth-video-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

.auth-video-close:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.auth-video-close svg {
  width: 20px;
  height: 20px;
}

.auth-video-film {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: #000;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.65);
}

.auth-video-film::cue {
  font-size: 22px;
  background: rgba(10, 18, 24, 0.82);
}

@media (max-width: 900px) {
  .auth-video-theater-inner {
    width: min(calc(100vw - 24px), calc((100vh - 120px) * 16 / 9));
  }

  .auth-video-film::cue {
    font-size: 15px;
  }
}

/* phones held sideways: use the whole height */
@media (max-height: 500px) and (orientation: landscape) {
  .auth-video-theater-head {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    margin: 0;
  }

  .auth-video-theater-inner {
    width: min(calc(100vw - 24px), calc((100vh - 16px) * 16 / 9));
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-video-play-icon,
  .auth-video-pause {
    transition: none;
  }

  .auth-video-play:hover .auth-video-play-icon {
    transform: none;
  }
}

/* ===== DESKTOP: no big play button; sound and pause as small discs in the corner ===== */
@media (min-width: 901px) {
  .auth-video-stage .auth-video-play {
    display: none;
  }

  .auth-video-stage .auth-video-pause,
  .auth-video-stage .auth-video-sound {
    position: absolute;
    bottom: 10px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--fam-paper);
    box-shadow: var(--fam-float-shade);
    color: var(--fam-ink);
    opacity: 1;
    cursor: pointer;
    transition: background-color 0.16s ease;
  }

  .auth-video-stage .auth-video-pause {
    right: 10px;
  }

  .auth-video-stage .auth-video-sound {
    right: 54px;
  }

  /* a 44 px area to press round each 36 px disc */
  .auth-video-stage :is(.auth-video-pause, .auth-video-sound)::before {
    content: "";
    position: absolute;
    inset: -4px;
  }

  .auth-video-stage :is(.auth-video-pause, .auth-video-sound):hover {
    background: var(--fam-soft);
  }

  /* the gap inside the ring takes the disc's white, so the ring stands out on every frame of the film */
  .auth-video-stage :is(.auth-video-pause, .auth-video-sound):focus-visible {
    outline: 2px solid var(--ans-focus-ring);
    outline-offset: 2px;
    box-shadow: var(--fam-float-shade), 0 0 0 2px var(--fam-paper);
  }

  .auth-video-stage :is(.auth-video-pause, .auth-video-sound) svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
  }

  .auth-video-stage .auth-video-pause .i-play {
    stroke: currentColor;
  }

  .auth-video-stage .auth-video-sound .i-sound-on,
  .auth-video-stage .auth-video-sound.is-on .i-sound-off {
    display: none;
  }

  .auth-video-stage .auth-video-sound.is-on .i-sound-on {
    display: block;
  }

  /* reduced motion and Save-Data: the loop stays still and the discs stay */
  .auth-video-stage.is-still .auth-video-pause {
    display: grid;
  }

  .auth-video-loop::cue {
    font-size: 15px;
    background: rgba(10, 18, 24, 0.82);
  }
}
