/* ===========================================================
   Masker by Ganit - theme pulled from the Ganit logo
   Primary blue  #1A00D9   Accent orange #FE6E06
   Grey #535353   Light tint #EAE9FB
   Font: Poppins (geometric sans, matches the wordmark)
   =========================================================== */

:root {
  --blue: #1A00D9;
  --blue-deep: #1400A8;
  --orange: #FE6E06;
  --grey: #535353;
  --tint: #EAE9FB;
  --tint-2: #C5C1F4;
  --ink: #16142b;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(26, 0, 217, 0.10);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 80% -10%, var(--tint) 0%, transparent 60%),
    radial-gradient(900px 400px at -10% 10%, #fff4ec 0%, transparent 55%),
    #ffffff;
  min-height: 100vh;
}

/* ---------------- Header ---------------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--tint);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo { height: 34px; }
.brand-divider { width: 1px; height: 26px; background: var(--tint-2); }
.brand-product {
  font-weight: 600; font-size: 1.2rem; color: var(--blue);
  letter-spacing: -0.01em;
}

/* ---------------- Layout ---------------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 40px 24px 80px; }

.hero { text-align: center; margin-bottom: 36px; }
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 700;
  line-height: 1.15; margin: 0 0 14px; letter-spacing: -0.01em;
}
.hero .accent { color: var(--blue); }
.hero .sub { color: var(--grey); max-width: 620px; margin: 0 auto; font-weight: 300; font-size: 1.05rem; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--white);
  border: 1px solid var(--tint);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
}

.uploader {
  text-align: center;
  border: 2px dashed var(--tint-2);
  transition: border-color .2s, background .2s, transform .1s;
  cursor: pointer;
}
.uploader.dragover { border-color: var(--blue); background: var(--tint); transform: scale(1.005); }
.uploader h2 { margin: 6px 0 4px; font-weight: 600; }
.muted { color: var(--grey); font-weight: 300; margin: 0 0 18px; }
.filename { font-weight: 500; color: var(--blue); margin: 14px 0 0; word-break: break-all; }

/* ---------------- Buttons ---------------- */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blue); color: #fff; border: none;
  padding: 12px 22px; border-radius: 999px; font-family: inherit;
  font-weight: 600; font-size: 0.96rem; cursor: pointer;
  transition: background .2s, transform .08s, box-shadow .2s;
  box-shadow: 0 6px 16px rgba(26, 0, 217, 0.22);
}
.btn-primary:hover { background: var(--blue-deep); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-go { margin-top: 18px; background: var(--orange); box-shadow: 0 6px 16px rgba(254, 110, 6, 0.3); }
.btn-go:hover { background: #e85f00; }

/* ---------------- Mode selector ---------------- */
.mode-select {
  border: 1px solid var(--tint); border-radius: var(--radius);
  margin: 20px auto 0; padding: 14px 16px 16px; max-width: 460px; text-align: left;
}
.mode-select legend { font-weight: 600; color: var(--ink); padding: 0 6px; font-size: 0.92rem; }
.mode-select label {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  padding: 8px 10px; border-radius: 10px; transition: background .15s;
}
.mode-select label:hover { background: var(--tint); }
.mode-select input[type="radio"] { margin-top: 3px; accent-color: var(--blue); }
.mode-select span { display: flex; flex-direction: column; font-weight: 500; color: var(--ink); }
.mode-select small { font-weight: 300; color: var(--grey); margin-top: 2px; }

/* ---------------- Status / spinner ---------------- */
.status { text-align: center; margin-top: 24px; }
.status p { color: var(--grey); margin: 14px 0 0; }
.spinner {
  width: 42px; height: 42px; margin: 0 auto;
  border: 4px solid var(--tint); border-top-color: var(--blue);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Results ---------------- */
.results { margin-top: 28px; }
.result-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.summary { font-weight: 500; color: var(--ink); }
.summary strong { color: var(--blue); }

.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .result-grid { grid-template-columns: 1fr; } }
.pane h3 { margin: 0 0 10px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.badge {
  font-size: 0.7rem; font-weight: 600; color: #fff; background: var(--orange);
  padding: 3px 10px; border-radius: 999px; letter-spacing: .02em;
}
.viewer {
  background: #f6f6fb; border: 1px solid var(--tint); border-radius: 12px;
  padding: 10px; max-height: 70vh; overflow: auto;
}
.viewer img, .viewer canvas { width: 100%; display: block; border-radius: 6px; margin-bottom: 10px; }
.viewer img:last-child, .viewer canvas:last-child { margin-bottom: 0; }
.page-label { font-size: 0.75rem; color: var(--grey); margin: 0 0 6px; }

/* ---------------- Report ---------------- */
.report { margin-top: 22px; }
.report h3 { margin: 0 0 12px; font-weight: 600; }
.report ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.report li {
  display: flex; align-items: center; gap: 10px;
  background: var(--tint); border-radius: 10px; padding: 9px 14px; font-size: 0.9rem;
}
.report li .type {
  font-weight: 600; color: var(--blue); background: #fff;
  padding: 2px 10px; border-radius: 999px; font-size: 0.78rem;
}
.report li .preview { color: var(--grey); font-family: ui-monospace, monospace; }
.report li .where { margin-left: auto; color: var(--grey); font-size: 0.8rem; }

/* ---------------- Footer ---------------- */
.site-footer {
  text-align: center; padding: 26px; color: var(--grey);
  font-size: 0.85rem; font-weight: 300; border-top: 1px solid var(--tint);
}

.hidden { display: none !important; }
