/* Otimizador de Imagem (mobile) — tema preto/dourado Artesã de Ouro */
:root {
  --bg: #0e0e10; --bg-2: #16161a; --card: #1c1c22; --card-2: #232329;
  --line: #2c2c34; --text: #f2f2f4; --muted: #8b8b95;
  --gold: #d4af37; --gold-dark: #b8941f; --green: #34d399; --red: #f87171; --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px;
  display: flex; flex-direction: column; min-height: 100vh;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  background: linear-gradient(180deg, #1a1a1f, #141418);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.gem { color: var(--gold); font-size: 22px; }
.brand-title { font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 11px; }

main { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 14px; max-width: 680px; width: 100%; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }

.step-head { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; margin-bottom: 14px; }
.step-num { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: #0e0e10; font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; }
input[type=text], textarea {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 12px; font-size: 16px; width: 100%; font-family: inherit; resize: vertical;
}
input:focus, textarea:focus { outline: none; border-color: var(--gold-dark); }
.counter { float: right; font-weight: 400; color: var(--muted); font-size: 11px; }
.counter.warn { color: var(--gold); } .counter.bad { color: var(--red); }

.paste-box { background: var(--bg-2); border: 1px dashed var(--gold-dark); border-radius: 10px; padding: 12px; margin-bottom: 16px; }
.paste-box summary { cursor: pointer; font-weight: 600; color: var(--gold); }
.paste-box textarea { margin: 10px 0 8px; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 8px 0; }

.primary { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: #0e0e10; font-weight: 700; border: none; border-radius: 12px; padding: 13px 18px; cursor: pointer; font-size: 15px; }
.primary:active { filter: brightness(.92); }
.primary:disabled { opacity: .45; }
.primary.big { display: block; width: 100%; padding: 16px; font-size: 17px; }
a.primary { display: block; text-align: center; text-decoration: none; }
.desktop-card { border-color: var(--gold-dark); }
.dl-intro { margin-top: 0; }
#dl-area .dl-btn { margin: 14px 0 8px; }
#dl-area .hint { margin: 6px 0 0; }
.btn-sm { background: var(--card-2); border: 1px solid var(--line); color: var(--gold); border-radius: 8px; padding: 9px 14px; cursor: pointer; font-size: 14px; font-weight: 600; }
.icon-btn { background: transparent; border: none; color: var(--muted); width: 36px; height: 36px; border-radius: 9px; font-size: 18px; cursor: pointer; }
.icon-btn:active { background: var(--card-2); }

.pick-info { font-size: 13px; margin-top: 10px; }
.pick-info.ok { color: var(--green); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.thumbs .more { width: 64px; height: 64px; border-radius: 8px; background: var(--card-2); display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); }

.opt-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.sub-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.chk-inline, .chk-row { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.chk-row { margin: 12px 0; align-items: flex-start; line-height: 1.4; }
.chk-inline input, .chk-row input { width: 20px; height: 20px; accent-color: var(--gold); flex-shrink: 0; }

.bar { height: 10px; background: var(--bg-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
#bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold-dark), var(--gold)); transition: width .15s; }
#progress-text { font-size: 13px; margin-top: 8px; }

#result-summary { margin-bottom: 12px; font-size: 14px; }
#btn-zip { margin-bottom: 14px; }
.results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.res-item { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.res-item a { display: block; }
.res-item img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #0a0a0c; display: block; }
.res-meta { padding: 7px 9px; font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.res-meta.small { color: var(--gold); }
.res-folder { font-size: 10px; color: var(--gold); padding: 6px 9px 0; font-weight: 700; }

.footer { padding: 14px; border-top: 1px solid var(--line); font-size: 11px; text-align: center; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 100; }
.modal-card { background: var(--bg-2); border: 1px solid var(--gold-dark); border-radius: 16px; max-width: 480px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px; overflow-y: auto; font-size: 14px; line-height: 1.6; }
.modal-body p { margin-bottom: 10px; } .modal-body em { color: var(--gold); font-style: normal; }
.modal-foot { padding: 14px 16px; border-top: 1px solid var(--line); }
.modal-foot .primary { width: 100%; }
.link { background: none; border: none; color: var(--gold); text-decoration: underline; cursor: pointer; font-size: inherit; padding: 0; }

/* Tela de ativação (trava) */
.gate { position: fixed; inset: 0; background: var(--bg); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 22px; }
.gate-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--gold-dark); border-radius: 16px; padding: 22px; text-align: center; }
.gate-brand { font-size: 19px; font-weight: 700; } .gate-brand .gem { color: var(--gold); }
.gate-sub { font-size: 12px; margin: 4px 0 18px; }
.gate-label { display: block; font-size: 13px; font-weight: 600; text-align: left; margin-bottom: 6px; }
#gate-key { text-transform: uppercase; text-align: center; letter-spacing: 1px; font-size: 17px; margin-bottom: 12px; }
.gate-msg { font-size: 13px; line-height: 1.5; margin-top: 12px; min-height: 18px; }
.gate-msg.err { color: var(--red); } .gate-msg.warn { color: var(--gold); }
.gate-msg ul { text-align: left; margin: 6px 0 0 18px; } .gate-msg li { margin-bottom: 2px; }
