/* Movie Cron - Customer website styles */
:root {
  --bg: #ffffff;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --text: #0f172a;
  --text-muted: #64748b;
  --border: rgba(15, 23, 42, 0.12);
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #15803d;
  --success-soft: #ecfdf5;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --error: #b91c1c;
  --error-soft: #fef2f2;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Full-page background image (film strip) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("assets/bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.55;
  z-index: -1;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(6px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  max-width: 1120px;
  margin: 0 auto;
}

.brand { display: flex; flex-direction: column; }

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand-sub {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.header-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
}

.header-link:hover { color: var(--accent); background: rgba(15, 23, 42, 0.04); }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
main { padding: 0; }

/* ---------- Hero (desktop two-column) ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ---------- Typography ---------- */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
}

.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 1rem;
}

.hero-lead {
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 62ch;
  margin: 0 0 1rem;
}

/* ---------- Premium benefits ---------- */
.benefits {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.benefits h2 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.benefits-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.7rem;
}
.benefit {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.7);
  padding: 0.65rem 0.8rem;
}
.benefit h3 {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.benefit p {
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ---------- Release info ---------- */
.release-field {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.release-field:last-child { border-bottom: none; }
.release-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.release-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.release-value.accent { color: var(--accent); }

/* ---------- Forms ---------- */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.field input {
  width: 100%;
  padding: 0.65rem 0.8rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}
.field input::placeholder { color: #94a3b8; }
.field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ---------- Price banner ---------- */
.price-banner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.price-banner .label { font-size: 0.9rem; color: var(--text-muted); }
.price-banner .value { font-size: 1.4rem; font-weight: 700; color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.25;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover:not(:disabled) {
  background: #e2e8f0;
  border-color: #94a3b8;
  text-decoration: none;
}

.btn:active:not(:disabled) {
  background: #cbd5e1;
  border-color: #64748b;
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
}

/* Disabled / processing: deliberately dark so text and icons stay readable. */
.btn:disabled {
  opacity: 1;
  background: #334155;
  border-color: #334155;
  color: #f8fafc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn:disabled .btn-icon { opacity: 0.95; filter: brightness(0) invert(1); }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:active:not(:disabled) { background: #1e3a8a; border-color: #1e3a8a; }

.btn-secondary { background: #f8fafc; border-color: #cbd5e1; color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: #e2e8f0; border-color: #94a3b8; }
.btn-secondary:active:not(:disabled) { background: #cbd5e1; border-color: #64748b; }

.btn-outline { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn-outline:hover:not(:disabled) { background: rgba(37, 99, 235, 0.1); border-color: var(--accent-hover); }
.btn-outline:active:not(:disabled) { background: rgba(37, 99, 235, 0.18); }

.btn-success { background: var(--success); border-color: var(--success); color: #ffffff; }
.btn-success:hover:not(:disabled) { background: #166534; border-color: #166534; }
.btn-success:active:not(:disabled) { background: #14532d; border-color: #14532d; }

.btn-block { width: 100%; }
.btn-large,
.btn-lg { padding: 0.85rem 1.5rem; font-size: 1.05rem; min-height: 50px; }

/* Spinners inside buttons inherit the button text colour. */
.btn .spinner {
  border-color: currentColor;
  border-right-color: transparent;
}

.btn-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
}

/* ---------- Spinner ---------- */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Alerts ---------- */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-size: 0.9rem; margin-top: 0.85rem; }
.alert-error { background: var(--error-soft); color: var(--error); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }

/* ---------- Free notice ---------- */
.free-notice {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border);
}

/* ---------- Already paid link ---------- */
.already-paid {
  font-size: 0.9rem;
  color: var(--accent);
  margin-top: 0.75rem;
}
.already-paid-text {
  text-decoration: underline;
  cursor: pointer;
}
.already-paid-text:hover { color: var(--accent-hover); }

/* ---------- Status ---------- */
.status-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-pending { background: var(--warning-soft); color: var(--warning); }
.badge-processing { background: #dbeafe; color: #1e40af; }
.badge-paid { background: var(--success-soft); color: var(--success); }
.badge-failed { background: var(--error-soft); color: var(--error); }
.badge-cancelled { background: #f3f4f6; color: #374151; }
.badge-expired { background: var(--error-soft); color: var(--error); }

.status-reference {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.status-reference:last-of-type { border-bottom: none; }
.status-label { color: var(--text-muted); }
.status-reference .mono { font-family: var(--mono); font-size: 0.82rem; word-break: break-all; text-align: right; }

.download-card {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 1rem;
}
.download-note { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 1rem; }

/* ---------- Token box ---------- */
.token-box {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin: 0.85rem 0;
}
.token-value {
  flex: 1 1 220px;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  word-break: break-all;
  user-select: all;
}
.token-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}
.token-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* Token warning: must remain impossible to miss, including on narrow phones. */
.token-warning {
  margin: 0.85rem 0 0.35rem;
  padding: 0.9rem 1rem;
  border: 2px solid #fca5a5;
  border-left-width: 6px;
  border-radius: var(--radius-sm);
  background: #7f1d1d;
  color: #ffffff;
  font-size: clamp(0.95rem, 4.2vw, 1.05rem);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-wrap: balance;
}
.token-autocopy {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #15803d;
}

/* ---------- Payment status and messages ---------- */
.error {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  background: var(--error-soft);
  color: var(--error);
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.payment-status {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}
.payment-status[data-state="pending"] { border-color: #fcd34d; background: var(--warning-soft); }
.payment-status[data-state="processing"] { border-color: #93c5fd; background: #eff6ff; }
.payment-status[data-state="paid"] { border-color: #86efac; background: var(--success-soft); }
.payment-status[data-state="failed"],
.payment-status[data-state="cancelled"],
.payment-status[data-state="expired"] { border-color: #fca5a5; background: var(--error-soft); }

.payment-status-head { display: flex; align-items: flex-start; gap: 0.75rem; }
.payment-status-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.06);
}
.payment-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.payment-dot { width: 10px; height: 10px; border-radius: 50%; background: #64748b; }
.payment-status[data-state="processing"] .payment-spinner { display: block; }
.payment-status[data-state="processing"] .payment-dot { display: none; }
.payment-status[data-state="pending"] .payment-dot { background: var(--warning); }
.payment-status[data-state="paid"] .payment-dot { background: var(--success); }
.payment-status[data-state="failed"] .payment-dot,
.payment-status[data-state="cancelled"] .payment-dot,
.payment-status[data-state="expired"] .payment-dot { background: var(--error); }
/* In the paid state the badge/title are hidden by the app; hide the icon too. */
.payment-status[data-state="paid"] .payment-status-head { display: none; }

.payment-status-copy { min-width: 0; }
.payment-status-title {
  margin: 0.35rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: anywhere;
}
.payment-hint {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.payment-alert {
  margin: 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  background: var(--error-soft);
  color: var(--error);
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.payment-alert-warning {
  border-color: #fcd34d;
  background: var(--warning-soft);
  color: #92400e;
}
.token-panel {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}
.payment-confirmed-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #86efac;
  border-radius: var(--radius);
  background: var(--success-soft);
}
.payment-confirmed-container .status-line { margin-bottom: 0; }
#pmConfirmedMessage {
  margin: 0;
  color: #166534;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ---------- Actions ---------- */
.actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
@media (min-width: 480px) {
  .actions { flex-direction: row; }
  .actions .btn { width: auto; flex: 1; }
}

/* ---------- Recovery ---------- */
.recovery-body .card-sub { font-size: 0.92rem; color: var(--text-muted); margin-bottom: 1rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.5rem 0;
  margin-top: 2rem;
}
.footer-inner {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- Steps (How it works) ---------- */
.steps {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.steps li {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  align-items: flex-start;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}
.step-text {
  color: var(--text);
}
.step-text p {
  margin: 0.25rem 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.info-note {
  font-size: 0.875rem;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-top: 1rem;
}

/* ---------- Modal dialog ---------- */
dialog.modal {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  border: 0;
  padding: 0;
  border-radius: var(--radius);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
  z-index: 100;
}
dialog.modal::backdrop {
  background: rgba(15, 23, 42, 0.55);
}
dialog.modal[hidden] { display: none; }

.modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Sticky header keeps the close control reachable while content scrolls. */
.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 0;
  margin: -1.5rem -1.5rem 1rem;
  padding: 0.25rem 1.5rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  color: var(--text);
}

.modal-close {
  flex: 0 0 auto;
  align-self: center;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.modal-close img {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
}
.modal-close:hover { background: rgba(15, 23, 42, 0.08); }
.modal-close:active { background: rgba(15, 23, 42, 0.16); transform: scale(0.94); }
.modal-close:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }

.modal-intro {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.btn-small {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

/* ---------- Utility ---------- */
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }
.text-muted { color: var(--text-muted); }

.loading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.loading-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #cbd5e1;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .wrap { padding: 1rem 1rem 2rem; }
  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .header-inner { padding: 0.6rem 1rem; }
  .hero-left, .hero-right {
    padding: 0;
  }
  .btn { min-height: 44px; }
  .actions { flex-direction: column; }
  .actions .btn { width: 100%; }
  dialog.modal {
    width: calc(100vw - 16px);
    max-width: none;
    max-height: calc(100dvh - 16px);
    padding: 0;
    margin: 0;
  }
  .modal-content {
    padding: 1rem;
    max-height: calc(100dvh - 16px);
  }
  .modal-header {
    min-height: 0;
    margin: -1rem -1rem 1rem;
    padding: 0.25rem 1rem;
  }
  .modal-header h2 { font-size: 1.1rem; }
  .payment-status { padding: 0.85rem; }
  .payment-status-title { font-size: 0.95rem; }
  .token-box { flex-direction: column; align-items: stretch; }
  .token-value { flex: 1 1 auto; }
  #pmCopyTokenBtn { width: 100%; }
}

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