*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #f5f3ff;
  --white:    #ffffff;
  --surface:  #ffffff;
  --surf2:    #f0eeff;
  --border:   #e4e0fb;
  --accent:   #023382;
  --accent2:  #039efe;
  --accentlt: #ede9fe;
  --green:    #10b981;
  --text:     #1e1b4b;
  --muted:    #6b7280;
  --mutedlt:  #9ca3af;
  --r:        18px;
  --shadow:   0 4px 24px rgba(124,92,252,0.10);
  --shadow-sm:0 2px 12px rgba(124,92,252,0.07);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 400;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 10% 0%,  rgba(167,139,250,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 90% 80%, rgba(124,92,252,0.12)  0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(236,233,255,0.50) 0%, transparent 80%);
}

.wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* ── HEADER ── */
header {
  padding: 18px 40px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
@media only screen and (max-width: 767px) {
  header { padding: 10px }

};
    

.logo {
  font-size: 1.25rem; font-weight: 800; color: var(--text);
  display: flex; align-items: center; gap: 10px; letter-spacing: -0.5px;
}
.logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff;
  box-shadow: 0 4px 14px rgba(124,92,252,0.38);
}
.logo em { color: var(--accent); font-style: normal; }
.pill {
  font-size: .65rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .6px; padding: 6px 14px; border-radius: 100px;
  background: var(--accentlt); color: var(--accent);
  border: 1px solid rgba(124,92,252,0.2);
}
/* ── HERO ── */
.hero { text-align: center; padding: 72px 20px 48px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--white); border: 1px solid var(--border);
  padding: 7px 16px; border-radius: 100px;
  font-size: .78rem; font-weight: 600; color: var(--muted);
  margin-bottom: 26px; box-shadow: var(--shadow-sm);
}
.dot-green {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); display: inline-block;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800; line-height: 1.08; letter-spacing: -2px;
  color: var(--text); max-width: 715px; margin: 0 auto 18px;
}
.hero h1 .hi {
  background: linear-gradient(135deg, var(--accent) 0%, #019cfe 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p {
  color: var(--muted); font-size: 0.9rem;
  max-width: 700px; margin: 0 auto; line-height: 1.8;
}

/* ── CARD WRAP ── */
.card-wrap { max-width: 860px; margin: 0 auto 64px; width: 100%; padding: 0 20px; }

/* ── DROP ── */
#drop {
  background: var(--white);
  border: 2px dashed var(--border);
  border-radius: 24px; padding: 60px 32px;
  text-align: center; cursor: pointer; position: relative;
  transition: border-color .25s, background .25s, box-shadow .25s;
  box-shadow: var(--shadow);
}
#drop:hover { border-color: var(--accent2); box-shadow: 0 8px 40px rgba(124,92,252,0.14); }
#drop.over  { border-color: var(--accent); background: var(--accentlt); }
#drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

.drop-ico {
  width: 72px; height: 72px; margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--accentlt), #f3e8ff);
  border: 1px solid var(--border); border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; box-shadow: 0 4px 16px rgba(124,92,252,0.12);
}
.drop-h { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.drop-s { color: var(--muted); font-size: .92rem; }
.drop-s b { color: var(--accent); font-weight: 600; }
.fmts { display: flex; gap: 7px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.fmt {
  background: var(--surf2); border: 1px solid var(--border);
  padding: 4px 11px; border-radius: 6px;
  font-size: .7rem; font-weight: 700; color: var(--accent);
  letter-spacing: .4px; text-transform: uppercase;
}

/* ── PROCESSING ── */
#proc {
  display: none; background: var(--white); border: 1px solid var(--border);
  border-radius: 24px; padding: 60px 32px; text-align: center; box-shadow: var(--shadow);
}
.ring {
  width: 64px; height: 64px; border-radius: 50%;
  border: 3px solid var(--accentlt); border-top-color: var(--accent);
  animation: spin .85s linear infinite; margin: 0 auto 24px;
}
@keyframes spin { to { transform: rotate(360deg) } }
.proc-h { font-weight: 700; font-size: 1.1rem; color: var(--text); margin-bottom: 8px; }
.proc-s { color: var(--muted); font-size: .85rem; margin-bottom: 28px; }
.track { background: var(--surf2); border-radius: 100px; height: 6px; max-width: 360px; margin: 0 auto; overflow: hidden; }
.fill  { height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--accent2), var(--accent)); width: 0%; transition: width .25s ease; }
.pct   { color: var(--muted); font-size: .78rem; margin-top: 10px; font-weight: 500; }

/* ── ERROR ── */
#errBox {
  display: none; background: #fff5f5; border: 1px solid #fecaca;
  border-radius: 20px; padding: 32px 28px; color: #dc2626; font-size: .9rem; line-height: 1.7;
}
#errBox strong { display: block; font-size: 1rem; font-weight: 700; margin-bottom: 8px; color: #b91c1c; }
#errBox button {
  margin-top: 16px; padding: 10px 22px; background: var(--white); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  font-family: inherit; font-weight: 500; transition: all .2s;
}
#errBox button:hover { border-color: var(--accent); color: var(--accent); }

/* ── RESULT ── */
#result { display: none; }

.bg-bar {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px 18px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.bg-lbl { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); white-space: nowrap; }
.swatches { display: flex; gap: 7px; flex-wrap: wrap; }
.sw {
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.sw:hover { transform: scale(1.2); }
.sw.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,252,0.2); }
.sw-trans {
  background-image: linear-gradient(45deg,#ddd 25%,transparent 25%),linear-gradient(-45deg,#ddd 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ddd 75%),linear-gradient(-45deg,transparent 75%,#ddd 75%);
  background-size: 9px 9px; background-position: 0 0,0 4.5px,4.5px -4.5px,-4.5px 0; background-color: #f5f5f5;
}
.cc-wrap { display: flex; align-items: center; gap: 6px; }
.cc-wrap label { font-size: .75rem; color: var(--muted); cursor: pointer; font-weight: 500; }
#cc { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--border); padding: 2px; cursor: pointer; background: none; }

.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media(max-width:580px){ .panels { grid-template-columns: 1fr; } }

.panel { background: var(--white); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-sm); }
.plbl { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: .72rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.dot  { width: 7px; height: 7px; border-radius: 50%; background: var(--mutedlt); }
.dot.g{ background: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
.imgwrap { padding: 16px; min-height: 240px; display: flex; align-items: center; justify-content: center; }
.imgwrap img { max-width: 100%; max-height: 320px; object-fit: contain; border-radius: 8px; }
.checker {
  background-image: linear-gradient(45deg,#e0e0e0 25%,transparent 25%),linear-gradient(-45deg,#e0e0e0 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e0e0e0 75%),linear-gradient(-45deg,transparent 75%,#e0e0e0 75%);
  background-size: 18px 18px; background-position: 0 0,0 9px,9px -9px,-9px 0; background-color: #f2f2f2;
}

.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { padding: 13px 24px; border-radius: 12px; font-size: .9rem; font-weight: 600; font-family: inherit; cursor: pointer; border: none; transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-2px); }
.btn-p { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; flex: 1; box-shadow: 0 4px 16px rgba(124,92,252,0.35); }
.btn-p:hover { box-shadow: 0 8px 24px rgba(124,92,252,0.45); }
.btn-s { background: var(--white); color: var(--text); border: 1.5px solid var(--border); box-shadow: var(--shadow-sm); }
.btn-s:hover { border-color: var(--accent2); }
.btn-g { background: transparent; color: var(--muted); border: 1.5px solid var(--border); }
.btn-g:hover { color: var(--text); border-color: var(--accent2); }

/* ── FEATURES ── */
.feats { max-width: 860px; margin: 0 auto 72px; padding: 0 20px; display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
@media(max-width:640px){ .feats { grid-template-columns: 1fr; } }
.feat { background: var(--white); border: 1px solid var(--border); border-radius: 18px; padding: 24px 20px; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
.feat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feat-i { font-size: 1.5rem; margin-bottom: 12px; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 12px; background: var(--accentlt); }
.feat-t { font-weight: 700; font-size: .95rem; color: var(--text); margin-bottom: 6px; }
.feat-d { color: var(--muted); font-size: .82rem; line-height: 1.7; }

/* ── FOOTER ── */
footer { border-top: 1px solid var(--border); padding: 22px 40px; text-align: center; color: var(--mutedlt); font-size: .8rem; margin-top: auto; background: rgba(255,255,255,0.6); }

/* ── TOAST ── */
#toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 12px 20px; font-size: .84rem; font-weight: 500; color: var(--text); z-index: 200; transition: transform .3s ease; white-space: nowrap; box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.err  { border-color: #fca5a5; color: #dc2626; background: #fff5f5; }

canvas#cv { display: none; }
