/* ---------------------------------------------------------------
   COLORS AND SIZES
   These are CSS VARIABLES. Change a color here and it changes
   everywhere on the site.
   --------------------------------------------------------------- */
:root {
  /* Tell the browser this is a dark site, so scrollbars are dark too */
  color-scheme: dark;
  /* The colors of the BEST КИНО logo: bright lime on black */
  --bg: #050505;
  --surface: #121212;
  --surface-2: #1e1e1e;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4f5f2;
  --muted: #9a9d94;
  --accent: #cdf711;
  --accent-strong: #dcff4a;
  --accent-ink: #0a0a0a;       /* text ON the accent color */
  /* The lime color of the big buttons */
  --accent-gradient: linear-gradient(90deg, #c4f000, #dcff4a);
  --danger: #ff6b6b;
  --good: #5fd08a;
  --radius: 14px;
  --page-padding: clamp(14px, 3vw, 40px);
  --display-font: Oswald, Inter, system-ui, sans-serif;
}

/* The light theme: the same names, other colors.
   script.js puts data-theme="light" on the <html> element. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f1;
  --surface: #ffffff;
  --surface-2: #e9ebe4;
  --line: rgba(20, 25, 10, 0.12);
  --text: #121410;
  --muted: #62665a;
  /* Bright lime cannot be read on white, so here it is darker */
  --accent: #557000;
  --accent-strong: #6b8c00;
  --accent-ink: #ffffff;
  --accent-gradient: linear-gradient(90deg, #4c6400, #6b8c00);
  --danger: #d43c3c;
  --good: #1f8f4e;
}

* {
  box-sizing: border-box;
}

/* Anything with the "hidden" attribute stays hidden, even if a
   rule below gives it a "display". */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;   /* so the top bar does not cover a heading */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
}

/* A clear outline for people who use the keyboard */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px var(--page-padding) 0;
}

/* ---------------------------------------------------------------
   BUTTONS
   --------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, transform 0.15s, opacity 0.15s, border-color 0.15s;
}

.button:active {
  transform: scale(0.97);
}

.button:disabled {
  opacity: 0.5;
  cursor: default;
}

.button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Colored button: the main action */
.button-accent {
  background: var(--accent-gradient);
  color: var(--accent-ink);
}

.button-accent:hover:not(:disabled) {
  filter: brightness(1.1);
}

/* The big, wide buttons in the window for one movie */
.button-big {
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Button with only a line around it */
.button-outline {
  background: transparent;
  border-color: var(--text);
  color: var(--text);
}

.button-outline:hover:not(:disabled) {
  background: rgba(128, 140, 160, 0.18);
}

/* See-through button: the quiet action */
.button-ghost {
  background: rgba(128, 140, 160, 0.14);
  border-color: var(--line);
  color: var(--text);
}

.button-ghost:hover:not(:disabled) {
  background: rgba(128, 140, 160, 0.26);
}

.button-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.button-danger:hover:not(:disabled) {
  background: var(--danger);
  color: white;
}

.button-large {
  font-size: 15px;
  padding: 12px 22px;
}

.button-wide {
  width: 100%;
  padding: 12px 18px;
  margin-top: 10px;
}

/* A round button with only a drawing in it */
.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.800;
  stroke-linejoin: round;
}

/* An icon button with no circle around it (in the top bar) */
.icon-plain {
  border-color: transparent;
  background: transparent;
}

.icon-plain:hover {
  background: rgba(128, 140, 160, 0.18);
}

.icon-plain svg {
  width: 22px;
  height: 22px;
  stroke-linecap: round;
}

/* ---------------------------------------------------------------
   THE TOP BAR
   --------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

/* One line: logo, category links, bundle button, search button,
   and at the far right the theme and login buttons. */
.header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1440px;
  min-height: 64px;
  margin: 0 auto;
  padding: 10px var(--page-padding);
}

/* The three-lines button is only for phones (see PHONES below) */
.header-menu-button {
  display: none;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 28px;
}

.nav-link {
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0.85;
}

.nav-link:hover {
  opacity: 1;
  color: var(--accent);
}

/* The category that is chosen right now */
.nav-link[aria-pressed="true"] {
  opacity: 1;
  color: var(--accent);
  font-weight: 700;
}

/* The bundle button: light on the dark bar, so it stands out */
.header-plans {
  margin: 0 6px 0 10px;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.header-plans:hover {
  filter: brightness(0.9);
}

/* The login button: a small person and the word */
.header-login {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.header-login[hidden] {
  display: none;
}

.header-login:hover {
  background: rgba(128, 140, 160, 0.18);
}

.header-login svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.logo {
  display: flex;
  align-items: center;
  color: var(--accent);
  font-family: var(--display-font);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  text-decoration: none;
}

/* The logo picture */
.logo img {
  display: block;
  height: 44px;
  width: auto;
}

/* The logo is bright lime, made for a black background. On the
   light theme it gets a small black box behind it. */
:root[data-theme="light"] .logo {
  padding: 4px 8px;
  border-radius: 10px;
  background: #050505;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-left: auto;          /* pushes these to the far right */
}

/* ---------------------------------------------------------------
   THE SEARCH BOX: opens under the top bar
   --------------------------------------------------------------- */
.search-box {
  position: relative;
  width: calc(100% - 2 * var(--page-padding));
  max-width: 520px;
  margin: 0 auto 12px;
}

.search-box input {
  width: 100%;
  margin: 0;
  padding: 10px 44px 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.search-box svg {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 30px;
  height: 30px;
  padding: 7px;
  border-radius: 50%;
  background: var(--accent-gradient);
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 2;
  stroke-linecap: round;
  transform: translateY(-50%);
  pointer-events: none;
}

/* The round circle with the first letter of your email */
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  text-transform: uppercase;
}

/* The avatar at the top is a button: a click opens "my page" */
button.avatar {
  padding: 0;
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button.avatar:hover {
  filter: brightness(1.1);
}

/* ---------------------------------------------------------------
   MY PAGE
   --------------------------------------------------------------- */
.profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 40px;        /* room for the X button */
}

.avatar-big {
  width: 56px;
  height: 56px;
  font-size: 24px;
}

.profile-who {
  min-width: 0;
}

.profile-who h2 {
  padding-right: 0;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.profile-who .dialog-hint {
  margin-top: 0;
  overflow-wrap: anywhere;
}

.profile-heading {
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-plan {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.profile-plan.active {
  border-color: var(--good);
  color: var(--good);
}

.profile-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.profile-empty {
  color: var(--muted);
  font-size: 14px;
}

.profile-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.profile-item:hover {
  background: rgba(128, 140, 160, 0.16);
}

.profile-item-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-item-note {
  flex: none;
  color: var(--muted);
  font-size: 13px;
}

.profile-logout {
  margin-top: 28px;
}

/* The number of waiting orders, on the avatar (admins only).
   script.js puts the number in data-count. */
button.avatar {
  position: relative;
}

button.avatar[data-count]::after {
  content: attr(data-count);
  position: absolute;
  top: -5px;
  right: -6px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* The "log in with Google" button: white, like Google's own */
.google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 18px;
  padding: 11px 18px;
  border: 1px solid #dadce0;
  border-radius: 10px;
  background: #ffffff;
  color: #1f1f1f;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.google-button:hover:not(:disabled) {
  background: #f1f3f4;
}

.google-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.google-button svg {
  flex: none;
  width: 20px;
  height: 20px;
}

/* The line with "ЭСВЭЛ" (or) in the middle */
.or-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.or-line::before,
.or-line::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* A button that looks like a link (forgot password) */
.link-button {
  display: block;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.link-button:hover {
  color: var(--text);
}

/* The small number on the admin button: how many orders wait */
.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 12px;
}

/* ---------------------------------------------------------------
   THE MEMBERSHIP PLANS (in their own pop-up window)
   --------------------------------------------------------------- */
.plans-card {
  display: flex;
  flex-direction: column;
}

/* The row of plan buttons: 24 hours, 1 month, ... */
.plan-tabs {
  display: flex;
  gap: 4px;
  margin-top: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}

.plan-tab {
  flex: 1;
  padding: 8px 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.plan-tab:hover {
  color: var(--text);
}

/* The plan that is chosen right now */
.plan-tab[aria-pressed="true"] {
  background: var(--accent-gradient);
  color: var(--accent-ink);
}

.plan-badge {
  align-self: flex-start;
  margin-top: 16px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 12px;
}

.plan-price s {
  color: var(--muted);
  font-size: 15px;
}

.plan-price strong {
  font-family: var(--display-font);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
}

.plan-note {
  min-height: 1.5em;
  color: var(--muted);
  font-size: 13px;
}

.plan-points {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  font-size: 14px;
}

.plan-points li {
  position: relative;
  margin-top: 8px;
  padding-left: 26px;
}

/* A small tick drawn with borders */
.plan-points li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 5px;
  width: 6px;
  height: 11px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.plan-status {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--good);
  border-radius: 10px;
  color: var(--good);
  font-size: 14px;
  font-weight: 600;
}

.plans-card .button-wide {
  margin-top: 18px;
}

/* ---------------------------------------------------------------
   THE MENU: a tall window on the left side of the screen
   --------------------------------------------------------------- */
.dialog.dialog-menu {
  width: min(320px, 86vw);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;                  /* a dialog is in the middle unless margin is 0 */
  border-width: 0 1px 0 0;
  border-radius: 0 20px 20px 0;
}

.dialog.dialog-menu[open] {
  animation: slide-in 0.25s ease-out;
}

.dialog-menu .dialog-body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.menu-heading {
  margin: 22px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.menu-heading:first-of-type {
  margin-top: 4px;
}

.menu-item {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.menu-item:hover {
  background: rgba(128, 140, 160, 0.16);
}

.menu-item-accent {
  color: var(--accent);
  font-weight: 700;
}

/* The genre that is chosen right now */
.menu-item[aria-pressed="true"] {
  background: var(--accent-gradient);
  color: var(--accent-ink);
}

/* The admin and log out buttons sit at the bottom of the menu */
.menu-bottom {
  margin-top: auto;
  padding-top: 20px;
}

/* ---------------------------------------------------------------
   THE MOVIES
   --------------------------------------------------------------- */
.shelf {
  padding: 34px 0 0;
}

.shelf-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

/* "See all" at the right end of a row heading */
.shelf-link {
  margin-left: auto;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.shelf-link:hover {
  text-decoration: underline;
}

.shelf-heading h2 {
  font-family: var(--display-font);
  font-size: 24px;
  font-weight: 700;
}

.movie-count {
  color: var(--muted);
  font-size: 14px;
}

/* THE GRID: auto-fill means "fit as many columns as the screen allows" */
.movie-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 28px 16px;
}

.movie-card {
  position: relative;
  min-width: 0;
  animation: rise 0.5s ease-out both;
}

/* The poster is a button, so it can be clicked with the keyboard too */
.movie-poster {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;        /* the shape of a real movie poster */
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-poster img,
.movie-poster video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;          /* fill the shape, cut off the extra */
  transition: transform 0.4s ease;
}

/* The big first letter on a card with no picture */
.movie-letter {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  color: var(--muted);
  font-family: var(--display-font);
  font-size: 72px;
  font-weight: 700;
}

/* A round lock in the middle of a poster you have not paid for */
.movie-lock {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.35);
}

.movie-lock svg {
  width: 46px;
  height: 46px;
  padding: 12px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.78);
  fill: var(--accent-strong);
}

/* A dark fade and a round play button, shown on hover */
.movie-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s;
}

.movie-play svg {
  width: 52px;
  height: 52px;
  padding: 15px;
  border-radius: 50%;
  background: var(--accent-gradient);
  fill: var(--accent-ink);
  transform: scale(0.8);
  transition: transform 0.25s;
}

.movie-poster:hover,
.movie-poster:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.movie-poster:hover img,
.movie-poster:hover video {
  transform: scale(1.06);
}

.movie-poster:hover .movie-play,
.movie-poster:focus-visible .movie-play {
  opacity: 1;
}

.movie-poster:hover .movie-play svg,
.movie-poster:focus-visible .movie-play svg {
  transform: scale(1);
}

.movie-title {
  margin-top: 10px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* The price under the title */
.movie-price {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

/* "Free" or "Open": a movie you may already watch */
.movie-price.open {
  color: var(--good);
}

/* Shown when there are no movies to show */
.empty {
  grid-column: 1 / -1;
  padding: 44px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

/* Grey placeholder cards with a moving shine */
.skeleton .movie-poster {
  cursor: default;
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 300% 100%;
  animation: shine 1.4s linear infinite;
}

.site-footer {
  max-width: 1440px;
  margin: 56px auto 0;
  padding: 24px var(--page-padding);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 8px;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--text);
}

/* ---------------------------------------------------------------
   TEXT PAGES: privacy.html and terms.html
   --------------------------------------------------------------- */
.text-page {
  max-width: 760px;
  padding-bottom: 64px;
  line-height: 1.7;
}

.text-page a {
  color: var(--accent);
}

.text-page h1 {
  margin-top: 24px;
  font-family: var(--display-font);
  font-size: 32px;
}

.text-page h2 {
  margin-top: 28px;
  font-size: 18px;
}

.text-page p,
.text-page ul {
  margin-top: 10px;
}

.text-page ul {
  padding-left: 22px;
}

.text-page li {
  margin-top: 6px;
}

.text-page-date {
  color: var(--muted);
  font-size: 13px;
}

/* ---------------------------------------------------------------
   POP-UP WINDOWS
   --------------------------------------------------------------- */
.dialog {
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.dialog[open] {
  animation: pop 0.25s ease-out;
}

/* The dark, blurry layer between the pop-up and the page */
.dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dialog-body {
  position: relative;
}

.dialog-padded {
  padding: 28px;
}

.dialog h2 {
  font-family: var(--display-font);
  font-size: 26px;
  font-weight: 700;
  padding-right: 40px;        /* room for the X button */
}

.dialog-hint {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(40, 50, 66, 0.85);
  cursor: pointer;
  transition: background 0.15s;
}

.dialog-close:hover {
  background: rgba(80, 92, 110, 0.95);
}

.dialog-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #f2f5fa;
  stroke-width: 2;
  stroke-linecap: round;
}

.dialog-wide {
  width: min(680px, calc(100vw - 24px));
}

/* ---- The window for one movie ---- */
.dialog-movie {
  width: min(980px, calc(100vw - 24px));
}

.movie-detail {
  display: flex;
  gap: 30px;
  padding: 30px;
}

.movie-detail-poster {
  position: relative;
  flex: none;
  align-self: flex-start;
  width: 300px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}

.movie-detail-poster img,
.movie-detail-poster video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.movie-detail-text {
  flex: 1;
  min-width: 0;
}

/* The genre, in small orange capital letters */
.movie-detail-genre {
  padding-right: 44px;        /* room for the X button */
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.movie-detail-text h2 {
  margin-top: 6px;
  font-family: inherit;
  font-size: 26px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.movie-detail-price {
  margin-top: 8px;
  font-size: 17px;
  font-weight: 600;
}

.movie-detail-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.movie-detail-meta .star {
  color: var(--accent);
  font-weight: 600;
}

.movie-detail-description {
  margin-top: 16px;
  white-space: pre-wrap;      /* keep line breaks the writer typed */
  overflow-wrap: anywhere;    /* break very long words on phones */
}

/* "You may watch until ..." */
.movie-access {
  margin-top: 16px;
  color: var(--good);
  font-size: 14px;
  font-weight: 600;
}

.movie-detail-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

/* The small words under the "bundle" button */
.movie-plan-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.movie-detail-line {
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}

.movie-detail-line span {
  color: var(--text);
}

/* "You may also like", under the movie */
.movie-more {
  padding: 24px 30px 30px;
  border-top: 1px solid var(--line);
}

.movie-more h3 {
  margin-bottom: 16px;
  font-family: var(--display-font);
  font-size: 22px;
}

.movie-more .movie-grid {
  grid-template-columns: repeat(6, 1fr);
}

.movie-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.like-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.like-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.800;
}

/* Liked: the heart is filled in */
.like-button[aria-pressed="true"] {
  border-color: var(--danger);
  color: var(--danger);
}

.like-button[aria-pressed="true"] svg {
  fill: currentColor;
}

.stars {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stars-label {
  color: var(--muted);
  font-size: 14px;
}

.stars-row {
  display: inline-flex;
}

.star-button {
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

/* A star you have given */
.star-button.on {
  color: var(--accent);
}

.star-button:hover {
  transform: scale(1.15);
}

.movie-detail-text .button-danger {
  margin-top: 22px;
}

/* ---- The player ---- */
.dialog-player {
  width: min(1100px, calc(100vw - 24px));
  background: #000;
}

#player-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 74dvh;
  background: #000;
}

/* The YouTube trailer fills the same shape as the movie player */
.trailer-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 74dvh;
  background: #000;
}

.trailer-box iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* The admin's buttons at the bottom of a movie: change, delete */
.movie-admin-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.player-info {
  padding: 16px 24px 20px;
  background: var(--surface);
}

.player-info h2 {
  font-size: 22px;
}

.player-meta {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}

/* ---- The payment window ---- */
.order-amount strong {
  font-family: var(--display-font);
  font-size: 40px;
  font-weight: 700;
}

.steps {
  margin: 14px 0 0;
  padding-left: 20px;
}

.steps li {
  margin-top: 14px;
  padding-left: 4px;
}

.pay-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin: 10px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-size: 14px;
}

.pay-box dt {
  color: var(--muted);
}

.pay-box dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.order-code-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

/* The code is big, so nobody mistypes it */
.order-code {
  padding: 6px 16px;
  border: 1.500px dashed var(--accent);
  border-radius: 10px;
  color: var(--accent);
  font-family: var(--display-font);
  font-size: 30px;
  letter-spacing: 0.12em;
}

/* ---- The admin window ---- */
.admin-subheading {
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.order-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.order-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.order-row-code {
  font-family: var(--display-font);
  font-size: 22px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.order-row-text {
  flex: 1;
  min-width: 180px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.order-row-text small {
  display: block;
  color: var(--muted);
}

.order-row-amount {
  font-weight: 700;
}

.order-row-status {
  color: var(--muted);
  font-size: 13px;
}

.order-row-status.paid {
  color: var(--good);
}

/* One member in the admin window: name, time left, a bar, buttons */
.member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 14px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.member-who {
  min-width: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.member-who small {
  display: block;
  color: var(--muted);
}

.member-time {
  color: var(--good);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

/* The bar goes across the whole row */
.member-bar {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.member-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--good);
}

.member-bar-fill.low {
  background: var(--danger);
}

.member-buttons {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-small {
  padding: 6px 12px;
  font-size: 13px;
}

/* A bundle that has ended */
.member-row.ended .member-time {
  color: var(--muted);
}

.order-empty {
  padding: 12px 0;
  color: var(--muted);
  font-size: 14px;
}

/* ---------------------------------------------------------------
   FORMS
   --------------------------------------------------------------- */
form {
  margin-top: 18px;
}

label {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form select,
form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

textarea {
  resize: vertical;
}

::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-grow {
  flex: 1;
  min-width: 0;
}

.form-small {
  width: 110px;
}

/* The box you click or drop a file on */
.file-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 22px 16px;
  border: 1.500px dashed var(--muted);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.file-zone:hover,
.file-zone:focus-within {
  border-color: var(--accent);
  background: rgba(245, 176, 65, 0.07);
}

/* script.js adds "has-file" after you choose a file */
.file-zone.has-file {
  border-style: solid;
}

/* The real file input: invisible, but it covers the whole box */
.file-zone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-zone > svg {
  width: 28px;
  height: 28px;
  margin-bottom: 6px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file-zone-text {
  font-weight: 600;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.file-zone-hint {
  color: var(--muted);
  font-size: 12px;
}

.file-zone-small {
  flex-direction: row;
  gap: 14px;
  margin-top: 16px;
  padding: 14px 16px;
  text-align: left;
}

.poster-preview {
  width: 40px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
}

.form-message {
  min-height: 1.5em;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.form-message.error {
  color: var(--danger);
}

/* The upload progress line */
.progress {
  height: 6px;
  margin-top: 16px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.2s;
}

/* ---------------------------------------------------------------
   THE SMALL MESSAGE AT THE BOTTOM
   --------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  font-size: 14px;
  opacity: 0;
  transform: translate(-50%, 20px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------------------------------------------------------
   MOVEMENT
   --------------------------------------------------------------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
}

@keyframes slide-in {
  from {
    transform: translateX(-100%);
  }
}

@keyframes shine {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -50% 0;
  }
}

/* Some people get dizzy from movement and turn it off in their
   computer settings. Respect that. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ---------------------------------------------------------------
   TABLETS
   --------------------------------------------------------------- */
@media (max-width: 980px) {
  /* The category links do not fit any more: they move into the
     menu window, behind the three-lines button. */
  .header-menu-button {
    display: grid;
  }

  .header-nav,
  .header-plans {
    display: none;
  }

  .header-inner {
    gap: 4px;
  }

  /* The search button joins the buttons on the right */
  .logo {
    margin-right: auto;
  }

  .header-actions {
    margin-left: 0;
  }

  .movie-detail-poster {
    width: 220px;
  }

  .movie-more .movie-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------------------------------------------------------------
   PHONES
   --------------------------------------------------------------- */
@media (max-width: 640px) {
  .logo {
    font-size: 24px;
  }

  /* Only the small person, without the word */
  .header-login span {
    display: none;
  }

  .logo img {
    height: 30px;
  }

  /* Three posters side by side, like a real movie app */
  .movie-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px 10px;
  }

  .movie-title {
    font-size: 13px;
  }

  .movie-price {
    font-size: 12px;
  }

  .movie-lock svg {
    width: 36px;
    height: 36px;
    padding: 9px;
  }

  .shelf-heading h2 {
    font-size: 20px;
  }

  /* The window for one movie fills the whole phone screen */
  .dialog.dialog-movie {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .movie-detail {
    flex-direction: column;
    gap: 18px;
    padding: 22px 18px;
  }

  .movie-detail-poster {
    width: 170px;
  }

  .movie-detail-text h2 {
    font-size: 22px;
  }

  .movie-more {
    padding: 20px 18px 26px;
  }

  .dialog-padded {
    padding: 22px 18px;
  }
}
