@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700;800&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

/* =====================================================================
   PDF → ENB — "Instrument panel" design system
   Solid colors only. No blur, no glass, no gradients, no drop shadows.
   Visual idea: the page is itself framed exactly, edge to edge — the
   same problem the tool solves for PDF pages on a smart board.
   ===================================================================== */

:root{
  --bg:         #F6F8F5;   /* page background — soft off-white */
  --panel:      #FFFFFF;   /* card / row background */
  --panel-alt:  #EEF3EE;   /* raised / hover background */

  --line:       #DCE4DC;   /* default border */
  --line-strong:#BFCEC0;   /* emphasised border */

  --text:       #16211A;
  --text-soft:  #4C5C51;
  --text-faint: #6B7A70;

  --accent:     #128A4B;   /* main colour — success green */
  --accent-hover:#16A257;
  --accent-ink: #FFFFFF;

  --success:    #128A4B;
  --success-ink:#FFFFFF;

  --error:      #C13B45;
  --error-bg:   #FBEAEB;

  --display:'Sora', sans-serif;
  --body:'Inter', sans-serif;
  --mono:'IBM Plex Mono', 'Courier New', monospace;

  --radius-sm: 4px;
  --radius-md: 6px;
}

*{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--body);
  font-size:15px;
  line-height:1.6;
  min-height:100vh;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:0.001ms !important; transition-duration:0.001ms !important; }
}

a{ color:inherit; }
::selection{ background:var(--accent); color:var(--accent-ink); }

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

/* ---------- fixed corner marks: the page itself is "framed exactly" ---------- */
.corner-mark{
  position:fixed;
  width:22px;
  height:22px;
  border-color:var(--accent);
  pointer-events:none;
  z-index:50;
  opacity:0.9;
}
.corner-mark.tl{ top:14px; left:14px; border-top:2px solid var(--accent); border-left:2px solid var(--accent); }
.corner-mark.tr{ top:14px; right:14px; border-top:2px solid var(--accent); border-right:2px solid var(--accent); }
.corner-mark.bl{ bottom:14px; left:14px; border-bottom:2px solid var(--accent); border-left:2px solid var(--accent); }
.corner-mark.br{ bottom:14px; right:14px; border-bottom:2px solid var(--accent); border-right:2px solid var(--accent); }
@media (max-width:640px){ .corner-mark{ display:none; } }

/* ---------- outer instrument frame ---------- */
.instrument{
  max-width:760px;
  margin:40px auto 0;
  border:1px solid var(--line-strong);
  border-radius:var(--radius-md);
  background:var(--bg);
}

.wrap{
  padding:0 0 0 0;
}

/* ---------- header ---------- */
header{
  padding:20px 28px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  border-bottom:1px solid var(--line);
}
.brand{
  font-family:var(--display);
  font-weight:700;
  font-size:17px;
  letter-spacing:-0.01em;
  display:flex;
  align-items:center;
  gap:10px;
}
.brand-mark{
  width:28px;
  height:28px;
  border-radius:var(--radius-sm);
  background:var(--accent);
  position:relative;
  flex:none;
}
.brand-mark::after{
  content:"";
  position:absolute;
  top:7px; left:7px; right:7px; bottom:7px;
  background:var(--bg);
}
.tag{
  font-family:var(--mono);
  font-size:11px;
  color:var(--text-soft);
  white-space:nowrap;
  padding:6px 10px;
  border:1px solid var(--line-strong);
  border-radius:100px;
}

/* ---------- hero ---------- */
.hero{
  padding:44px 28px 36px;
  border-bottom:1px solid var(--line);
}
.hero h1{
  font-family:var(--display);
  font-weight:800;
  font-size:34px;
  line-height:1.15;
  letter-spacing:-0.02em;
  margin:0 0 14px;
  color:var(--text);
  max-width:16ch;
}
.hero p{
  font-family:var(--body);
  font-size:15px;
  color:var(--text-soft);
  max-width:46ch;
  margin:0 0 28px;
}

/* ---------- before / after fit comparison (hero's characteristic visual) ---------- */
.fit-compare{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}
.fit-card{ text-align:left; }
.fit-label{
  font-family:var(--mono);
  font-size:11px;
  color:var(--text-faint);
  margin-bottom:8px;
}
.fit-label b{ color:var(--text-soft); font-weight:600; }
.fit-frame{
  aspect-ratio:16/9;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
}
.fit-frame .page{
  background:var(--panel-alt);
  border:1px solid var(--line-strong);
}
.fit-frame.before .page{
  width:70%;
  height:62%;
}
.fit-frame.after{
  padding:0;
}
.fit-frame.after .page{
  width:100%;
  height:100%;
  border:none;
  position:relative;
}
.fit-frame.after .page::before,
.fit-frame.after .page::after{
  content:"";
  position:absolute;
  width:12px;
  height:12px;
}
.fit-frame.after .page::before{
  top:0; left:0;
  border-top:2px solid var(--accent);
  border-left:2px solid var(--accent);
}
.fit-frame.after .page::after{
  bottom:0; right:0;
  border-bottom:2px solid var(--accent);
  border-right:2px solid var(--accent);
}

/* ---------- generic section ---------- */
section.block{
  padding:26px 28px;
  border-bottom:1px solid var(--line);
}
section.block:last-of-type{ border-bottom:none; }

.section-label{
  display:flex;
  align-items:center;
  gap:10px;
  font-family:var(--body);
  font-size:12px;
  font-weight:600;
  color:var(--text-soft);
  margin-bottom:16px;
}
.section-label .num{
  width:20px;
  height:20px;
  border-radius:var(--radius-sm);
  background:var(--panel-alt);
  border:1px solid var(--line-strong);
  color:var(--accent);
  font-family:var(--mono);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:10.5px;
  font-weight:600;
  flex:none;
}

/* ---------- upload ---------- */
.dropzone{
  border:1px dashed var(--line-strong);
  background:var(--panel);
  border-radius:var(--radius-md);
  padding:40px 24px;
  text-align:center;
  cursor:pointer;
  transition:border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover, .dropzone.drag{
  border-color:var(--accent);
  border-style:solid;
  background:var(--panel-alt);
}
.dropzone-icon{
  width:44px;
  height:44px;
  margin:0 auto 14px;
  border-radius:var(--radius-sm);
  background:var(--panel-alt);
  border:1px solid var(--line-strong);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  color:var(--accent);
}
.dropzone-main{
  font-family:var(--display);
  font-size:15px;
  font-weight:600;
  margin-bottom:4px;
  color:var(--text);
}
.dropzone-sub{
  font-size:12px;
  color:var(--text-faint);
}
.browse-btn{
  display:inline-block;
  margin-top:18px;
  padding:11px 22px;
  background:var(--accent);
  color:var(--accent-ink);
  border:none;
  border-radius:var(--radius-sm);
  font-family:var(--body);
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  transition:background 0.15s ease;
}
.browse-btn:hover{ background:var(--accent-hover); }
#fileInput{ display:none; }

/* ---------- file card ---------- */
.filecard{
  display:none;
  border:1px solid var(--line);
  background:var(--panel);
  border-radius:var(--radius-md);
  padding:18px 20px;
}
.filecard.show{ display:block; }
.filecard-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:16px;
}
.filecard-name{
  font-family:var(--display);
  font-size:15px;
  font-weight:600;
  word-break:break-word;
}
.remove-btn{
  background:none;
  border:1px solid var(--line-strong);
  color:var(--text-soft);
  border-radius:var(--radius-sm);
  font-family:var(--body);
  font-size:11px;
  font-weight:600;
  padding:6px 12px;
  cursor:pointer;
  white-space:nowrap;
  transition:border-color 0.15s ease, color 0.15s ease;
}
.remove-btn:hover{ border-color:var(--error); color:var(--error); }

.meta-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:12px;
}
.meta-item{
  border-top:1px solid var(--line);
  padding-top:10px;
}
.meta-item .k{ font-size:11px; color:var(--text-faint); margin-bottom:4px; }
.meta-item .v{ font-family:var(--mono); font-size:13px; font-weight:600; color:var(--text); }

/* ---------- settings ---------- */
.settings-panel{
  border:1px solid var(--line);
  background:var(--panel);
  border-radius:var(--radius-md);
  padding:2px 20px;
}
.settings-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:16px 0;
  border-top:1px solid var(--line);
}
.settings-row:first-child{ border-top:none; }
.settings-k{ font-size:13px; }
.settings-k .sub{ font-size:11px; color:var(--text-faint); margin-top:2px; }
.settings-v{
  font-family:var(--mono);
  font-size:13px;
  font-weight:600;
  color:var(--accent);
}

select#qualitySelect{
  font-family:var(--mono);
  font-size:13px;
  font-weight:600;
  padding:8px 12px;
  border:1px solid var(--line-strong);
  border-radius:var(--radius-sm);
  background:var(--panel-alt);
  color:var(--text);
  cursor:pointer;
}

/* ---------- convert button ---------- */
.convert-btn{
  width:100%;
  padding:16px;
  background:var(--accent);
  color:var(--accent-ink);
  border:none;
  border-radius:var(--radius-md);
  font-family:var(--display);
  font-size:15px;
  font-weight:700;
  letter-spacing:-0.01em;
  cursor:pointer;
  transition:background 0.15s ease;
}
.convert-btn:disabled{
  background:var(--panel-alt);
  color:var(--text-faint);
  cursor:not-allowed;
}
.convert-btn:not(:disabled):hover{ background:var(--accent-hover); }

/* ---------- progress ---------- */
.progress-wrap{
  display:none;
  border:1px solid var(--line);
  background:var(--panel);
  border-radius:var(--radius-md);
  padding:20px;
  margin-top:16px;
}
.progress-wrap.show{ display:block; }

.progress-bar-track{
  height:6px;
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:100px;
  overflow:hidden;
  margin-bottom:18px;
}
.progress-bar-fill{
  height:100%;
  width:0%;
  background:var(--accent);
  border-radius:100px;
  transition:width 0.3s ease;
}

.stage-list{
  list-style:none;
  margin:0;
  padding:0;
}
.stage-list li{
  display:flex;
  gap:11px;
  align-items:baseline;
  padding:7px 0;
  font-size:13px;
  color:var(--text-faint);
}
.stage-list li .mark{
  width:16px;
  flex:none;
  font-family:var(--mono);
  font-weight:600;
  text-align:center;
}
.stage-list li.active{ color:var(--text); }
.stage-list li.active .mark{ color:var(--accent); }
.stage-list li.done{ color:var(--text-soft); }
.stage-list li.done .mark{ color:var(--success); }

.stage-current{
  margin-top:14px;
  font-family:var(--mono);
  font-size:12px;
  color:var(--text-soft);
  min-height:16px;
}

/* ---------- success ---------- */
.success-wrap{
  display:none;
  border:1px solid var(--success);
  background:var(--panel);
  border-radius:var(--radius-md);
  padding:22px;
}
.success-wrap.show{ display:block; }
.success-head{
  font-family:var(--display);
  font-size:17px;
  font-weight:700;
  color:var(--success);
  margin-bottom:18px;
  display:flex;
  align-items:center;
  gap:10px;
}
.success-head .check{
  width:22px;
  height:22px;
  border-radius:var(--radius-sm);
  background:var(--success);
  color:var(--success-ink);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:700;
  flex:none;
}
.success-meta{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:12px;
  margin-bottom:22px;
}
.success-meta .item{ font-size:13px; }
.success-meta .k{ color:var(--text-faint); font-size:11px; margin-bottom:3px; }
.success-meta .v{ font-family:var(--mono); font-weight:600; font-size:15px; color:var(--text); }

.download-btn{
  width:100%;
  padding:16px;
  background:var(--success);
  color:var(--success-ink);
  border:none;
  border-radius:var(--radius-md);
  font-family:var(--display);
  font-size:15px;
  font-weight:700;
  cursor:pointer;
  transition:filter 0.15s ease;
}
.download-btn:hover{ filter:brightness(1.08); }

.error-wrap{
  display:none;
  border:1px solid var(--error);
  background:var(--error-bg);
  color:#8A222B;
  border-radius:var(--radius-sm);
  padding:14px 16px;
  font-size:13px;
  margin-top:16px;
}
.error-wrap.show{ display:block; }

/* ---------- info / why-this-exists panel ---------- */
.info-panel h3{
  font-family:var(--display);
  font-size:14px;
  font-weight:700;
  margin:0 0 10px;
  color:var(--text);
}
.info-panel h3:not(:first-child){ margin-top:22px; }
.info-panel p{
  font-size:13.5px;
  color:var(--text-soft);
  margin:0 0 4px;
  line-height:1.7;
}
.info-panel ol{
  margin:0;
  padding-left:18px;
  font-size:13.5px;
  color:var(--text-soft);
  line-height:1.6;
}
.info-panel ol li{ margin-bottom:8px; }
.info-panel ol li:last-child{ margin-bottom:0; }
.info-panel ol li::marker{ color:var(--accent); font-family:var(--mono); }

/* ---------- footer ---------- */
footer{
  padding:26px 28px 30px;
}
footer .footer-panel{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:14px;
}
footer .footer-brand{
  font-family:var(--display);
  font-size:14px;
  font-weight:700;
  color:var(--text);
}
footer .yt-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:9px 16px;
  border:1px solid var(--line-strong);
  border-radius:var(--radius-sm);
  color:var(--text);
  text-decoration:none;
  font-size:12.5px;
  font-weight:600;
  transition:border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
footer .yt-link:hover{
  border-color:var(--accent);
  color:var(--accent);
  background:var(--panel-alt);
}
footer .yt-link .yt-icon{ font-size:13px; color:var(--accent); }
footer .footer-note{
  max-width:48ch;
  line-height:1.6;
  font-size:11.5px;
  color:var(--text-faint);
}
footer .copyright{
  font-family:var(--mono);
  font-size:11px;
  color:var(--text-faint);
}

@media (max-width:640px){
  .instrument{ margin:0; border-left:none; border-right:none; border-radius:0; }
  .hero h1{ font-size:27px; max-width:none; }
  .meta-grid, .success-meta{ grid-template-columns:1fr; }
  .fit-compare{ grid-template-columns:1fr; }
}
