/* Landing page, pricing, upgrade dialog and plan badges. */

/* ---- plan badge in the top bar ---- */
.topbar-right { display: flex; align-items: center; gap: .75rem; }
.plan-pill {
  display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .35rem .3rem .75rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: .82rem; color: var(--muted); font-weight: 550; white-space: nowrap;
}
.plan-pill strong { padding: .2rem .6rem; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 650; }
.plan-pill:hover { text-decoration: none; border-color: #cfcbfa; }
.plan-pill:hover strong { background: var(--brand-strong); }
.plan-pill.out { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.plan-pill.pro { padding: .3rem .75rem; gap: .35rem; color: var(--brand); background: var(--brand-soft); border-color: #dcd9fb; font-weight: 700; }
.plan-pill .icon { width: .95rem; height: .95rem; }
@media (max-width: 520px) { .plan-pill:not(.out):not(.pro) > span { display: none; } .plan-pill { padding-left: .35rem; } }

/* ---- small shared bits ---- */
.pill-save {
  display: inline-block; padding: .05rem .45rem; border-radius: 999px; font-size: .72rem; font-weight: 750;
  background: var(--ok-soft); color: var(--ok); vertical-align: .08em;
}
.pro-tag {
  display: inline-flex; align-items: center; gap: .2rem; margin-left: .45rem; padding: .05rem .45rem;
  border-radius: 999px; font-size: .7rem; font-weight: 750; background: var(--ink); color: #fff; vertical-align: .1em;
}
.pro-tag .icon { width: .7rem; height: .7rem; }
.checklist { list-style: none; padding: 0; display: grid; gap: .45rem; }
.checklist li { display: flex; gap: .5rem; align-items: flex-start; }
.checklist .icon { width: 1.05rem; height: 1.05rem; margin-top: .15rem; color: var(--ok); }
.checklist li.muted .icon { color: var(--muted); }
.center { text-align: center; }

/* locked options in the difficulty picker */
.difficulty.locked { border-style: dashed; }
.difficulty.locked .difficulty-k, .difficulty.locked .difficulty-desc { opacity: .75; }
.custom-k.locked { color: var(--muted); }

/* upload dialog: pages left */
.quota-line {
  display: flex; gap: .5rem; align-items: flex-start; padding: .55rem .75rem; border-radius: var(--r-sm);
  background: var(--brand-soft); color: var(--ink); font-size: .88rem;
}
.quota-line .icon { width: 1.05rem; height: 1.05rem; color: var(--brand); margin-top: .1rem; }
.quota-line.over { background: var(--warn-soft); }
.quota-line.over .icon { color: var(--warn); }

/* finished dialog: Pro nudge */
.finished-nudge { display: flex; gap: .6rem; padding: .75rem .9rem; border-radius: var(--r); background: var(--surface-2); text-align: left; }
.finished-nudge > .icon { color: var(--sun); fill: var(--sun); margin-top: .1rem; }

/* account: plan */
.plan-section.is-pro { background: linear-gradient(135deg, var(--brand-soft), #fff 60%); }
.plan-section h2 { display: flex; align-items: center; gap: .4rem; }
.plan-section h2 .icon { color: var(--brand); }
.plan-section .muted .icon { width: 1rem; height: 1rem; vertical-align: -.15em; }
.meter.full > span { background: var(--warn); }

/* ---- upgrade dialog ---- */
.upgrade-dialog .plan-options { display: grid; gap: .5rem; }
.plan-option {
  position: relative; display: flex; align-items: center; gap: .75rem; padding: .75rem .9rem; cursor: pointer;
  border: 1.5px solid var(--line-strong); border-radius: var(--r); transition: border-color .12s, background .12s;
}
.plan-option:hover { border-color: var(--brand); }
.plan-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.plan-option input { accent-color: var(--brand); width: 1.05rem; height: 1.05rem; flex: none; }
.plan-option-main { display: grid; gap: .1rem; flex: 1; justify-items: start; }
.plan-option-main strong { display: inline-flex; align-items: center; gap: .35rem; }
.plan-option-main .icon { width: 1rem; height: 1rem; color: var(--coral); }
.plan-option-price { text-align: right; white-space: nowrap; }
.plan-option-price strong { font-size: 1.1rem; }
.upgrade-dialog .waiver { display: flex; gap: .55rem; align-items: flex-start; margin: .8rem 0 0; font-size: .88rem; line-height: 1.4; padding: .6rem .7rem; border-radius: var(--r); border: 1px solid transparent; }
.upgrade-dialog .waiver[hidden] { display: none; }
.upgrade-dialog .waiver input { margin-top: .2rem; flex: none; width: 1.05rem; height: 1.05rem; }
.upgrade-dialog .waiver.needs { border-color: var(--warn); background: var(--warn-soft); }
.upgrade-dialog .refund-note { margin: .7rem 0 0; }
.upgrade-done { display: flex; gap: .7rem; padding: 1rem; border-radius: var(--r); background: var(--ok-soft); }
.upgrade-done > .icon { color: var(--coral); margin-top: .15rem; }

/* ---- public pages: header ---- */
.topbar.public { background: rgb(247 246 243 / 85%); }
.public-nav { display: flex; align-items: center; gap: 1.1rem; font-weight: 600; font-size: .95rem; }
.public-nav > a:not(.btn) { color: var(--ink); }

/* ---- landing ---- */
.landing { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1.25rem 2rem; }
.landing > section { padding: 4.5rem 0 0; }
.landing h2 { font-size: 1.9rem; text-align: center; margin-bottom: 1.6rem; }
.landing .center { max-width: 34rem; margin: -.9rem auto 1.6rem; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 3rem; align-items: center; padding-top: 3.5rem !important; }
.eyebrow { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--brand); font-size: .9rem; margin-bottom: .9rem; }
.eyebrow .icon { width: 1.1rem; height: 1.1rem; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); line-height: 1.08; letter-spacing: -.03em; }
.lead { font-size: 1.15rem; color: var(--muted); margin-top: 1.1rem; max-width: 34rem; }
.hero-cta { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.7rem; }
.ghost-btn { background: transparent; }
.reassure { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: 1rem; }
.reassure .icon { width: .95rem; height: .95rem; color: var(--ok); }

/* before/after slider */
.compare {
  position: relative; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg);
  aspect-ratio: 3 / 2; background: #fff; user-select: none; transform: rotate(1deg);
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-top { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-top::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 8px rgb(0 0 0 / 30%); }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare-handle {
  position: absolute; top: 50%; left: var(--pos); transform: translate(-50%, -50%); pointer-events: none;
  display: flex; align-items: center; padding: .45rem; border-radius: 999px; background: #fff; color: var(--brand); box-shadow: var(--shadow);
}
.compare-handle .icon { width: 1rem; height: 1rem; }
.compare figcaption {
  position: absolute; left: .8rem; right: .8rem; bottom: .8rem; display: flex; justify-content: space-between; pointer-events: none;
}
.compare figcaption span { padding: .2rem .6rem; border-radius: 999px; background: rgb(29 27 44 / 70%); color: #fff; font-size: .8rem; font-weight: 600; }

/* how it works */
.steps ol { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; counter-reset: step; }
.steps li { position: relative; padding: 1.4rem; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); display: grid; gap: .4rem; counter-increment: step; }
.steps li::after { content: counter(step); position: absolute; top: 1rem; right: 1.2rem; font-size: 2.2rem; font-weight: 800; color: var(--surface-2); }
.step-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: var(--r); background: var(--brand-soft); color: var(--brand); margin-bottom: .3rem; }

/* examples */
.example-row { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: .8rem; align-items: center; }
.example-row figure { display: grid; gap: .5rem; }
.example-row img { border-radius: var(--r); box-shadow: var(--shadow); aspect-ratio: 3 / 2; object-fit: cover; width: 100%; height: auto; background: #fff; }
.example-row figcaption { text-align: center; font-weight: 600; font-size: .9rem; color: var(--muted); }
.example-arrow { color: var(--brand); }

/* uses */
.use-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.use { display: grid; gap: .45rem; align-content: start; padding: 1.3rem; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.use > .icon { width: 1.6rem; height: 1.6rem; color: var(--coral); }

/* pricing */
.pricing-section.page { padding-top: 2.5rem; }
.pricing-section.page h1 { text-align: center; font-size: 2rem; margin-bottom: .6rem; }
.pricing-section.page .center { margin: 0 auto 1.4rem; }
.billing-toggle { display: flex; justify-content: center; gap: .25rem; width: max-content; margin: 0 auto 1.6rem; padding: .25rem; border-radius: 999px; background: var(--surface-2); }
.billing-toggle button { border: 0; background: none; padding: .45rem 1rem; border-radius: 999px; font-weight: 650; cursor: pointer; color: var(--muted); }
.billing-toggle button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; align-items: stretch; max-width: 1000px; margin: 0 auto; }
.price-card { position: relative; display: flex; flex-direction: column; gap: .5rem; padding: 1.6rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.price-card h3 { font-size: 1.2rem; display: flex; align-items: center; gap: .4rem; }
.price-card h3 .icon { color: var(--coral); }
.price-card .checklist { margin: .6rem 0 1.2rem; flex: 1; }
.price { font-size: 1rem; margin-top: .5rem; }
.price strong { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; }
.price s { font-size: 1.1rem; }
.price-note { min-height: 1.3em; }
.price-card.featured { border: 2px solid var(--brand); box-shadow: var(--shadow-lg); transform: translateY(-8px); }
.ribbon {
  position: absolute; top: -.8rem; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .75rem; border-radius: 999px; background: var(--brand); color: #fff; font-size: .78rem; font-weight: 700; white-space: nowrap;
}
.ribbon .icon { width: .85rem; height: .85rem; }
.billing-yearly .only-monthly, .billing-monthly .only-yearly { display: none; }

/* faq */
.faq { max-width: 760px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 1rem .2rem; }
.faq summary { cursor: pointer; font-weight: 650; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin-top: .6rem; }

.final-cta { text-align: center; padding-bottom: 2rem !important; }
.final-cta h2 { margin-bottom: 1.2rem; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 2rem !important; }
  .use-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing { grid-template-columns: 1fr; max-width: 440px; gap: 1.5rem; }
  .price-card.featured { transform: none; }
}
@media (max-width: 640px) {
  .landing > section { padding-top: 3rem; }
  .landing h2 { font-size: 1.5rem; }
  .steps ol { grid-template-columns: 1fr; }
  .example-row { grid-template-columns: 1fr; }
  .example-arrow { justify-self: center; transform: rotate(90deg); }
  .use-grid { grid-template-columns: 1fr; }
  .public-nav { gap: .8rem; }
  .compare { transform: none; }
}

/* ---- try it with your photo ---- */
.try-btn { cursor: pointer; }
.center-row { justify-content: center; }
.dialog.try-dialog { width: min(760px, calc(100vw - 2rem)); }
.try-result { display: grid; gap: 1rem; }
.try-result .compare { transform: none; aspect-ratio: auto; min-height: 200px; }
.try-result .compare > img { position: static; height: auto; max-height: 60vh; object-fit: contain; }
.try-result .compare-top img { object-fit: contain; }
.try-loading { display: grid; justify-items: center; gap: .5rem; padding: 3rem 1rem; text-align: center; }
.try-loading .spinner { margin-bottom: .6rem; }
.try-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* ---- admin stats ---- */
.section-title { display: flex; align-items: center; gap: .4rem; margin: 1.8rem 0 .8rem; }
.section-title .icon { color: var(--sun); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; }
.stat { display: grid; align-content: start; gap: .15rem; padding: 1rem 1.1rem; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.stat-label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.stat strong { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; }
.admin-tables { display: grid; grid-template-columns: 1fr 2fr; gap: 1rem; margin-top: 1rem; align-items: start; }
.admin-tables h3 { margin-bottom: .6rem; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th { text-align: left; color: var(--muted); font-weight: 600; padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
table.data td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
@media (max-width: 760px) { .admin-tables { grid-template-columns: 1fr; } }
