:root {
  --ink: #101820;
  --ink-soft: #2a3642;
  --muted: #5c6b78;
  --paper: #e7edf2;
  --paper-2: #d3dde6;
  --line: rgba(16, 24, 32, 0.12);
  --accent: #e85d04;
  --accent-deep: #c44a00;
  --accent-soft: rgba(232, 93, 4, 0.14);
  --ok: #1f7a4d;
  --err: #b42318;
  --white: #f7fafc;
  --shadow: 0 18px 50px rgba(16, 24, 32, 0.12);
  --radius: 14px;
  --font-display: "Bebas Neue", Impact, sans-serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;
  --wrap: min(1120px, calc(100% - 2.5rem));
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(232, 93, 4, 0.16), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(40, 90, 130, 0.18), transparent 50%),
    linear-gradient(165deg, #f4f7fa 0%, var(--paper) 45%, var(--paper-2) 100%);
  background-attachment: fixed;
  line-height: 1.55;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent-deep);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--ink);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.75rem;
  background: var(--ink);
  color: var(--white);
  padding: 0.6rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0.75rem;
}

.wrap {
  width: var(--wrap);
  margin-inline: auto;
}

.wrap.narrow {
  width: min(640px, calc(100% - 2.5rem));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(244, 247, 250, 0.78);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--accent-deep);
}

.nav-cta {
  padding: 0.45rem 0.9rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
}

.nav-cta:hover {
  background: var(--ink);
  color: var(--white) !important;
}

.hero {
  position: relative;
  min-height: min(92vh, 820px);
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(120deg, rgba(16, 24, 32, 0.88) 0%, rgba(16, 24, 32, 0.55) 42%, rgba(16, 24, 32, 0.25) 100%),
    radial-gradient(circle at 70% 40%, rgba(232, 93, 4, 0.45), transparent 42%),
    linear-gradient(35deg, #1c2b3a, #31485c 40%, #0f1720);
  transform: scale(1.02);
  animation: heroDrift 14s ease-in-out infinite alternate;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      -18deg,
      transparent 0,
      transparent 18px,
      rgba(255, 255, 255, 0.03) 18px,
      rgba(255, 255, 255, 0.03) 19px
    );
  opacity: 0.7;
}

.hero-content {
  padding: clamp(4rem, 12vh, 7rem) 0 clamp(3.5rem, 8vh, 5.5rem);
  color: var(--white);
  max-width: 720px;
  margin-left: max(calc((100% - min(1120px, calc(100% - 2.5rem))) / 2), 1.25rem);
  margin-right: auto;
  animation: riseIn 0.9s ease both;
}

.hero-kicker {
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(247, 250, 252, 0.72);
}

.hero-brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 16vw, 9rem);
  line-height: 0.88;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.hero-lead {
  margin: 1.25rem 0 0;
  max-width: 34rem;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: rgba(247, 250, 252, 0.88);
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  gap: 0.75rem;
}

.section {
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.info-section h2,
.section h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  letter-spacing: 0.03em;
  line-height: 1;
}

.lede {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 40rem;
}

.steps {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 0.9rem;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 1rem 1rem 1rem 3.4rem;
  border-top: 1px solid var(--line);
  font-weight: 600;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--white);
  font-size: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 28px rgba(232, 93, 4, 0.28);
}

.btn-primary:hover {
  background: var(--accent-deep);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}

.btn-secondary:hover {
  background: var(--ink);
  color: var(--white);
}

.auth-section,
.page-form .section,
.page-portal .section {
  min-height: 70vh;
}

.auth-form,
.signup-form {
  display: grid;
  gap: 1.1rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  font-weight: 600;
  font-size: 0.95rem;
}

.req {
  color: var(--accent-deep);
}

.field input,
.field textarea,
.field select,
.filter-bar select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.filter-bar select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.check-label {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-weight: 600;
}

.check-label input {
  width: auto;
  margin-top: 0.25rem;
}

.form-actions {
  margin-top: 0.5rem;
}

.form-error {
  background: rgba(180, 35, 24, 0.08);
  border: 1px solid rgba(180, 35, 24, 0.25);
  color: var(--err);
  padding: 0.85rem 1rem;
  border-radius: 10px;
  margin: 0 0 1rem;
}

.form-error ul {
  margin: 0;
  padding-left: 1.1rem;
}

.form-picker {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.form-choice {
  display: grid;
  gap: 0.45rem;
  padding: 1.4rem 1.35rem 1.25rem;
  text-decoration: none;
  color: inherit;
  border-top: 3px solid var(--ink);
  background: rgba(255, 255, 255, 0.45);
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  animation: riseIn 0.7s ease both;
}

.form-choice:nth-child(2) {
  animation-delay: 0.1s;
}

.form-choice:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--accent);
  transform: translateY(-3px);
  color: inherit;
}

.form-choice-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  letter-spacing: 0.03em;
  line-height: 1;
}

.form-choice-short {
  font-weight: 700;
  color: var(--accent-deep);
}

.form-choice-desc {
  color: var(--muted);
  font-size: 0.98rem;
}

.form-choice-cta {
  margin-top: 0.6rem;
  font-weight: 700;
  color: var(--ink);
}

.back-link {
  margin: 0 0 1rem;
}

.back-link a {
  text-decoration: none;
  font-weight: 600;
  color: var(--muted);
}

.back-link a:hover {
  color: var(--accent-deep);
}

.admin-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

.admin-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.filter-bar label {
  font-weight: 600;
}

.filter-bar select {
  width: auto;
  min-width: 12rem;
}

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.subs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.subs-table th,
.subs-table td {
  text-align: left;
  padding: 0.9rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.subs-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.subs-table .preview {
  color: var(--muted);
  max-width: 18rem;
}

.subs-table .actions {
  white-space: nowrap;
  display: flex;
  gap: 0.75rem;
}

.subs-table .actions a {
  font-weight: 700;
  text-decoration: none;
}

.empty-state {
  padding: 2rem 0;
  color: var(--muted);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.detail-list {
  margin: 0;
  display: grid;
  gap: 0;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.detail-row dt {
  font-weight: 700;
  color: var(--muted);
}

.detail-row dd {
  margin: 0;
  white-space: pre-wrap;
}

.detail-list.compact .detail-row {
  grid-template-columns: 6rem 1fr;
}

.hint {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.hint code {
  font-size: 0.85em;
  background: rgba(16, 24, 32, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2rem;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-inner p {
  margin: 0;
}

.footer-admin a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.footer-admin a:hover {
  color: var(--accent-deep);
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  max-width: min(24rem, calc(100% - 2rem));
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
  animation: toastIn 0.35s ease both;
}

.toast-success {
  background: #143528;
}

.toast-error {
  background: #5c1712;
}

.toast.is-hiding {
  opacity: 0;
  transform: translateY(8px);
  transition: 0.35s ease;
}

.print-brand {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.04em;
  margin: 0 0 0.5rem;
}

@keyframes heroDrift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.06) translate3d(-1.5%, 1%, 0); }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  :root {
    --wrap: calc(100% - 1.5rem);
  }

  .hero-content {
    margin-left: 0.75rem;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .nav-cta {
    padding-inline: 0.7rem;
  }

  .subs-table .actions {
    flex-direction: column;
    gap: 0.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* --- Casting document form (PDF-inspired layout) --- */
.page-casting {
  --cast-blue: #1a4f8b;
  --cast-blue-soft: #e8f0f8;
  --cast-line: #9aa8b5;
  --cast-warn: #c62828;
}

.casting-wrap {
  width: min(860px, calc(100% - 1.5rem));
}

.casting-doc {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid rgba(16, 24, 32, 0.1);
  box-shadow: 0 16px 40px rgba(16, 24, 32, 0.08);
  padding: clamp(1.25rem, 3vw, 2.25rem);
  margin-top: 0.5rem;
}

.casting-doc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 2px solid var(--cast-blue);
  margin-bottom: 0.85rem;
}

.casting-doc-titles h1 {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cast-blue);
  line-height: 1.15;
}

.casting-doc-sub {
  margin: 0.45rem 0 0;
  font-style: italic;
  color: #667788;
  font-size: 0.92rem;
}

.casting-logo {
  flex: 0 0 auto;
  background: #111;
  color: #fff;
  padding: 0.45rem 0.7rem 0.55rem;
  min-width: 7.5rem;
  text-align: center;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
  box-shadow: inset 0 0 0 1px #333;
}

.casting-logo-mark {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  line-height: 1;
}

.casting-logo-sub {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  margin-top: 0.2rem;
  opacity: 0.85;
}

.casting-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: #cfd8e0;
  border: 1px solid #cfd8e0;
  margin-bottom: 1.5rem;
}

.casting-meta-cell {
  display: grid;
  grid-template-columns: minmax(7.5rem, 38%) 1fr;
  background: #fff;
  min-height: 2.6rem;
}

.meta-label {
  background: #eef2f5;
  padding: 0.55rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #445566;
  display: flex;
  align-items: center;
}

.meta-value {
  padding: 0.55rem 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  white-space: pre-line;
}

.doc-section {
  margin: 0 0 1.75rem;
  padding-top: 0.25rem;
}

.doc-section h2 {
  margin: 0 0 0.9rem;
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--cast-blue);
  letter-spacing: 0.01em;
}

.doc-subhead {
  margin: 1.25rem 0 0.75rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--cast-blue);
}

.doc-row {
  display: grid;
  grid-template-columns: minmax(9rem, 34%) 1fr;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 0.65rem;
}

.doc-row label,
.doc-block label,
.doc-label {
  font-weight: 700;
  font-size: 0.92rem;
  color: #233;
  margin: 0;
}

.doc-block {
  margin: 0.85rem 0;
  display: grid;
  gap: 0.45rem;
}

.line-input {
  width: 100%;
  border: none;
  border-bottom: 1.5px solid var(--cast-line);
  border-radius: 0;
  background: transparent;
  padding: 0.35rem 0.15rem;
  font: inherit;
  color: inherit;
}

.line-input:focus {
  outline: none;
  border-bottom-color: var(--cast-blue);
  box-shadow: none;
}

.line-area {
  width: 100%;
  border: none;
  border-bottom: 1.5px solid var(--cast-line);
  background:
    repeating-linear-gradient(
      transparent,
      transparent calc(1.55em - 1px),
      var(--cast-line) calc(1.55em - 1px),
      var(--cast-line) 1.55em
    );
  background-attachment: local;
  border-radius: 0;
  padding: 0.15rem 0.15rem 0.4rem;
  font: inherit;
  line-height: 1.55;
  resize: vertical;
  min-height: 4.5rem;
}

.line-area:focus {
  outline: none;
  border-bottom-color: var(--cast-blue);
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  cursor: pointer;
}

.choice input {
  width: auto;
  accent-color: var(--cast-blue);
}

.choice-note {
  margin: 0.35rem 0 0;
  color: #667788;
  font-size: 0.88rem;
}

.legal-box {
  background: var(--cast-blue-soft);
  border: 1px solid #c5d6e8;
  padding: 0.9rem 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0.5rem 0 0.85rem;
}

.legal-box p {
  margin: 0 0 0.75rem;
}

.legal-box p:last-child {
  margin-bottom: 0;
}

.warn-box {
  border: 1.5px solid var(--cast-warn);
  background: #fff8f8;
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0.75rem 0;
}

.check-list {
  display: grid;
  gap: 0.65rem;
  margin: 0.5rem 0 1rem;
}

.check-list .check-label {
  align-items: flex-start;
  font-weight: 500;
}

.check-list .check-label input {
  accent-color: var(--cast-blue);
}

.casting-doc-footer {
  margin: 1.5rem 0 0;
  text-align: center;
  color: #99a3ad;
  font-size: 0.82rem;
}

.casting-actions {
  margin: 1.25rem 0 0.5rem;
  display: flex;
  justify-content: flex-end;
}

.admin-section-title {
  margin: 1.75rem 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1a4f8b;
}

.page-admin .detail-row {
  display: grid;
  grid-template-columns: minmax(8rem, 13rem) 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.page-admin .detail-row dt {
  font-weight: 700;
  color: var(--muted);
}

.page-admin .detail-row dd {
  margin: 0;
  white-space: pre-wrap;
}

.doc-block-title {
  margin: 1.25rem 0 0.75rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--cast-blue, #1a4f8b);
}

.contract-para {
  margin: 0 0 0.85rem;
  font-size: 0.94rem;
  line-height: 1.55;
  color: #222;
}

.contract-meta-stack {
  grid-template-columns: 1fr;
}

.casting-meta-cell.full {
  grid-column: 1 / -1;
}

.pay-options {
  display: grid;
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
  padding: 0.9rem 1rem;
  background: #f4f7fa;
  border: 1px solid #d5dee6;
}

.pay-options .check-label {
  align-items: flex-start;
}

.inline-amount {
  display: inline-block;
  width: 5.5rem;
  margin: 0 0.25rem;
  border: none;
  border-bottom: 1.5px solid var(--cast-line, #9aa8b5);
  background: transparent;
  font: inherit;
  text-align: center;
  padding: 0.1rem 0.2rem;
}

.inline-amount:focus {
  outline: none;
  border-bottom-color: var(--cast-blue, #1a4f8b);
}

.wrap-choices {
  gap: 0.65rem 1rem;
}

.annex-section {
  border-top: 2px solid var(--cast-blue, #1a4f8b);
  padding-top: 1.25rem;
  margin-top: 1.5rem;
}

.page-contract .choice-row.check-label,
.page-contract .doc-block .choice-row {
  flex-direction: column;
  align-items: stretch;
}

.page-contract .doc-block .choice-row.wrap-choices {
  flex-direction: row;
}

/* Admin settings */
.settings-wrap {
  width: min(720px, calc(100% - 1.5rem));
}

.settings-form {
  display: grid;
  gap: 1.5rem;
}

.settings-block {
  margin: 0;
  padding: 1.25rem 1.15rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}

.settings-block legend {
  padding: 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.settings-sub {
  margin: 1.1rem 0 0.65rem;
  font-size: 1rem;
  color: var(--ink-soft);
}

.field-hint {
  margin: 0.15rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.settings-form .field + .field {
  margin-top: 0.15rem;
}

.settings-form .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (max-width: 720px) {
  .casting-meta,
  .doc-row,
  .casting-meta-cell {
    grid-template-columns: 1fr;
  }

  .casting-doc-head {
    flex-direction: column;
  }

  .casting-logo {
    align-self: flex-end;
  }

  .meta-label {
    padding-bottom: 0.2rem;
  }
}
