/* The editor in the site's own dark palette and fonts. */
:root {
  color-scheme: dark;
  --void: #0C1012; --void-2: #151B1E; --void-3: #20282D;
  --blue: #02B0F5; --blue-deep: #027EB0; --sky: #8EDCFA;
  --cream: #F4F6F7; --ash: #D1D9DE; --ash-dim: #9BAAB3; --line: #303C44; --red: #FF8A8A; --green: #7EE2A8;
  font: 16px/1.5 "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif; color: var(--ash); background: var(--void);
}
* { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; background: var(--void); }
a { color: var(--sky); }
header { display: flex; align-items: center; gap: 24px; padding: 16px max(20px, calc((100% - 1080px) / 2)); border-bottom: 1px solid var(--line); background: var(--void-2); }
header a:first-child { color: var(--cream); font: 750 24px/1 "Gabarito", "Helvetica Neue", Arial, sans-serif; text-decoration: none; }
header span { color: var(--ash-dim); }
header .view { margin-left: auto; color: var(--blue); font-weight: 600; }
.logout { min-height: 34px; padding: 4px 12px; font-size: 14px; }
main { max-width: 1080px; margin: 28px auto 64px; padding: 0 20px; }
h1, h2, h3 { font-family: "Gabarito", "Helvetica Neue", Arial, sans-serif; color: var(--cream); }
h1 { font-size: 30px; margin: 0; }
h2 { font-size: 19px; margin: 28px 0 14px; }
h3 { font-size: 16px; margin: 22px 0 6px; color: var(--sky); }
.heading, .actions { display: flex; align-items: center; gap: 12px; }
.heading { justify-content: space-between; }
section { padding: 24px 0; border-top: 1px solid var(--line); margin-top: 24px; }
section.first { border-top: 0; margin-top: 0; padding-top: 8px; }
#editor { margin-top: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--void-2); }
#editor h2 { margin-top: 0; }
#message { min-height: 24px; margin: 0 0 18px; color: var(--ash); }
#message.error { color: var(--red); }
.hint { color: var(--ash-dim); margin: 6px 0 14px; }
small { font-weight: 400; color: var(--ash-dim); }

button, input, select, textarea { font: inherit; color: var(--cream); background: var(--void-3); border: 1px solid var(--line); border-radius: 8px; }
button { min-height: 42px; padding: 8px 16px; cursor: pointer; font-weight: 600; }
@media (hover: hover) { button:hover:not(:disabled) { border-color: var(--ash-dim); } }
button:disabled, input:disabled, select:disabled { opacity: .45; cursor: wait; }
#newItem, #saveItem, #keyButton, #useClip, .upload { background: var(--blue); border-color: var(--blue); color: var(--void); }
#newItem:hover:not(:disabled), #saveItem:hover:not(:disabled), #keyButton:hover:not(:disabled), #useClip:hover:not(:disabled) { background: var(--sky); border-color: var(--sky); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
input, select, textarea { min-width: 0; width: 100%; padding: 10px 12px; }
input[type="checkbox"] { width: 20px; height: 20px; padding: 0; accent-color: var(--blue); flex-shrink: 0; }
input[type="range"] { padding: 0; background: none; border: 0; accent-color: var(--blue); height: 32px; }
input[type="file"] { padding: 8px; }
textarea { resize: vertical; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; color: var(--cream); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 760px; }
.wide { grid-column: 1 / -1; }
.check { flex-direction: row; align-items: center; font-weight: 500; }
.photo { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.photo img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; }
.actions { margin-top: 22px; }

.menu-row { display: grid; grid-template-columns: 32px 48px minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.menu-row strong { display: block; font-weight: 600; color: var(--cream); overflow-wrap: anywhere; }
.menu-row small { display: block; }
.menu-row label { flex-direction: row; align-items: center; font-weight: 500; gap: 10px; }
.row-actions { display: flex; gap: 8px; }
.thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--void-3); }

/* "Add a video": the file input hides inside a big button; on a phone it opens the photo library. */
.upload { position: relative; display: inline-flex; flex-direction: row; align-items: center; min-height: 50px; padding: 10px 22px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.upload input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload:focus-within { outline: 2px solid var(--blue); outline-offset: 3px; }
.progress { height: 8px; max-width: 420px; margin-top: 14px; border-radius: 99px; background: var(--void-3); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .3s ease; }

/* Choosing the 15 seconds that play: a window over the page, for the top videos and the wall alike. */
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(5, 8, 10, .78); overflow-y: auto; }
.trim { width: min(760px, 100%); display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 22px; align-items: start; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--void-2); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.trim__view { position: relative; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: #000; }
.trim__view video, .trim__view canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.trim__controls h2 { margin-top: 0; }
.trim__time { font: 600 22px/1.2 "DM Mono", ui-monospace, Menlo, monospace; color: var(--cream); margin: 4px 0 10px; }
.trim__bar { position: relative; height: 10px; margin: 6px 0 2px; border-radius: 99px; background: var(--void-3); }
.trim__bar span { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: var(--blue); }

.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 200px)); gap: 18px; }
.slot { display: grid; gap: 8px; align-content: start; }
.slot img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; background: var(--void-3); }
.slot__name { font-weight: 700; color: var(--cream); }
.slot button { min-height: 38px; font-size: 14px; }
.upload--small { min-height: 42px; padding: 8px 14px; justify-content: center; font-size: 15px; border-radius: 8px; }
.clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.clip { display: grid; gap: 8px; align-content: start; font-weight: 400; font-size: 13px; color: var(--ash); }
.clip img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; background: var(--void-3); }
.clip__show { display: flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 600; color: var(--cream); }
.clip button { min-height: 36px; padding: 4px 10px; font-size: 14px; }

.key { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin: 0 0 24px; }
.key label { display: grid; gap: 6px; }
.key input { min-width: 260px; }
[hidden] { display: none !important; }

@media (max-width: 620px) {
  /* One row (Ty): name, then "View site" and the account button; its menu holds the two account actions. */
  header { flex-wrap: nowrap; gap: 14px; padding: 12px 16px; }
  header a:first-child { font-size: 21px; }
  header span { display: none; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .wide { grid-column: 1; }
  .menu-row { grid-template-columns: 32px 48px minmax(0, 1fr) auto; gap: 10px; }
  .row-actions { grid-column: 3 / -1; }
  .upload { width: 100%; justify-content: center; }
  .trim { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .upload--small { width: 100%; padding: 8px 6px; font-size: 14px; }
  .slot button { padding: 4px 6px; font-size: 12px; }
  .trim__view { max-width: 220px; margin: 0 auto; }
  .key input { min-width: 0; }
}

/* Forgot password / change password. */
.forgot { margin: -12px 0 18px; }
.linkish { min-height: 0; padding: 0; border: 0; background: none; color: var(--sky); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.forgot__help { max-width: 560px; margin: 0 0 24px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--void-2); }
.forgot__help p { margin: 0 0 12px; }
.forgot__help .actions { margin: 0; flex-wrap: wrap; }
.btnlike { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 16px; border-radius: 8px; background: var(--blue); color: var(--void); font-weight: 700; text-decoration: none; }
.pass { margin-top: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--void-2); }
.pass .hint { flex-basis: 100%; margin: 4px 0 0; }
#passSave { background: var(--blue); border-color: var(--blue); color: var(--void); }

#sendLink, #resetSave { background: var(--blue); border-color: var(--blue); color: var(--void); }
#resetForm .hint { flex-basis: 100%; margin: 0 0 6px; }
#forgotPanel { max-width: 560px; margin: 0 0 24px; }
#forgotPanel .hint { margin: 0 0 12px; }

/* Show/hide password: an eye inside the field. */
.secret { position: relative; display: block; }
.secret input { padding-right: 48px; }
.secret input::-ms-reveal { display: none; }
.eye { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: grid; place-items: center; width: 40px; height: 40px; min-height: 0; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--ash-dim); }
.eye:hover:not(:disabled) { color: var(--cream); }
.eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.eye .eye__shut, .eye[aria-pressed="true"] .eye__open { display: none; }
.eye[aria-pressed="true"] .eye__shut { display: block; }

/* One list each for videos and products: Show, Edit and Delete on every entry. */
.search { max-width: 420px; margin: 4px 0 6px; }
.danger { color: var(--red); }
@media (hover: hover) { .danger:hover:not(:disabled) { border-color: var(--red); } }
.clip__actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.row-actions { align-items: center; }
.row-actions label { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; margin-right: 6px; }
.menu-row small.warn { color: var(--ash-dim); }

/* Drag to reorder: a grip on every video and product (finger or mouse), numbers for the order. */
.menu-group, #videoList { position: relative; }
.grip { display: grid; place-items: center; width: 32px; height: 40px; min-height: 0; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ash-dim); cursor: grab; touch-action: none; }
.grip:hover:not(:disabled) { color: var(--cream); }
.grip svg { width: 20px; height: 20px; fill: currentColor; }
.clip__still { position: relative; }
.clip__still .grip { position: absolute; top: 6px; left: 6px; width: 38px; height: 38px; background: rgba(12, 16, 18, .72); color: var(--cream); }
.clip__name { font-weight: 700; color: var(--cream); font-size: 15px; }
.pos { display: inline-block; min-width: 1.7em; margin-right: 8px; color: var(--ash-dim); font: 500 14px/1 "DM Mono", ui-monospace, Menlo, monospace; }
.is-dragging { position: relative; z-index: 10; }
.menu-row.is-dragging { background: var(--void-3); border-radius: 10px; box-shadow: 0 14px 34px rgba(0, 0, 0, .55); }
.clip.is-dragging img { box-shadow: 0 18px 40px rgba(0, 0, 0, .6); }
body.sorting, body.sorting * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.searching .grip { visibility: hidden; }
.menu-row strong { display: flex; align-items: baseline; }
.menu-row strong .pos { flex: none; }
.menu-group .empty { margin: 4px 0 14px; padding: 14px; border: 1px dashed var(--line); border-radius: 10px; }
.menu-group:has(.menu-row) .empty { display: none; }

/* Phone (Ty: "videos too big to keep an overview and drag smartly"): the videos become a compact list like the
   products, one row each: grip, small still, name, Show, Delete. Around seven fit on one screen. */
@media (max-width: 620px) {
  #videoList { display: flex; flex-direction: column; gap: 0; }
  #videoList .clip { grid-template-columns: 32px 44px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
  #videoList .clip__still, #videoList .clip__actions { display: contents; }
  #videoList .clip__still .grip { position: static; order: -1; width: 32px; height: 44px; background: none; color: var(--ash-dim); }
  #videoList .clip img { width: 44px; height: auto; aspect-ratio: 9 / 16; border-radius: 6px; }
  #videoList .clip__show { gap: 8px; }
  #videoList .clip button.danger { min-height: 38px; padding: 4px 12px; }
  #videoList .clip.is-dragging { background: var(--void-3); border-radius: 10px; box-shadow: 0 14px 34px rgba(0, 0, 0, .55); }
  #videoList .clip.is-dragging img { box-shadow: none; }
}

/* The second header row: appears with the first unsaved change, pinned to the top while scrolling.
   Save / Discard on the right, what happened on the left; a confirmation, then it fades out. */
.changes { position: fixed; left: 0; right: 0; top: 0; z-index: 30; background: var(--void-2); border-bottom: 1px solid var(--line); box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  opacity: 0; transform: translateY(-10px); visibility: hidden; pointer-events: none; transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s; }
.changes.is-open { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition: opacity .25s ease, transform .25s ease, visibility 0s; }
.changes__in { display: flex; align-items: center; gap: 16px; max-width: 1080px; margin: 0 auto; padding: 10px 20px; }
.changes__in p { flex: 1; margin: 0; color: var(--ash); }
.changes.is-error .changes__in p { color: var(--red); }
.changes.is-done .changes__in p { color: var(--green); }
.changes.is-done .changes__in p::before { content: "\2713  "; }
.changes__buttons { display: flex; gap: 10px; flex: none; transition: opacity .2s ease; }
.changes.is-done .changes__buttons { opacity: 0; pointer-events: none; }
#saveChanges { background: var(--blue); border-color: var(--blue); color: var(--void); }
@media (hover: hover) { #saveChanges:hover:not(:disabled) { background: var(--sky); border-color: var(--sky); } }
@media (max-width: 620px) {
  .changes__in { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .changes__in p { flex-basis: 100%; font-size: 15px; }
  .changes__buttons { width: 100%; }
  .changes__buttons button { flex: 1; }
  .changes.is-done .changes__buttons { display: none; }
}

/* Account: on a computer the two buttons sit in the header; on a phone they open from one round button. */
.account { display: flex; align-items: center; gap: 12px; }
.account__menu { display: flex; align-items: center; gap: 12px; }
.account__toggle { display: none; }
@media (max-width: 620px) {
  .account { position: relative; }
  .account__toggle { display: grid; place-items: center; width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 999px; color: var(--cream); }
  .account__toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .account__menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 40; flex-direction: column; align-items: stretch; gap: 6px; min-width: 210px; padding: 8px;
    background: var(--void-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
    opacity: 0; transform: translateY(-6px); visibility: hidden; transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s; }
  .account.is-open .account__menu { opacity: 1; transform: none; visibility: visible; transition: opacity .18s ease, transform .18s ease, visibility 0s; }
  .account__menu .logout { min-height: 44px; text-align: left; padding: 8px 14px; font-size: 15px; }
}
