/* PhotoMuse — mobile-first, one accent color */
:root {
  --accent: #6C5CE7;
  --accent-2: #8E7CF8;
  --accent-dark: #5a4bd1;
  --accent-soft: #f0eeff;
  --ink: #1c1c28;
  --muted: #6b6b7b;
  --bg: #ffffff;
  --bg-alt: #f7f7fb;
  --border: #e6e6ef;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(28, 28, 40, 0.10);
  --shadow-accent: 0 6px 20px rgba(108, 92, 231, 0.35);
  --grad-primary: linear-gradient(135deg, #6C5CE7 0%, #8E7CF8 100%);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 18px; }
h1 { font-size: clamp(2rem, 5vw + 1rem, 3.2rem); line-height: 1.12; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 2vw + 0.8rem, 1.9rem); text-align: center; margin-bottom: 8px; letter-spacing: -0.02em; }
h3 { font-size: 1.08rem; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 28px; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }

/* top bar */
.topbar { border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; height: 54px; }
.logo { font-weight: 800; font-size: 1.1rem; }
.credits-badge { background: var(--accent-soft); color: var(--accent-dark); padding: 5px 12px; border-radius: 999px; font-size: 0.85rem; }

/* hero */
.hero { padding: 44px 0 36px; text-align: center; background: linear-gradient(165deg, #EEEBFF 0%, #F7F1FA 55%, #FFF7EE 100%); }
.hero .sub { color: var(--muted); margin: 14px auto 26px; font-size: 1.05rem; max-width: 34ch; }

.app-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; max-width: 560px; margin: 0 auto; }

/* dropzone */
.dropzone {
  border: 1.5px dashed rgba(108, 92, 231, 0.55);
  border-radius: 16px;
  padding: 32px 16px;
  cursor: pointer;
  background: var(--accent-soft);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.12s;
}
.dropzone:hover, .dropzone.dragover {
  border-style: solid;
  border-color: var(--accent);
  background: #eae6ff;
  box-shadow: 0 0 0 5px rgba(108, 92, 231, 0.12), 0 8px 24px rgba(108, 92, 231, 0.18);
  transform: scale(1.012);
}
.dz-icon { color: var(--accent); display: block; margin: 0 auto; }
.dz-title { font-weight: 700; font-size: 1.15rem; margin-top: 10px; }
.dz-sub { color: var(--accent-dark); margin-top: 2px; font-weight: 600; }
.dz-note { color: var(--muted); font-size: 0.8rem; margin-top: 12px; }

.colorize-opt { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; font-size: 0.95rem; cursor: pointer; user-select: none; }
.colorize-opt input { width: 18px; height: 18px; accent-color: var(--accent); }

/* compact mode pill under the dropzone (/restore, /colorize) */
.mode-pill {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 14px; padding: 6px 14px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--accent-dark); background: var(--accent-soft);
  border: 1px solid #ded8ff; border-radius: 999px;
}
.mode-pill svg { flex: 0 0 auto; }

.error-msg { color: #d63031; margin-top: 12px; font-size: 0.92rem; }

/* clickable examples under the dropzone */
.examples { margin-top: 18px; }
.examples-title { font-size: 0.85rem; color: var(--muted); margin-bottom: 10px; }
.examples-row { display: flex; gap: 10px; justify-content: center; }
.example-tile { flex: 1 1 0; max-width: 120px; border: 1.5px solid var(--border); background: var(--bg); border-radius: 12px; padding: 6px 6px 8px; cursor: pointer; font-family: inherit; transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s; }
.example-tile:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(28, 28, 40, 0.10); }
.example-thumb { position: relative; }
.example-thumb::after {
  content: "✨";
  position: absolute; top: 4px; right: 4px;
  font-size: 0.72rem; line-height: 1;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px; padding: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}
.example-tile img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; display: block; }
.example-tile > span:last-child { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 6px; line-height: 1.3; }

/* "Example result" badge on demo results */
.example-badge { display: table; margin: 0 auto 12px; background: #fff4d6; color: #8a6d00; border: 1px solid #f0dfa8; font-size: 0.78rem; font-weight: 700; padding: 4px 14px; border-radius: 999px; }

/* gift callout (restore landing) — warm amber */
.gift-callout { display: flex; align-items: center; gap: 12px; max-width: 560px; margin: 18px auto 0; background: #FFF4E0; border: 1px solid #F3DFB6; border-radius: var(--radius); padding: 14px 16px; text-align: left; }
.gift-icon { font-size: 1.6rem; }
.gift-callout p { font-size: 0.92rem; color: #B45309; font-weight: 500; }

/* hero privacy row */
.trust-row { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-top: 18px; }
.trust-row li { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.85rem; }
.trust-row svg { color: var(--accent); flex: 0 0 auto; }

/* trust lines + payment chips */
.trust-line { text-align: center; margin-top: 18px; font-weight: 600; font-size: 0.95rem; }
.trust-line + .trust-line { margin-top: 6px; font-weight: 400; }
.pay-chips { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 14px; }
.pay-secure { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 0.78rem; margin-right: 4px; }
.pay-secure svg { color: #1d9d5f; }
.pay-chip { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; padding: 3px 11px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; color: var(--muted); background: var(--bg); }
.pricing-badges { margin-top: 24px; }

/* anti-subscription manifesto + guarantee */
.manifesto { text-align: center; margin-bottom: 10px; }
.manifesto h2 { margin-bottom: 8px; }
.manifesto-sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 14px; }
.guarantee-line { font-size: 0.78rem; color: var(--muted); margin-top: 10px; }

/* processing */
.spinner { width: 46px; height: 46px; border: 4px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; margin: 10px auto 18px; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-track { height: 6px; background: var(--accent-soft); border-radius: 3px; margin-top: 18px; overflow: hidden; }
.progress-fill { height: 100%; width: 5%; background: var(--grad-primary); border-radius: 3px; transition: width 1s linear; }

/* before/after slider */
.ba-slider { position: relative; border-radius: var(--radius); overflow: hidden; user-select: none; touch-action: none; aspect-ratio: 4 / 3; background: #ddd; max-width: 640px; margin: 0 auto; }
.ba-slider.ba-portrait { aspect-ratio: 3 / 4; max-width: 440px; }
.ba-slider img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.ba-before-wrap { position: absolute; inset: 0; clip-path: inset(0 50% 0 0); }
.ba-before-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; background: #fff; box-shadow: 0 0 8px rgba(0, 0, 0, 0.4); cursor: ew-resize; }
.ba-handle span {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #fff; color: var(--accent);
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
}
.ba-handle span svg { display: block; }
.ba-label { position: absolute; bottom: 10px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; letter-spacing: 0.5px; }
.ba-label-l { left: 10px; }
.ba-label-r { right: 10px; }

.result-title { text-align: center; margin-bottom: 14px; }

/* variant tabs (restore mode: Precise | Vivid) */
.variant-tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }
.variant-tab { border: 1.5px solid var(--border); background: var(--bg); color: var(--muted); border-radius: 999px; padding: 7px 20px; font-size: 0.9rem; font-weight: 700; cursor: pointer; font-family: inherit; transition: border-color 0.15s, color 0.15s, background 0.15s; }
.variant-tab:hover { border-color: var(--accent); }
.variant-tab.active { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
#stateResult .ba-slider { margin-bottom: 10px; }
#stateResult .muted { text-align: center; margin-bottom: 14px; }
#stateProcessing { text-align: center; padding: 18px 0; }
#stateFailed { text-align: center; padding: 12px 0; }
.fail-icon { font-size: 2.2rem; }

/* buttons */
.btn { display: block; width: 100%; border: none; border-radius: 12px; padding: 13px 20px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: background 0.15s, transform 0.12s, box-shadow 0.15s; font-family: inherit; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--grad-primary); color: #fff; box-shadow: 0 2px 8px rgba(108, 92, 231, 0.25); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-accent); }
.btn-primary:active { transform: scale(0.98); }
.btn-lg { padding: 15px 22px; font-size: 1.08rem; }
.btn-ghost { background: transparent; color: var(--accent-dark); margin-top: 10px; }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-dev { background: #ffeaa7; color: #6b5900; margin-top: 12px; font-size: 0.88rem; }
#exampleUploadBtn { margin-bottom: 4px; }

/* sections — consistent spacing scale */
.section { padding: 56px 0; }
.demo { background: var(--bg-alt); }

.steps { display: grid; gap: 18px; margin-top: 28px; }
.step { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; }
.step-num { width: 38px; height: 38px; border-radius: 50%; background: var(--grad-primary); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.step p { color: var(--muted); font-size: 0.92rem; margin-top: 6px; }

/* pricing */
.pricing { background: var(--bg-alt); }
.plans { display: grid; gap: 16px; margin-top: 28px; }
.plan { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 24px; text-align: center; position: relative; }
.plan-featured { border: 2px solid var(--accent); box-shadow: 0 12px 36px rgba(108, 92, 231, 0.20); }
.plan-badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--grad-primary); color: #fff; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 14px; border-radius: 999px; white-space: nowrap; box-shadow: 0 3px 10px rgba(108, 92, 231, 0.35); }
.price { font-size: 2rem; font-weight: 800; margin: 8px 0 2px; }
.per-photo { display: inline-block; vertical-align: middle; background: var(--accent-soft); color: var(--accent-dark); font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-left: 6px; }
.price-once { font-size: 0.76rem; color: var(--muted); margin-bottom: 12px; }
.plan ul { list-style: none; margin-bottom: 18px; color: var(--muted); font-size: 0.92rem; }
.plan li { padding: 4px 0; }
.plan li b { color: var(--ink); }

/* faq */
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { font-weight: 700; cursor: pointer; list-style: none; position: relative; padding: 16px 34px 16px 4px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 10px; top: 50%;
  width: 9px; height: 9px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { color: var(--muted); padding: 0 4px 16px; font-size: 0.94rem; }

/* modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(20, 20, 30, 0.6); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 18px; }
.modal { background: var(--bg); border-radius: var(--radius); padding: 26px 22px; max-width: 420px; width: 100%; text-align: center; position: relative; box-shadow: var(--shadow); }
.modal-close { position: absolute; top: 10px; right: 12px; background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--muted); padding: 6px; }
.modal h3 { font-size: 1.3rem; margin-bottom: 6px; }
.modal-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 6px; }
.modal-plan { border: 1.5px solid var(--border); background: var(--bg); border-radius: 12px; padding: 16px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; font-family: inherit; transition: border-color 0.15s; }
.modal-plan:hover { border-color: var(--accent); }
.mp-featured { border-color: var(--accent); background: var(--accent-soft); }
.mp-badge { font-size: 0.66rem; font-weight: 800; color: var(--accent-dark); text-transform: uppercase; letter-spacing: 0.5px; }
.mp-name { font-weight: 700; }
.mp-price { font-size: 1.4rem; font-weight: 800; color: var(--accent-dark); }
.mp-desc { font-size: 0.82rem; color: var(--muted); }
.modal .small { margin-top: 12px; }

/* sticky mobile CTA */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 24px rgba(28, 28, 40, 0.12);
  transform: translateY(0);
  animation: cta-in 0.25s ease-out;
}
@keyframes cta-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (min-width: 768px) { .sticky-cta { display: none !important; } }

/* footer */
.footer { border-top: 1px solid var(--border); padding: 26px 0; margin-top: 20px; }
.footer-inner { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.footer-brand { color: var(--muted); font-size: 0.82rem; }
.footer-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.footer-chips a { color: var(--muted); text-decoration: none; font-size: 0.8rem; font-weight: 600; border: 1px solid var(--border); border-radius: 999px; padding: 4px 13px; transition: color 0.15s, border-color 0.15s, background 0.15s; }
.footer-chips a:hover { color: var(--accent-dark); border-color: var(--accent); background: var(--accent-soft); }

/* desktop */
@media (min-width: 720px) {
  .hero { padding: 72px 0 56px; }
  .section { padding: 72px 0; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .plans { grid-template-columns: repeat(3, 1fr); align-items: center; }
  .plan-featured { transform: scale(1.04); z-index: 1; }
  .footer-inner { flex-direction: row; justify-content: space-between; }
}

/* cross-device access: restore link, purchase-success code box, restore form */
.topbar-right { display: flex; align-items: center; gap: 12px; }
.restore-link { background: none; border: none; padding: 4px 0; font-family: inherit; font-size: 0.82rem; font-weight: 600; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; transition: color 0.15s; }
.restore-link:hover { color: var(--accent-dark); }
.success-icon { font-size: 2rem; margin-bottom: 4px; }
.code-box { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 16px 0 10px; padding: 13px 14px; border: 1.5px dashed var(--accent); border-radius: 12px; background: var(--accent-soft); }
.code-box code { font-size: 1.18rem; font-weight: 700; letter-spacing: 1.5px; color: var(--accent-dark); }
.btn-copy { margin-top: 0; padding: 6px 14px; font-size: 0.82rem; border: 1px solid var(--border); border-radius: 8px; }
.code-hint { font-size: 0.9rem; font-weight: 600; margin-bottom: 8px; }
.modal .btn-primary { margin-top: 14px; }
.restore-input { width: 100%; box-sizing: border-box; margin-top: 14px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px; font-family: inherit; font-size: 1rem; text-align: center; }
.restore-input:focus { outline: none; border-color: var(--accent); }
.btn-block { width: 100%; }
#restoreError, #restoreInfo { margin-top: 10px; }
