/* ImagesThere — design system
   Palette: teal primary, orange CTA, light glassmorphism */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #0D9488;
  --primary-dark: #0B7C72;
  --secondary: #14B8A6;
  --cta: #F97316;
  --cta-dark: #EA580C;
  --bg: #F0FDFA;
  --text: #134E4A;
  --muted: #3F6360;
  --glass: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(19, 78, 74, 0.10);
  --shadow: 0 8px 32px rgba(13, 148, 136, 0.10);
  --radius: 16px;
  --z-nav: 50;
  --z-modal: 100;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Decorative background blobs */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: -1;
  pointer-events: none;
}
body::before {
  width: 480px; height: 480px;
  background: rgba(20, 184, 166, 0.22);
  top: -120px; right: -120px;
}
body::after {
  width: 420px; height: 420px;
  background: rgba(249, 115, 22, 0.12);
  bottom: -140px; left: -140px;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 16px; left: 16px; right: 16px;
  z-index: var(--z-nav);
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 1120px;
  margin: 0 auto;
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}
.logo svg { color: var(--primary); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 10px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: rgba(13, 148, 136, 0.08); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s, color 0.2s;
  min-height: 44px;
}
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 2px;
}
.btn-cta {
  background: var(--cta);
  color: #fff;
}
.btn-cta:hover { background: var(--cta-dark); box-shadow: 0 6px 20px rgba(249, 115, 22, 0.35); }
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 6px 20px rgba(13, 148, 136, 0.30); }
.btn-ghost {
  background: rgba(13, 148, 136, 0.08);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(13, 148, 136, 0.16); }
.btn-sm { padding: 8px 16px; font-size: 0.9rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* ---------- Hero ---------- */
.hero {
  padding: 160px 0 72px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero h1 .accent { color: var(--primary); }
.hero p.sub {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 32px;
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-trust {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 36px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}
.hero-trust span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.hero-trust svg { color: var(--primary); flex-shrink: 0; }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}
.section-head h2 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.section-head p { color: var(--muted); font-size: 1.08rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.feature-card { transition: box-shadow 0.25s, border-color 0.25s; }
.feature-card:hover {
  box-shadow: 0 14px 40px rgba(13, 148, 136, 0.18);
  border-color: rgba(13, 148, 136, 0.25);
}
.feature-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: rgba(13, 148, 136, 0.12);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.feature-card p { color: var(--muted); font-size: 0.98rem; }

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 999px;
}
.badge-free { background: rgba(13, 148, 136, 0.14); color: var(--primary-dark); }
.badge-pro { background: rgba(249, 115, 22, 0.14); color: var(--cta-dark); }

/* ---------- Steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  counter-reset: step;
}
.step { text-align: center; padding: 28px 24px; }
.step .num {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.step h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Pricing ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 24px;
  align-items: stretch;
}
.price-card {
  display: flex;
  flex-direction: column;
  position: relative;
}
.price-card.featured {
  border: 2px solid var(--cta);
  box-shadow: 0 14px 44px rgba(249, 115, 22, 0.18);
}
.price-card .plan-tag {
  position: absolute;
  top: -14px; left: 50%;
  transform: translateX(-50%);
  background: var(--cta);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.price-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; }
.price-card .price {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}
.price-card .price small {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}
.price-card .price-note { color: var(--muted); font-size: 0.9rem; margin-bottom: 20px; }
.price-card ul {
  list-style: none;
  margin-bottom: 28px;
  flex-grow: 1;
}
.price-card ul li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.96rem;
}
.price-card ul li svg { color: var(--primary); flex-shrink: 0; margin-top: 4px; }
.price-card ul li.off { color: var(--muted); opacity: 0.65; }
.price-card ul li.off svg { color: var(--muted); }

/* ---------- FAQ ---------- */
.faq-list { max-width: 720px; margin: 0 auto; display: grid; gap: 14px; }
details.card { padding: 0; overflow: hidden; }
details.card summary {
  cursor: pointer;
  font-weight: 700;
  padding: 20px 24px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: background 0.2s;
}
details.card summary:hover { background: rgba(13, 148, 136, 0.06); }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--primary);
  transition: transform 0.2s;
}
details[open].card summary::after { transform: rotate(45deg); }
details.card .faq-body { padding: 0 24px 20px; color: var(--muted); }

/* ---------- CTA band ---------- */
.cta-band {
  text-align: center;
  padding: 56px 32px;
}
.cta-band h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; margin-bottom: 12px; }
.cta-band p { color: var(--muted); margin-bottom: 28px; font-size: 1.08rem; }

/* ---------- Footer ---------- */
footer {
  padding: 40px 0 56px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}
footer a { color: var(--primary-dark); text-decoration: none; font-weight: 600; }
footer a:hover { text-decoration: underline; }

/* ================= App page ================= */
.app-main { padding: 120px 0 64px; }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  padding: 12px 20px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.tab:hover { color: var(--text); border-color: rgba(13, 148, 136, 0.3); }
.tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.tab .lock { color: var(--cta); }
.tab.active .lock { color: #fff; }

.panel { display: none; }
.panel.active { display: block; }

.dropzone {
  border: 2px dashed rgba(13, 148, 136, 0.4);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: rgba(13, 148, 136, 0.07);
}
.dropzone svg { color: var(--primary); margin-bottom: 12px; }
.dropzone p { font-weight: 700; margin-bottom: 4px; }
.dropzone span { color: var(--muted); font-size: 0.9rem; }

.tool-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 860px) {
  .tool-layout { grid-template-columns: 1fr; }
}

.preview-area {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 20px;
}
.preview-area img, .preview-area canvas {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 8px;
  display: block;
}
#cropCanvas { touch-action: none; cursor: crosshair; }

.controls { display: grid; gap: 16px; }
.control-group label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 6px;
}
.control-group input[type="number"],
.control-group input[type="email"],
.control-group input[type="password"],
.control-group input[type="text"],
.control-group select {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(19, 78, 74, 0.2);
  background: #fff;
  color: var(--text);
  min-height: 44px;
}
.control-row { display: flex; gap: 10px; align-items: flex-end; }
.control-row .control-group { flex: 1; }
input[type="range"] { width: 100%; accent-color: var(--primary); cursor: pointer; }
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

.preset-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 14px;
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(19, 78, 74, 0.18);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.chip:hover { border-color: var(--primary); color: var(--text); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.paste-zone {
  text-align: center;
  padding: 64px 24px;
}
.paste-zone .kbd-hint { margin: 16px 0 24px; color: var(--muted); }
kbd {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  background: #fff;
  border: 1px solid rgba(19, 78, 74, 0.25);
  border-bottom-width: 3px;
  border-radius: 7px;
  padding: 4px 10px;
}
.paste-result { margin-top: 24px; display: none; }
.paste-result.show { display: block; }
.paste-result img {
  max-width: 100%;
  max-height: 320px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.status-msg {
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 14px;
  min-height: 1.4em;
}
.status-msg.ok { color: var(--primary-dark); }
.status-msg.err { color: #B91C1C; }

.file-meta { color: var(--muted); font-size: 0.88rem; font-weight: 600; }

/* ---------- GIF frame strip ---------- */
.frames-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.frame-card {
  width: 104px;
  background: #fff;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 6px;
  text-align: center;
}
.frame-card img {
  width: 100%;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.frame-num {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
  margin: 4px 0 2px;
}
.frame-actions {
  display: flex;
  justify-content: center;
  gap: 4px;
}
.icon-btn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(19, 78, 74, 0.18);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
  transition: border-color 0.2s, color 0.2s;
}
.icon-btn:hover { border-color: var(--primary); color: var(--text); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(19, 78, 74, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 20px;
  max-width: 440px;
  width: 100%;
  padding: 36px 32px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(13, 148, 136, 0.08);
  border: none;
  border-radius: 10px;
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover { background: rgba(13, 148, 136, 0.16); color: var(--text); }
.modal h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 8px; }
.modal > p { color: var(--muted); margin-bottom: 22px; font-size: 0.97rem; }
.modal .plan-buttons { display: grid; gap: 12px; margin-bottom: 22px; }
.modal .divider {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal .divider::before, .modal .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(19, 78, 74, 0.15);
}
.license-row { display: flex; gap: 8px; }
.license-row input {
  flex: 1;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(19, 78, 74, 0.2);
  min-height: 44px;
}

.pro-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(249, 115, 22, 0.14);
  color: var(--cta-dark);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 7px 14px;
  border-radius: 999px;
}

/* ---------- Settings modal ---------- */
.modal-section {
  font-size: 0.95rem;
  font-weight: 800;
  margin: 20px 0 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(19, 78, 74, 0.12);
}
.settings-row { display: flex; gap: 8px; }
.settings-row input {
  flex: 1;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(19, 78, 74, 0.2);
  min-height: 44px;
}

/* ---------- Embedded checkout ---------- */
.modal-wide {
  max-width: 480px;
  padding: 52px 16px 16px;
}
#checkoutMount { min-height: 420px; }

/* ---------- Password fields ---------- */
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 44px; }
.settings-row .pw-wrap { flex: 1; }
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.pw-toggle:hover { color: var(--text); background: rgba(13, 148, 136, 0.08); }
.link-btn {
  background: none;
  border: none;
  color: var(--primary-dark);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 2px 0;
  text-align: left;
}
.link-btn:hover { text-decoration: underline; }

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --bg: #0C1716;
  --text: #E2F4F1;
  --muted: #9DBFBA;
  --glass: rgba(23, 42, 40, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] body::before { background: rgba(20, 184, 166, 0.10); }
[data-theme="dark"] body::after { background: rgba(249, 115, 22, 0.07); }
[data-theme="dark"] .chip,
[data-theme="dark"] .icon-btn,
[data-theme="dark"] .frame-card,
[data-theme="dark"] kbd,
[data-theme="dark"] .control-group input[type="number"],
[data-theme="dark"] .control-group input[type="email"],
[data-theme="dark"] .control-group input[type="password"],
[data-theme="dark"] .control-group input[type="text"],
[data-theme="dark"] .control-group select,
[data-theme="dark"] .settings-row input {
  background: #15302D;
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.14);
}
[data-theme="dark"] .chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
[data-theme="dark"] .dropzone {
  background: rgba(23, 42, 40, 0.5);
  border-color: rgba(20, 184, 166, 0.45);
}
[data-theme="dark"] .dropzone:hover,
[data-theme="dark"] .dropzone.dragover { background: rgba(20, 184, 166, 0.12); }
[data-theme="dark"] .modal { background: #132724; }
[data-theme="dark"] .modal-close { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
[data-theme="dark"] .modal-close:hover { background: rgba(255, 255, 255, 0.16); color: var(--text); }
[data-theme="dark"] .btn-ghost { background: rgba(255, 255, 255, 0.08); color: var(--text); }
[data-theme="dark"] .btn-ghost:hover { background: rgba(255, 255, 255, 0.15); }
[data-theme="dark"] .nav-links a:hover { background: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] details.card summary:hover { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .badge-free { background: rgba(20, 184, 166, 0.2); color: #5EEAD4; }
[data-theme="dark"] .badge-pro { background: rgba(249, 115, 22, 0.2); color: #FDBA74; }
[data-theme="dark"] .pro-pill { background: rgba(249, 115, 22, 0.2); color: #FDBA74; }
[data-theme="dark"] .step .num { background: var(--primary); }
[data-theme="dark"] .modal-section { border-top-color: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .status-msg.ok { color: #5EEAD4; }
[data-theme="dark"] .link-btn { color: #5EEAD4; }
[data-theme="dark"] .pw-toggle:hover { background: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .status-msg.err { color: #FCA5A5; }

/* ---------- Responsive / motion ---------- */
@media (max-width: 640px) {
  .nav-links a:not(.btn) { display: none; }
  .hero { padding-top: 130px; }
  section { padding: 52px 0; }
  .card { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
