/*
  style.css: shared by every page.
  Design: matches the Director's Cut app, which follows Apple's Human
  Interface Guidelines (HIG): the system font (SF Pro), warm neutral
  surfaces, frosted-glass bars, segmented controls, 44pt touch targets,
  and automatic dark mode. The colour values are copied from the app.

  Reminder: selector { property: value; }
*/

/* ---------- Screenplay font (the same files the Director's Cut app uses) ---------- */
@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/courier-prime-latin-400-normal.woff2) format("woff2");
}

@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/courier-prime-latin-700-normal.woff2) format("woff2");
}

/* ---------- Design tokens (light mode) ---------- */
:root {
  color-scheme: light dark;

  --bg: #F2F0EC;        /* page background */
  --surface: #FBFAF7;   /* cards and fields */
  --surface2: #E9E5DF;
  --ink: #1E1B1A;       /* main text */
  --ink2: #5A5350;      /* secondary text */
  --ink3: #6A625E;
  --line: #DDD8D1;      /* hairlines and borders */
  --brand: #D6272E;     /* BR red, as in the app */
  --brand-ink: #FFFFFF;
  --tung: #D6272E;      /* red used for text/accents */
  --tung-soft: #FBE6E6;
  --brand-strong: #A81E24;
  --good: #2C5F8F;
  --good-soft: #DCE7F2;
  --warn: #8A5A00;
  --warn-soft: #FFF1D6;

  --btn2: rgba(30, 27, 26, 0.07);       /* segmented-control track */
  --btn2-hover: rgba(30, 27, 26, 0.12);
  --seg-on: #FBFAF7;
  --seg-sh: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  --glass-bar: rgba(251, 250, 247, 0.65);
  --glass-sep: rgba(30, 27, 26, 0.14);
  --focus: rgba(214, 39, 46, 0.25);

  --display: -apple-system, "SF Pro Display", system-ui, "Segoe UI", sans-serif;
  --body: -apple-system, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  --script: "Courier Prime", "Courier New", Courier, monospace;

  --r: 6px;        /* buttons and fields */
  --r-card: 10px;  /* cards */

  /* Older names still used in dashboard.css */
  --red: var(--brand);
  --red-dark: var(--brand-strong);
  --paper: var(--surface);
  --border: var(--line);
  --muted: var(--ink2);
  --success: var(--good);
  --font-heading: var(--display);
  --font-body: var(--body);
}

/* ---------- Dark mode: follows the device setting, like the app ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141211;
    --surface: #1B1918;
    --surface2: #262322;
    --ink: #F2EDEB;
    --ink2: #B5ACA9;
    --ink3: #958C89;
    --line: #322D2B;
    --tung: #F2575D;
    --tung-soft: #3D1B1C;
    --brand-strong: #FF8589;
    --good: #7FAEDB;
    --good-soft: #1B2A3A;
    --warn: #F0B640;
    --warn-soft: #3A2E14;
    --btn2: rgba(255, 255, 255, 0.09);
    --btn2-hover: rgba(255, 255, 255, 0.14);
    --seg-on: #3B3634;
    --seg-sh: 0 1px 3px rgba(0, 0, 0, 0.4);
    --glass-bar: rgba(40, 36, 35, 0.67);
    --glass-sep: rgba(255, 255, 255, 0.16);
    --focus: rgba(242, 87, 93, 0.35);
  }
}

/* ---------- Basics ---------- */
* {
  box-sizing: border-box;
}

/* Make the HTML "hidden" attribute always win, even over display: flex/grid rules */
[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;           /* Apple's standard body size */
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  /* Keep the footer at the bottom even on short pages */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding-bottom: 64px;
}

/* Headings: Apple's system font, sentence case, tightly set */
h1,
h2 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.1;
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(28px, 4.5vw, 38px);
}

h2 {
  font-size: 24px;
}

/* Script titles look like a screenplay title page: Courier Prime capitals */
.script-title {
  font-family: var(--script);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

a {
  color: var(--tung);
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.container.narrow {
  max-width: 720px;
}

.lead {
  color: var(--ink2);
  margin: 0 0 24px;
}

.muted {
  color: var(--ink2);
}

/* ---------- Frosted-glass header bar ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 10px 0;
  background: var(--glass-bar);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 0.5px solid var(--glass-sep);
}

/* The logo sits on a rounded tile, like an app icon, so it works on light and dark */
.logo {
  display: block;
  height: 44px;
  width: auto;
  border-radius: 6px;
}

/* ---------- Step indicator ---------- */
.progress {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 32px 0 28px;
  font-size: 13px;
  font-weight: 600;
}

.progress li {
  flex: 1;
  padding-top: 8px;
  border-top: 3px solid var(--line);
  color: var(--ink2);
}

.progress li.active,
.progress li.done {
  border-color: var(--brand);
  color: var(--ink);
}

/* ---------- Cards ---------- */
.release-text,
.success {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}

.release-text {
  padding: 22px 24px;
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.55;
}

.release-text > :first-child {
  margin-top: 0;
}

.release-text ol {
  padding-left: 1.3em;
  margin: 0;
}

.release-text li {
  margin-bottom: 10px;
}

.release-text li::marker {
  color: var(--ink2);
  font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;              /* Apple's minimum touch target */
  padding: 0 20px;
  background: var(--brand);
  color: var(--brand-ink);
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s;
}

.btn:hover {
  filter: brightness(0.92);
}

.btn:active {
  filter: brightness(0.85);
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-full {
  width: 100%;
  margin-top: 8px;
}

.send-error {
  text-align: center;
  margin-top: 12px;
}

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- Form fields ---------- */
.field {
  margin-bottom: 20px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label,
.label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.optional {
  font-weight: 400;
  color: var(--ink2);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font: inherit;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--ink3);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus);
}

input[type="file"] {
  width: 100%;
  padding: 12px;
  background: var(--surface);
  border: 1px dashed var(--ink3);
  border-radius: var(--r);
  font: inherit;
  font-size: 15px;
  color: var(--ink2);
}

input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: var(--r);
  padding: 8px 14px;
  margin-right: 12px;
  background: var(--btn2);
  color: var(--ink);
  cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--brand);
}

/* ---------- Segmented control (Film / Series) ----------
   Apple's sliding switch: a tinted track with the chosen option raised.
   The real radio buttons are still there (for keyboards and screen readers),
   just visually hidden. */
.choice-group {
  display: flex;
  gap: 1px;
  padding: 3px;
  border-radius: 7px;
  background: var(--btn2);
}

.choice {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin: 0;
  border-radius: 5px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink2);
  cursor: pointer;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice:has(input:checked) {
  background: var(--seg-on);
  color: var(--tung);
  font-weight: 600;
  box-shadow: var(--seg-sh);
}

.choice:has(input:focus-visible) {
  outline: 3px solid var(--focus);
}

/* ---------- Checkbox row ---------- */
.checkbox {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 4px;
}

.checkbox input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}

.checkbox label {
  font-weight: 400;
  font-size: 17px;
}

/* ---------- Messages ---------- */
.hint {
  font-size: 13px;
  color: var(--ink2);
  margin: 6px 0 0;
}

.hint.over {
  color: var(--tung);
  font-weight: 600;
}

.error {
  color: var(--tung);
  font-size: 13px;
  font-weight: 500;
  margin: 6px 0 0;
}

.error:empty {
  display: none;
}

.invalid,
.choice-group.invalid {
  border-color: var(--tung) !important;
  box-shadow: 0 0 0 1px var(--tung);
}

/* ---------- Thank-you card ---------- */
.success {
  text-align: center;
  padding: 44px 24px;
}

.success p {
  color: var(--ink2);
  margin: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 0.5px solid var(--glass-sep);
  padding: 20px 16px;
  text-align: center;
  color: var(--ink2);
  font-size: 13px;
}

.site-footer p {
  margin: 4px 0;
}

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  .row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .logo {
    height: 38px;
  }
  .progress {
    margin-top: 24px;
  }
}

/* =====================================================================
   Cards and the file drop zone (public pages; the dashboard uses the
   same .card look)
   ===================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
}

.card-title {
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink2);
  margin: 0 0 14px;
}

#submission-form .card {
  margin-bottom: 16px;
}

#submission-form .card .field:last-child {
  margin-bottom: 0;
}

/* Compact signature: tick box, then name + button on one row */
.sign-card .checkbox {
  margin-bottom: 0;
}

.sign-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.sign-name {
  flex: 1;
  min-width: 0;
}

.sign-row .btn {
  flex-shrink: 0;
}

@media (max-width: 560px) {
  .sign-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* The drop zone: a dashed box with a button and the file's name */
.file-zone {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  font-weight: 400;
  margin: 0;
}

.file-zone:hover,
.file-zone.dragging {
  border-color: var(--brand);
  background: var(--tung-soft);
}

/* Hide the browser's own file button, but keep it usable */
.file-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-button {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--btn2);
  font-size: 15px;
  font-weight: 600;
}

.file-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  color: var(--ink2);
}

.file-zone.has-file {
  border-style: solid;
}

.file-zone.has-file .file-name {
  color: var(--ink);
}

.file-zone:has(input:focus-visible) {
  outline: 3px solid var(--focus);
}

.file-zone:has(input.invalid) {
  border-color: var(--tung);
}

/* Thank-you card */
.success.card {
  padding: 44px 24px;
}

.success h2 {
  margin-bottom: 12px;
}

.success .script-title {
  font-size: 20px;
  color: var(--ink);
  margin: 0 0 12px;
}

.file-zone {
  position: relative; /* keeps the hidden file input inside the zone */
}


/* =====================================================================
   Form controls that look the same everywhere (Safari included)
   ===================================================================== */

/* Dropdowns: drop the browser's own look so they match the text fields */
select {
  -webkit-appearance: none;
  appearance: none;
  height: 44px;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8380' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  cursor: pointer;
}

/* Film / Series: two clear outlined buttons, the chosen one in red */
.choice-group {
  gap: 10px;
  padding: 0;
  background: none;
}

.choice {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
}

.choice:hover {
  border-color: var(--ink3);
}

.choice:has(input:checked) {
  border-color: var(--brand);
  background: var(--tung-soft);
  color: var(--tung);
  font-weight: 600;
  box-shadow: none;
}

.choice-group.invalid {
  box-shadow: none;
}

.choice-group.invalid .choice {
  border-color: var(--tung);
}

/* Every single-line field the same height as the dropdown and buttons */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"] {
  height: 44px;
}

/* =====================================================================
   Public pages: compact top row and a release box that fills the screen
   ===================================================================== */
.page-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 0 18px;
}

.page-head .logo {
  height: 48px;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
}

/* The release scrolls inside its box, sized so the box AND the agree
   section below it fit on one screen */
.release-text {
  height: calc(100vh - 380px);
  min-height: 260px;
  overflow-y: auto;
}

@media (max-width: 560px) {
  .page-head .logo {
    height: 40px;
  }
  .release-text {
    height: calc(100vh - 460px);
  }
}

/* The BR Studios logo in the top-left corner of the screen */
.corner-logo {
  position: absolute;
  top: 22px;
  left: 28px;
}

.corner-logo .logo {
  height: 52px;
}

.page-head {
  padding-top: 32px;
}

/* On narrower screens the corner would overlap the content, so the logo
   sits above the title instead */
@media (max-width: 960px) {
  .corner-logo {
    position: static;
    display: block;
    padding: 20px 16px 0;
  }
  .corner-logo .logo {
    height: 44px;
  }
  .page-head {
    padding-top: 16px;
  }
}
