:root {
  --paper: #fff8ef;
  --paper-strong: #fff1df;
  --ink: #6d2a0f;
  --ink-muted: #8d4d2f;
  --accent: #ef5b1f;
  --accent-deep: #b93d11;
  --line: #e5c6a6;
  --panel: rgba(255, 253, 248, 0.92);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Nunito", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 156, 61, 0.22), transparent 20%),
    radial-gradient(circle at 92% 84%, rgba(255, 90, 15, 0.2), transparent 24%),
    linear-gradient(180deg, #fffdf8 0%, #fff2e2 45%, #ffedd8 100%);
  min-height: 100vh;
}

a {
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

main {
  width: min(1140px, 92vw);
  margin: 0 auto;
}

.topbar {
  width: min(1140px, 92vw);
  margin: 1rem auto 0;
  padding: 1rem 0 1.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.58rem;
  font-family: "Bree Serif", Georgia, serif;
  font-size: 2rem;
  color: #9e2f0d;
}

.brand-logo {
  width: 2rem;
  height: 2rem;
  display: block;
  object-fit: contain;
}

.topnav {
  display: flex;
  gap: 1.1rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.topnav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}

.topnav a:hover {
  color: var(--accent-deep);
}

.ghost-btn,
.cta-btn {
  border-radius: 0.9rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(120deg, var(--accent) 0%, #ff7a1d 55%, var(--accent-deep) 100%);
  box-shadow: 0 10px 22px rgba(178, 62, 16, 0.2);
  text-decoration: none;
}

.ghost-btn {
  padding: 0.58rem 1.2rem;
}

.outline-btn {
  border: 1px solid #cb8e67;
  border-radius: 0.9rem;
  padding: 0.82rem 1.25rem;
  color: #8a3515;
  font-weight: 800;
  text-decoration: none;
  background: rgba(255, 249, 238, 0.85);
}

.outline-btn:hover {
  border-color: #b46e46;
  background: #fff2df;
  transform: translateY(-1px);
}

.hero {
  margin-top: 1.9rem;
}

.hero-copy {
  max-width: 980px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow,
.status-eyebrow,
.uploader-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 900;
  color: var(--accent-deep);
}

.hero-copy h1 {
  margin: 0.65rem 0 0;
  font-family: "Bree Serif", Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 1.02;
  color: #742d12;
}

.hero-lead {
  max-width: 900px;
  margin: 1.15rem auto 0;
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--ink);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 1.6rem;
  flex-wrap: wrap;
}

.cta-btn {
  padding: 0.92rem 1.8rem;
  font-size: 1.05rem;
}

.cta-btn:hover,
.ghost-btn:hover,
.outline-btn:hover {
  transform: translateY(-1px);
}

.proof-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}

.proof-band article {
  background: rgba(255, 249, 240, 0.88);
  border: 1px solid #efcaa8;
  border-radius: 1.25rem;
  padding: 1.45rem 1.35rem;
  box-shadow: 0 16px 30px rgba(174, 84, 29, 0.08);
  text-align: center;
}

.proof-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 138, 51, 0.14);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.proof-band strong {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 1.08rem;
  color: #813216;
}

.proof-band p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.5;
}

.uploader-section {
  display: flex;
  justify-content: center;
  margin-top: 1.8rem;
}

.uploader-card {
  width: min(760px, 100%);
  background: var(--panel);
  border: 2px dashed #e4b690;
  border-radius: 1.1rem;
  padding: 1.25rem;
  backdrop-filter: blur(2px);
  box-shadow: 0 20px 48px rgba(155, 71, 26, 0.12);
}

.uploader-card h2 {
  margin: 0;
  font-family: "Bree Serif", Georgia, serif;
  text-align: center;
}

.uploader-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.uploader-chip {
  white-space: nowrap;
  background: #fff0da;
  border: 1px solid #ebb98a;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--accent-deep);
}

#fileInput {
  display: none;
}

#chooseFilesBtn {
  display: block;
  margin: 0.9rem auto 1rem;
}

.uploader-note {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.96rem;
}

.uploader-details {
  margin: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0;
}

.uploader-details p {
  margin: 0.5rem 0;
}

.format-picker {
  margin: 1rem 0 0.8rem;
  padding: 1rem;
  border: 1px solid #efc6a3;
  border-radius: 1rem;
  background: rgba(255, 248, 238, 0.92);
}

.format-picker-head {
  text-align: center;
  margin-bottom: 0.85rem;
}

.format-picker-copy {
  margin: 0.35rem 0 0;
  font-size: 0.94rem;
  color: var(--ink-muted);
}

.format-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.format-option {
  cursor: pointer;
  position: relative;
}

.format-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.format-option-body {
  display: block;
  height: 100%;
  border: 1px solid #edc29a;
  border-radius: 0.9rem;
  background: #fffaf2;
  padding: 0.9rem 1rem;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background-color 180ms ease;
}

.format-option-body strong,
.format-option-body small {
  display: block;
}

.format-option-body strong {
  font-size: 1rem;
  color: var(--accent-deep);
}

.format-option-body small {
  margin-top: 0.25rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

.format-option input:checked + .format-option-body {
  border-color: var(--accent);
  background: linear-gradient(180deg, #fff7eb 0%, #ffe9cb 100%);
  box-shadow: 0 12px 24px rgba(176, 79, 26, 0.14);
  transform: translateY(-1px);
}

.format-option:hover .format-option-body {
  border-color: #e59d69;
}

.duplicate-info {
  color: #9c2f0f;
  font-weight: 700;
}

.preflight-summary {
  margin: 0.5rem 0;
  padding: 0.55rem 0.7rem;
  border-radius: 0.55rem;
  border: 1px solid #d7b28d;
  background: #fff6e8;
  color: #8c4525;
  font-size: 0.92rem;
}

.preflight-summary.preflight-ok {
  border-color: #71b37d;
  background: #eefaf0;
  color: #2f6a39;
}

.preflight-summary.preflight-warn {
  border-color: #d39765;
  background: #fff3e2;
  color: #8d4d2f;
}

.preflight-summary.preflight-fail {
  border-color: #e29c90;
  background: #fff0ed;
  color: #9f2716;
}

.invalid-files-panel {
  margin: 0.6rem 0 0.2rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e39f94;
  border-radius: 0.65rem;
  background: #fff0ec;
}

.invalid-files-title {
  margin: 0;
  color: #9e2818;
  font-weight: 800;
}

.invalid-files-list {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  color: #8b3d2f;
}

.invalid-files-list li {
  margin: 0.2rem 0;
  font-size: 0.9rem;
}

.invalid-files-actions {
  margin-top: 0.75rem;
}

.invalid-files-action-note {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: #7a3020;
  font-style: italic;
}

.invalid-files-action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.invalid-files-omit-btn,
.invalid-files-cancel-btn {
  padding: 0.42rem 1rem;
  border-radius: 0.5rem;
  border: none;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.invalid-files-omit-btn {
  background: #c0392b;
  color: #fff;
}

.invalid-files-omit-btn:hover:not(:disabled) {
  opacity: 0.85;
}

.invalid-files-omit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.invalid-files-cancel-btn {
  background: #e8e8e8;
  color: #444;
}

.invalid-files-cancel-btn:hover {
  opacity: 0.8;
}

.adjusted-batch-note {
  margin: 0.25rem 0 0.35rem;
  font-size: 0.9rem;
  color: #8d4d2f;
  font-weight: 700;
}

.duplicate-choice {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  color: var(--ink);
}

.duplicate-choice input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--ink);
}

.duplicate-choice:hover {
  color: var(--ink);
}

.duplicate-choice input:hover,
.duplicate-choice input:focus,
.duplicate-choice input:focus-visible {
  accent-color: var(--ink);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.preview-item {
  border: 1px solid #ebbf98;
  border-radius: 0.5rem;
  background: #fff7ea;
  overflow: hidden;
}

.preview-item img {
  width: 100%;
  height: 72px;
  display: block;
  object-fit: cover;
}

.preview-item p {
  margin: 0;
  padding: 0.35rem 0.3rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1.25;
  color: #8d4d2f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.paid-badge {
  background: #ffe3bf;
  border: 1px solid #dca370;
  color: #8e3a13;
  border-radius: 0.5rem;
  padding: 0.58rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.hidden {
  display: none;
}

.status {
  min-height: 1.4rem;
  color: var(--ink-muted);
}

.wide {
  width: 100%;
}

.section {
  margin: 2.2rem 0;
  padding: 1rem;
  border-top: 1px solid var(--line);
}

.section h2 {
  text-align: center;
  margin-top: 0;
  font-family: "Bree Serif", Georgia, serif;
  font-size: clamp(1.75rem, 3vw, 2.6rem);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.steps article {
  text-align: center;
  background: #fff8ee;
  border: 1px solid #f2cfb0;
  border-radius: 1rem;
  padding: 1rem;
}

.step-number {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  margin: 0 auto 0.6rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  background: linear-gradient(120deg, #d94915, #f07e28);
  color: #fff;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.price-card {
  background: #fffdf8;
  border: 1px solid #e8bf96;
  border-radius: 0.95rem;
  padding: 1rem;
  box-shadow: 0 15px 32px rgba(180, 85, 30, 0.12);
}

.featured-price {
  background: linear-gradient(180deg, #fff7ec 0%, #fff0da 100%);
  border-width: 2px;
  transform: translateY(-4px);
}

.price-card h3 {
  margin-top: 0;
  color: #a43612;
}

.price-main {
  font-weight: 800;
}

.price-list {
  margin: 0.9rem 0 0;
  padding-left: 1.2rem;
  color: var(--ink-muted);
  line-height: 1.65;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.trust-grid article {
  background: #fff8ee;
  border: 1px solid #f0c9a4;
  border-radius: 1rem;
  padding: 1rem;
}

.trust-grid h3 {
  margin-top: 0;
  color: #a43612;
}

.trust-grid p {
  margin-bottom: 0;
  color: var(--ink-muted);
  line-height: 1.65;
}

.faq-list {
  display: grid;
  gap: 0.7rem;
  max-width: 780px;
  margin: 0 auto;
}

.faq-list details {
  background: #ffefdb;
  border: 1px solid #eec59f;
  border-radius: 0.6rem;
  padding: 0.7rem 0.9rem;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 700;
}

.footer {
  text-align: center;
  padding: 1.6rem;
  color: #9b6344;
  border-top: 1px solid var(--line);
}

.footer p {
  margin: 0.15rem 0;
}

.simple-page {
  display: grid;
  place-items: center;
}

.status-card {
  width: min(540px, 92vw);
  margin-top: 8vh;
  background: #fff8ec;
  border: 1px solid #efc8a3;
  border-radius: 1rem;
  padding: 1.8rem;
  text-align: center;
  box-shadow: 0 22px 44px rgba(170, 80, 24, 0.12);
}

.success-card {
  background: linear-gradient(180deg, #fff9f2 0%, #fff2df 100%);
}

.cancel-card {
  background: linear-gradient(180deg, #fff9f2 0%, #ffefe4 100%);
}

.inline {
  text-decoration: none;
  display: inline-block;
  margin-top: 1rem;
}

.zip-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
  background:
    radial-gradient(circle at top left, rgba(222, 137, 62, 0.22), transparent 42%),
    linear-gradient(135deg, rgba(247, 239, 231, 0.96), rgba(239, 232, 225, 0.98));
}

.zip-loader.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.zip-card {
  width: min(420px, 92vw);
  padding: 2rem 1.8rem;
  border-radius: 1.35rem;
  background: rgba(255, 250, 246, 0.9);
  border: 1px solid rgba(196, 136, 92, 0.25);
  box-shadow: 0 12px 40px rgba(97, 49, 25, 0.12);
  text-align: center;
}

.zip-box {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 1.1rem;
  perspective: 500px;
}

.zip-base {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(145deg, #d86b23, #a64a1d);
  border-radius: 0.45rem;
  box-shadow: inset 0 -4px 10px rgba(0, 0, 0, 0.2);
}

.zip-lid {
  position: absolute;
  top: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(145deg, #e07a33, #b85721);
  border-radius: 0.45rem;
  transform-origin: bottom;
  animation: zipLidOpen 1.6s ease-in-out infinite;
}

.zip-glow {
  position: absolute;
  bottom: 10px;
  left: 50%;
  width: 60px;
  height: 40px;
  transform: translateX(-50%);
  background: radial-gradient(circle, #ffd8b5 0%, transparent 70%);
  opacity: 0.7;
  animation: zipGlowPulse 1.6s ease-in-out infinite;
}

.zip-title {
  margin: 0;
  font-family: "Bree Serif", Georgia, serif;
  font-size: 1.35rem;
  color: #7b2f12;
}

.zip-sub {
  margin: 0.45rem 0 0;
  font-size: 0.97rem;
  color: #9b5a34;
}

.loader-timeline {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.timeline-stage {
  border: 1px solid #e3c5a6;
  border-radius: 999px;
  padding: 0.32rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #9a5a35;
  background: #fff7ec;
}

.timeline-stage.is-active {
  border-color: #ea8d53;
  color: #9e360f;
  background: #ffe9d6;
}

.timeline-stage.is-done {
  border-color: #78af82;
  color: #2d6a39;
  background: #ecf8ef;
}

.zip-cancel-btn {
  margin-top: 1rem;
  width: 100%;
}

/* Refund Modal Styles */
.refund-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  opacity: 1;
  transition: opacity 300ms ease;
}

.refund-modal.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.refund-card {
  background: var(--paper);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  text-align: center;
  animation: refundSlideIn 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes refundSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.refund-icon {
  font-size: 3rem;
  color: #28a745;
  margin-bottom: 1rem;
  font-weight: bold;
}

.refund-title {
  font-size: 1.8rem;
  margin: 0 0 0.5rem;
  color: var(--ink);
  font-family: "Bree Serif", serif;
}

.refund-status {
  color: var(--ink-muted);
  margin: 0 0 1.5rem;
  font-size: 1rem;
}

.refund-details {
  background: var(--paper-strong);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.detail-label {
  font-weight: 600;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.detail-value {
  font-family: "Courier New", monospace;
  color: var(--accent-deep);
  font-weight: 600;
  word-break: break-all;
}

.refund-success {
  color: #28a745;
  font-family: "Nunito", "Segoe UI", sans-serif;
}

.refund-note {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin: 1.5rem 0 0;
  font-style: italic;
}

.refund-close-btn {
  margin-top: 1.5rem;
  min-width: 200px;
}

@keyframes zipLidOpen {
  0%,
  100% {
    transform: rotateX(0deg);
  }
  50% {
    transform: rotateX(-60deg);
  }
}

@keyframes zipGlowPulse {
  0%,
  100% {
    opacity: 0.5;
    transform: translateX(-50%) scale(0.9);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .zip-lid,
  .zip-glow {
    animation: none;
  }

  .zip-loader {
    transition: none;
  }
}

@media (max-width: 980px) {
  .hero-copy h1 {
    font-size: clamp(2.1rem, 8vw, 3.6rem);
  }

  .hero-actions {
    align-items: flex-start;
  }

  .proof-band,
  .trust-grid,
  .steps,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .uploader-head {
    flex-direction: column;
  }

  .format-options {
    grid-template-columns: 1fr;
  }

  .topbar {
    gap: 0.6rem;
  }

  .topnav {
    justify-content: center;
  }

  .zip-card {
    padding: 1.6rem 1.25rem;
  }
}

@media (max-width: 700px) {
  .topbar,
  main {
    width: min(660px, 94vw);
  }

  .topbar {
    margin-top: 0.55rem;
    padding: 0.75rem 0 0.95rem;
  }

  .brand {
    font-size: 1.7rem;
    gap: 0.45rem;
  }

  .brand-logo {
    width: 1.7rem;
    height: 1.7rem;
  }

  .topnav {
    gap: 0.65rem;
  }

  .topnav a {
    font-size: 0.93rem;
  }

  .ghost-btn {
    padding: 0.52rem 0.95rem;
  }

  .hero {
    margin-top: 1.1rem;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-copy h1 {
    margin-top: 0.45rem;
    font-size: clamp(1.75rem, 10vw, 2.35rem);
    line-height: 1.08;
  }

  .hero-lead {
    margin: 0.8rem auto 0;
    font-size: 1rem;
    line-height: 1.48;
  }

  .hero-actions {
    justify-content: center;
    margin-top: 1.1rem;
  }

  .uploader-section {
    margin-top: 1.15rem;
  }

  .uploader-card {
    padding: 1rem 0.9rem;
    border-radius: 0.95rem;
  }

  .uploader-chip {
    font-size: 0.76rem;
    padding: 0.35rem 0.7rem;
  }

  .uploader-note,
  .uploader-details p,
  .format-picker-copy,
  .status {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  #chooseFilesBtn,
  #convertBtn {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  #chooseFilesBtn {
    margin-top: 0.75rem;
    margin-bottom: 0.85rem;
  }

  .section {
    margin: 1.5rem 0;
    padding: 0.8rem 0.4rem;
  }

  .section h2 {
    font-size: clamp(1.45rem, 8.2vw, 2rem);
    margin-bottom: 0.85rem;
  }

  .proof-band article,
  .steps article,
  .price-card,
  .trust-grid article,
  .faq-list details {
    padding: 0.9rem;
  }

  .price-list {
    margin-top: 0.65rem;
    padding-left: 1rem;
  }

  .footer {
    padding: 1.05rem 0.8rem;
  }
}

@media (max-width: 700px) {
  .mobile-version .topnav a:not(.ghost-btn):not([href="/?view=desktop"]) {
    display: none;
  }

  .mobile-version .topnav {
    width: 100%;
    justify-content: center;
  }

  .mobile-version .ghost-btn,
  .mobile-version .topnav a[href="/?view=desktop"] {
    min-width: 44%;
    text-align: center;
  }
}
