/* The customer portal's own sheet (internal/web/customer_portal.templ).
 *
 * The panel's brand, quieter: night blue, glass over the sign-in video, one
 * signal blue kept for what is switched on and for the one button a page has.
 * Read on a telephone first, then on a desk; Samsung and LG televisions run
 * Chromium 85, so nothing here needs :has() or color-mix(). */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/pjs_400_lat.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/pjs_400_ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/pjs_600_lat.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/pjs_600_ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/pjs_700_lat.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/pjs_700_ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --cp-night: #05080f;
  --cp-deep: #0b1322;
  --cp-raise: rgba(17, 27, 46, 0.6);
  --cp-glass: rgba(12, 18, 30, 0.58);
  --cp-ink: #e6edf6;
  --cp-mute: #9aa8bc;
  --cp-faint: #6f7d92;
  --cp-line: rgba(130, 160, 210, 0.16);
  --cp-signal: #3b8bf5;
  --cp-signal-hi: #74b4ff;
  --cp-warn: #f2b84b;
  --cp-stop: #f0626a;
  --cp-live: #3dd68c;
  --cp-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--cp-night);
  color: var(--cp-ink);
  font: 400 16px/1.55 var(--cp-font);
  font-variant-numeric: tabular-nums;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--cp-signal-hi);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ------------------------------------------------------------ sign-in */

.cp-auth {
  display: flex;
  background: var(--cp-night) url("/assets/video/login-bg.jpg") center / cover no-repeat fixed;
}

.cp-auth-video {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.cp-auth::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 8, 15, 0.34) 0%, rgba(5, 8, 15, 0.52) 55%, rgba(5, 8, 15, 0.84) 100%);
}

.cp-auth-main {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: max(28px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.cp-logo {
  width: min(300px, 78vw);
  height: auto;
  filter: drop-shadow(0 0 22px rgba(60, 140, 255, 0.35));
}

.cp-auth-card {
  width: 100%;
  padding: 26px 22px 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: var(--cp-glass);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
}

.cp-auth-card h1 {
  margin-bottom: 18px;
  font-size: 21px;
}

.cp-form {
  display: grid;
  gap: 14px;
}

.cp-field {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--cp-mute);
}

.cp-field input {
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--cp-ink);
  font: 500 16px var(--cp-font);
}

.cp-field input:focus {
  outline: none;
  border-color: var(--cp-signal);
  box-shadow: 0 0 0 3px rgba(59, 139, 245, 0.25);
}

/* Cloudflare's challenge draws itself into this box; it is held open so the
   button below it does not jump when the challenge appears. */
.cf-turnstile {
  min-height: 65px;
}

.cp-button {
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #2f7bf6 0%, #4c9dff 52%, #1f5fd1 100%);
  box-shadow: 0 8px 24px rgba(47, 123, 246, 0.35);
  color: #fff;
  font: 600 16px var(--cp-font);
  cursor: pointer;
}

.cp-button:hover {
  filter: brightness(1.08);
}

.cp-hint {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--cp-mute);
}

.cp-note {
  margin: 0;
  color: var(--cp-mute);
}

.cp-problem,
.cp-notice {
  margin: 0;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px;
}

.cp-problem {
  border: 1px solid rgba(240, 98, 106, 0.38);
  background: rgba(70, 18, 24, 0.55);
  color: #ffd7d9;
}

.cp-notice {
  border: 1px solid rgba(61, 214, 140, 0.35);
  background: rgba(14, 50, 34, 0.55);
  color: #c9f7df;
}

.cp-main .cp-problem,
.cp-main .cp-notice {
  margin-bottom: 16px;
}

.cp-langs {
  display: flex;
  gap: 4px;
  font-size: 13px;
}

.cp-langs a {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--cp-mute);
  text-decoration: none;
}

.cp-langs a[aria-current] {
  background: rgba(255, 255, 255, 0.08);
  color: var(--cp-ink);
}

.cp-langs abbr {
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  .cp-auth-video {
    display: none;
  }
}

/* -------------------------------------------------------- signed in */

.cp-app {
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  background:
    radial-gradient(1100px 560px at 18% -12%, rgba(35, 90, 190, 0.2), transparent 62%),
    var(--cp-night);
}

.cp-top {
  max-width: 760px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cp-brand img {
  display: block;
  width: auto;
  height: 24px;
}

.cp-top-end {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cp-top-end form {
  margin: 0;
}

.cp-quiet {
  padding: 7px 14px;
  border: 1px solid var(--cp-line);
  border-radius: 999px;
  background: none;
  color: var(--cp-mute);
  font: 500 14px var(--cp-font);
  cursor: pointer;
}

.cp-quiet:hover {
  border-color: rgba(130, 160, 210, 0.35);
  color: var(--cp-ink);
}

/* On a telephone the three places sit under the thumb. */
.cp-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--cp-line);
  background: rgba(8, 12, 22, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.cp-tabs a {
  padding: 15px 6px;
  color: var(--cp-mute);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
}

.cp-tabs a[aria-current] {
  color: var(--cp-ink);
  box-shadow: inset 0 2px 0 var(--cp-signal);
}

.cp-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 22px 16px 32px;
}

.cp-title {
  margin: 4px 0 20px;
  font-size: 26px;
}

.cp-block {
  margin-top: 30px;
}

.cp-block h2 {
  margin-bottom: 10px;
  color: var(--cp-mute);
  font-size: 15px;
}

/* The subscription: the one thing a customer comes to read. */
.cp-plan {
  padding: 22px;
  border: 1px solid rgba(110, 160, 240, 0.22);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(47, 123, 246, 0.17) 0%, rgba(17, 27, 46, 0.6) 58%);
}

.cp-plan-state {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cp-live);
  font-weight: 600;
}

.cp-plan-state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(61, 214, 140, 0.16);
}

.cp-plan-until {
  margin: 10px 0 0;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.cp-plan-left {
  margin: 6px 0 0;
  color: var(--cp-mute);
}

.cp-plan-left strong {
  color: var(--cp-ink);
  font-weight: 600;
}

.cp-plan-soon .cp-plan-state {
  color: var(--cp-warn);
}

.cp-plan-soon .cp-plan-state::before {
  box-shadow: 0 0 0 4px rgba(242, 184, 75, 0.18);
}

.cp-plan-ended {
  border-color: rgba(240, 98, 106, 0.3);
  background: linear-gradient(160deg, rgba(240, 98, 106, 0.14) 0%, rgba(17, 27, 46, 0.6) 58%);
}

.cp-plan-ended .cp-plan-state {
  color: var(--cp-stop);
}

.cp-plan-ended .cp-plan-state::before {
  box-shadow: 0 0 0 4px rgba(240, 98, 106, 0.18);
}

.cp-meter {
  display: grid;
  gap: 8px;
}

.cp-meter meter {
  width: 100%;
  height: 10px;
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.cp-meter meter::-webkit-meter-bar {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.cp-meter meter::-webkit-meter-optimum-value,
.cp-meter meter::-webkit-meter-suboptimum-value {
  border-radius: 999px;
  background: var(--cp-signal);
}

.cp-meter meter::-moz-meter-bar {
  border-radius: 999px;
  background: var(--cp-signal);
}

.cp-meter p {
  margin: 0;
  color: var(--cp-mute);
}

.cp-meter strong {
  color: var(--cp-ink);
  font-weight: 600;
}

.cp-setup {
  margin: 0;
  border-top: 1px solid var(--cp-line);
}

.cp-setup-row {
  padding: 12px 0;
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--cp-line);
}

/* A grid item is as wide as its longest word unless told otherwise: the M3U
   link pushed the telephone's page sideways. */
.cp-setup-row > * {
  min-width: 0;
}

.cp-setup dt {
  color: var(--cp-mute);
  font-size: 13px;
}

.cp-setup dd {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cp-setup-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.cp-copy[data-done] {
  border-color: rgba(61, 214, 140, 0.4);
  color: var(--cp-live);
}

.cp-copied-word,
.cp-offscreen {
  position: absolute;
  left: -9999px;
}

/* ---------------------------------------------------------- bouquets */

.cp-bouquets {
  margin: 0;
}

.cp-switches {
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  border: 1px solid var(--cp-line);
  border-radius: 16px;
  background: var(--cp-raise);
}

.cp-switches li + li {
  border-top: 1px solid var(--cp-line);
}

.cp-switch {
  position: relative;
  min-height: 64px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.cp-switch-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.cp-switch-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.cp-switch-meta {
  color: var(--cp-mute);
  font-size: 13px;
}

.cp-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.cp-switch-track {
  position: relative;
  flex: none;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  transition: background-color 0.18s ease;
}

.cp-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s ease;
}

.cp-switch input:checked + .cp-switch-track {
  background: var(--cp-signal);
}

.cp-switch input:checked + .cp-switch-track::after {
  transform: translateX(20px);
}

.cp-switch input:focus-visible + .cp-switch-track {
  outline: 2px solid var(--cp-signal-hi);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .cp-switch-track,
  .cp-switch-track::after {
    transition: none;
  }
}

.cp-adult {
  margin-top: 18px;
  border: 1px solid rgba(240, 98, 140, 0.24);
  border-radius: 16px;
  background: rgba(70, 22, 40, 0.35);
}

/* The save button stays in reach above the telephone's tab bar. */
.cp-savebar {
  position: sticky;
  bottom: calc(66px + env(safe-area-inset-bottom));
  margin-top: 8px;
  padding: 14px 0;
  background: linear-gradient(180deg, rgba(5, 8, 15, 0) 0%, var(--cp-night) 40%);
}

.cp-savebar .cp-button {
  width: 100%;
}

/* ---------------------------------------------------------- activity */

.cp-live-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cp-live-head::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cp-live);
  box-shadow: 0 0 0 4px rgba(61, 214, 140, 0.16);
}

.cp-log {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--cp-line);
}

.cp-log li {
  padding: 12px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  row-gap: 2px;
  border-bottom: 1px solid var(--cp-line);
}

.cp-log-main {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.cp-log-sub {
  grid-column: 1;
  color: var(--cp-mute);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.cp-log-when {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  align-content: start;
  gap: 2px;
  color: var(--cp-mute);
  font-size: 13px;
  text-align: right;
}

.cp-log-len {
  color: var(--cp-faint);
}

.cp-empty {
  margin: 0;
  color: var(--cp-mute);
}

/* --------------------------------------------------------- on a desk */

@media (min-width: 768px) {
  .cp-app {
    padding-bottom: 40px;
  }

  .cp-brand img {
    height: 28px;
  }

  /* The panel's sign-in film carries the panel's own mark in its top right
     corner; grown from the bottom left, the corner falls outside the
     screen. A telephone's narrow crop never shows it. */
  .cp-auth-video {
    transform: scale(1.35);
    transform-origin: 0 100%;
  }

  .cp-auth {
    background-size: 135% auto;
    background-position: 0 100%;
  }

  .cp-tabs {
    position: static;
    max-width: 760px;
    margin: 4px auto 0;
    padding: 0 16px;
    display: flex;
    gap: 4px;
    border-top: 0;
    border-bottom: 1px solid var(--cp-line);
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .cp-tabs a {
    padding: 12px 14px;
  }

  .cp-tabs a[aria-current] {
    box-shadow: inset 0 -2px 0 var(--cp-signal);
  }

  .cp-savebar {
    bottom: 0;
  }

  .cp-savebar .cp-button {
    width: auto;
    min-width: 200px;
  }

  .cp-setup-row {
    grid-template-columns: 160px 1fr;
    align-items: center;
  }
}
