/* monetization.css — paywall, signin, animate, usage strip */

/* ─── Usage strip ──────────────────────────────── */
.usage-strip {
  margin: 0 20px 16px;
  padding: 12px 14px;
  background: #fff;
  border: 1.5px solid var(--sepia-line);
  border-radius: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.usage-strip .us-ic {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: rgba(255,74,0,.1);
  color: var(--brand-orange);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.usage-strip .us-text {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--sepia-ink);
}
.usage-strip .us-sub {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 12px;
  color: var(--muted-1);
  margin-top: 1px;
}
.usage-strip .us-cta {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: var(--brand-orange);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px 8px;
}
.usage-strip.warn { background: #FFF8F0; border-color: rgba(255,74,0,.3); }

/* ─── Watermark overlay on free-tier results ───── */
.watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
  z-index: 3;
}
.watermark::before {
  content: 'OLD IMAGE RESTORER · PREVIEW';
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,.5);
  text-shadow: 0 1px 3px rgba(0,0,0,.45);
  transform: rotate(-18deg);
  white-space: nowrap;
  mix-blend-mode: overlay;
}
.watermark-tile {
  position: absolute;
  bottom: 10px; right: 10px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 6px;
  z-index: 4;
}

/* ─── Paywall modal ─────────────────────────────── */
.paywall-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20,12,6,.72);
  z-index: 150;
  display: flex;
  align-items: flex-end;
  animation: fadeIn 0.2s;
}
.paywall-sheet {
  background: var(--sepia-paper);
  width: 100%;
  border-radius: 28px 28px 0 0;
  padding: 14px 20px 28px;
  max-height: 92%;
  overflow-y: auto;
  animation: slideUp 0.28s cubic-bezier(.2,.9,.3,1) both;
}
.paywall-sheet .sheet-handle { margin: 0 auto 10px; }
.paywall-sheet .pw-header {
  text-align: center;
  padding: 4px 6px 14px;
}
.paywall-sheet .pw-icon {
  width: 64px; height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, #FF933A, #FF4A00);
  display: grid; place-items: center;
  color: #fff;
  margin: 4px auto 12px;
  box-shadow: 0 10px 24px -8px rgba(255,74,0,.45);
}
.paywall-sheet h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  color: var(--sepia-ink);
  line-height: 1.15;
  margin-bottom: 6px;
  text-wrap: pretty;
}
.paywall-sheet .pw-sub {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 15px;
  color: var(--ink-3);
  line-height: 1.45;
  max-width: 320px;
  margin: 0 auto;
}

/* Billing toggle */
.billing-toggle {
  display: flex;
  background: rgba(42,31,21,.08);
  border-radius: 999px;
  padding: 4px;
  margin: 14px auto 18px;
  width: fit-content;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
}
.billing-toggle button {
  background: transparent;
  border: 0;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--muted-1);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.billing-toggle button.active {
  background: #fff;
  color: var(--sepia-ink);
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.billing-toggle .save-pill {
  background: var(--brand-orange);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

/* Plan cards */
.plans { display: flex; flex-direction: column; gap: 10px; }
.plan-card {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  border: 2px solid transparent;
  box-shadow: var(--shadow-card);
  position: relative;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.plan-card:hover { transform: translateY(-1px); }
.plan-card.selected {
  border-color: var(--brand-orange);
  box-shadow: 0 8px 20px -6px rgba(255,74,0,.25);
}
.plan-card.best {
  background: linear-gradient(135deg, #3a2817 0%, #1c130b 100%);
  color: #fff;
  border-color: #FF933A;
}
.plan-card.best h3, .plan-card.best .plan-feature { color: #fff; }

.plan-card .plan-badge {
  position: absolute;
  top: -10px; left: 16px;
  background: var(--brand-orange);
  color: #fff;
  padding: 4px 10px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.plan-card .plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.plan-card h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--sepia-ink);
  margin-bottom: 2px;
}
.plan-card .plan-desc {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 12px;
  color: var(--muted-1);
}
.plan-card.best .plan-desc { color: rgba(255,255,255,.65); }

.plan-card .plan-price {
  text-align: right;
  flex-shrink: 0;
}
.plan-card .plan-price .amt {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--sepia-ink);
  line-height: 1;
}
.plan-card.best .plan-price .amt { color: #fff; }
.plan-card .plan-price .per {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--muted-1);
  margin-top: 2px;
}
.plan-card.best .plan-price .per { color: rgba(255,255,255,.65); }

.plan-card ul {
  list-style: none;
  padding: 0; margin: 6px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.plan-card .plan-feature {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}
.plan-card.best .plan-feature { color: rgba(255,255,255,.85); }
.plan-card .plan-feature svg {
  color: var(--brand-orange);
  flex-shrink: 0;
}
.plan-card.best .plan-feature svg { color: #FF933A; }

.paywall-cta {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.paywall-disclaimer {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--muted-1);
  text-align: center;
  line-height: 1.5;
  margin-top: 6px;
}

/* ─── Sign-in / Sign-up ─────────────────────────── */
.auth-root {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--sepia-paper);
  min-height: 0;
}
.auth-hero {
  padding: 16px 24px 20px;
  text-align: center;
  position: relative;
}
.auth-hero .photos-stack {
  position: relative;
  width: 180px; height: 180px;
  margin: 12px auto 18px;
}
.auth-hero .photos-stack .polaroid {
  position: absolute;
  width: 120px;
  padding: 8px 8px 26px;
}
.auth-hero .photos-stack .poi-img { aspect-ratio: 1; }
.auth-hero .photos-stack .polaroid:nth-child(1) {
  top: 0; left: 0; transform: rotate(-10deg); z-index: 1;
}
.auth-hero .photos-stack .polaroid:nth-child(2) {
  top: 20px; left: 40px; transform: rotate(8deg); z-index: 2;
}
.auth-hero .photos-stack .polaroid:nth-child(3) {
  top: 50px; left: 10px; transform: rotate(-3deg); z-index: 3;
}
.auth-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  color: var(--sepia-ink);
  margin-bottom: 6px;
  line-height: 1.15;
}
.auth-hero p {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 15px;
  color: var(--ink-3);
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.45;
}

.auth-form {
  padding: 12px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-btn {
  width: 100%;
  min-height: 56px;
  border-radius: 12px;
  border: 1.5px solid var(--sepia-line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--sepia-ink);
  cursor: pointer;
}
.auth-btn.apple { background: #000; color: #fff; border-color: #000; }
.auth-btn:hover { background: var(--surface-off); }
.auth-btn.apple:hover { background: #1a1a1a; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--muted-1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sepia-line);
}
.auth-foot {
  text-align: center;
  padding: 4px 24px 30px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted-1);
  line-height: 1.6;
}
.auth-foot b { font-family: var(--font-display); font-weight: 700; color: var(--brand-orange); }
.auth-skip {
  background: none; border: 0; cursor: pointer; text-decoration: underline;
  color: var(--muted-1); font-family: var(--font-body); font-size: 13px;
}

.auth-trust {
  margin: 8px 24px 0;
  padding: 12px 14px;
  background: rgba(75,215,98,.1);
  border: 1px solid rgba(75,215,98,.3);
  border-radius: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.auth-trust .at-ic {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--success);
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.auth-trust .at-text {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.4;
}

/* ─── Magic link confirmation ─────────────────── */
.magic-root {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--sepia-paper);
  min-height: 0;
}
.magic-body {
  flex: 1;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 0;
  overflow-y: auto;
}
.magic-envelope {
  position: relative;
  width: 140px;
  height: 100px;
  margin: 12px 0 24px;
}
.magic-envelope .env-back {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #e8d4b7, #d4b890);
  border-radius: 8px;
  box-shadow: 0 10px 24px -10px rgba(42,31,21,.3);
}
.magic-envelope .env-letter {
  position: absolute;
  top: 10px; left: 14px; right: 14px;
  height: 68px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  transform: translateY(30px);
  opacity: 0;
  animation: letterRise 0.6s ease-out 0.3s forwards;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 10px;
  gap: 5px;
  z-index: 2;
}
.magic-envelope .env-letter::before,
.magic-envelope .env-letter::after {
  content: '';
  height: 3px;
  background: var(--sepia-line);
  border-radius: 2px;
}
.magic-envelope .env-letter::before { width: 70%; }
.magic-envelope .env-letter::after { width: 50%; }
.magic-envelope .env-flap {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: linear-gradient(135deg, #d4b890, #b89865);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top;
  animation: flapOpen 0.6s ease-out 0.8s forwards;
  z-index: 3;
}
@keyframes flapOpen {
  0%   { transform: rotateX(0); }
  100% { transform: rotateX(180deg); }
}
@keyframes letterRise {
  0%   { transform: translateY(30px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.magic-envelope .env-spark {
  position: absolute;
  top: 28px; left: 50%;
  transform: translateX(-50%);
  color: var(--brand-orange);
  opacity: 0;
  animation: heartPop 0.4s ease-out 1.2s forwards;
  z-index: 4;
}
@keyframes heartPop {
  0%   { transform: translate(-50%, 0) scale(0); opacity: 0; }
  60%  { transform: translate(-50%, 0) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

.magic-body h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  color: var(--sepia-ink);
  line-height: 1.2;
  margin-bottom: 8px;
  text-wrap: pretty;
}
.magic-body .magic-email {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--brand-orange);
  margin-bottom: 14px;
}
.magic-body .magic-sub {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 15px;
  color: var(--ink-3);
  max-width: 320px;
  line-height: 1.5;
  margin-bottom: 20px;
}
.magic-tips {
  background: rgba(42,31,21,.04);
  border: 1px solid var(--sepia-line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  text-align: left;
  max-width: 320px;
  margin-bottom: 16px;
}
.magic-tips .mt-ic {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 7px;
  background: rgba(255,74,0,.1);
  color: var(--brand-orange);
  display: grid;
  place-items: center;
}
.magic-tips .mt-text {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.45;
}
.magic-resend {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  background: none;
  border: 0;
  color: var(--brand-orange);
  padding: 10px;
  cursor: pointer;
}
.magic-resend:disabled {
  color: var(--muted-1);
  cursor: default;
}
.magic-simulate {
  margin: 12px 24px 0;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 11px;
  text-align: center;
  color: var(--muted-1);
  background: rgba(255,147,58,.1);
  border: 1px dashed rgba(255,147,58,.4);
  border-radius: 10px;
  line-height: 1.4;
}
.magic-simulate button {
  display: block;
  margin: 8px auto 0;
  background: var(--brand-orange);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  min-height: 36px;
}

.auth-trust-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-3);
  cursor: pointer;
  user-select: none;
}
.auth-trust-check .box {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid var(--sepia-line);
  display: grid; place-items: center;
  flex-shrink: 0;
  background: #fff;
  transition: background 0.12s, border-color 0.12s;
}
.auth-trust-check input:checked ~ .box {
  background: var(--brand-orange);
  border-color: var(--brand-orange);
  color: #fff;
}
.auth-trust-check input { display: none; }
.auth-trust-check .box svg { opacity: 0; }
.auth-trust-check input:checked ~ .box svg { opacity: 1; color: #fff; }

/* ─── Animate (video) flow ─────────────────────── */
.animate-cta {
  margin: 0 20px 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #3a2817 0%, #1c130b 100%);
  color: #fff;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border: 0;
  text-align: left;
  width: calc(100% - 40px);
  box-shadow: var(--sepia-shadow);
}
.animate-cta .ac-ic {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FF933A, #FF4A00);
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.animate-cta .ac-body { flex: 1; }
.animate-cta .ac-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.animate-cta .ac-title .badge {
  font-size: 9px;
  letter-spacing: 0.1em;
  background: rgba(255,147,58,.25);
  color: #FF933A;
  padding: 2px 6px;
  border-radius: 4px;
}
.animate-cta .ac-sub {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 12px;
  color: rgba(255,255,255,.65);
}
.animate-cta .ac-arrow { color: rgba(255,255,255,.5); flex-shrink: 0; }

/* Video result */
.video-root {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #000;
  color: #fff;
  min-height: 0;
}
.video-stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 12px 20px;
  min-height: 0;
  position: relative;
}
.video-frame {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 4/5;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
  position: relative;
  box-shadow: 0 20px 50px -12px rgba(0,0,0,.8);
}
.video-frame img {
  position: absolute;
  width: 110%; height: 110%;
  top: -5%; left: -5%;
  object-fit: cover;
  display: block;
  animation: kenburns 8s ease-in-out infinite alternate;
}
@keyframes kenburns {
  0%   { transform: scale(1.02) translate(0, 0); }
  100% { transform: scale(1.12) translate(-3%, -2%); }
}
.video-frame .vf-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255,147,58,.08) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 70%, rgba(255,255,255,.04) 0%, transparent 50%);
  mix-blend-mode: overlay;
}
.video-frame .vf-parallax {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, transparent 40%, rgba(0,0,0,.35) 100%);
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe {
  0%,100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

.video-scrub {
  padding: 16px 24px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.video-scrub .scrub-bar {
  height: 4px;
  background: rgba(255,255,255,.2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.video-scrub .scrub-bar .fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--brand-orange);
  border-radius: 999px;
  animation: scrub 8s linear infinite;
}
@keyframes scrub {
  0% { width: 0%; }
  100% { width: 100%; }
}
.video-scrub .scrub-times {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  color: rgba(255,255,255,.5);
  font-variant-numeric: tabular-nums;
}

.video-controls {
  padding: 12px 20px 32px;
  display: flex;
  gap: 10px;
}

/* Animate processing */
.animate-processing {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #000;
  color: #fff;
}
.animate-film {
  flex: 1;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  padding: 20px;
}
.filmstrip {
  position: relative;
  width: 100%;
  max-width: 260px;
  aspect-ratio: 4/5;
}
.filmstrip .frame {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 32px -10px rgba(0,0,0,.8);
  opacity: 0;
  animation: filmframe 2.4s ease-in-out infinite;
}
.filmstrip .frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.filmstrip .frame:nth-child(1) { animation-delay: 0s; }
.filmstrip .frame:nth-child(2) { animation-delay: 0.8s; transform: translate(6px, 6px) rotate(2deg); }
.filmstrip .frame:nth-child(3) { animation-delay: 1.6s; transform: translate(-5px, 4px) rotate(-3deg); }
@keyframes filmframe {
  0%, 100% { opacity: 0; }
  15%, 40% { opacity: 1; }
}

.animate-processing .sparkle-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.sparkle {
  position: absolute;
  width: 6px; height: 6px;
  background: #FF933A;
  border-radius: 50%;
  box-shadow: 0 0 12px 2px rgba(255,147,58,.8);
  animation: twinkle 1.8s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 1; transform: scale(1); }
}
