/* =====================================================================
   ADVOPACK — Compactador de Imagens
   ---------------------------------------------------------------------
   IDENTIDADE VISUAL: todas as cores, fontes e raios ficam nas variáveis
   abaixo. Para adaptar ao padrão oficial da ADVOPACK, basta trocar os
   valores de :root — o resto do arquivo usa apenas essas variáveis.
   ===================================================================== */

:root {
    /* Cores da marca (SUBSTITUA pelas cores oficiais da ADVOPACK) */
    --brand:          #0b2a4a;  /* cor principal (cabeçalho, títulos) */
    --brand-dark:     #071c33;  /* tom mais escuro */
    --brand-soft:     #e8eef6;  /* tom bem claro da cor principal */
    --accent:         #f26a1b;  /* cor de destaque (botões, links) */
    --accent-dark:    #d65a10;
    --accent-soft:    #fff1e8;

    /* Neutros e estados */
    --bg:             #f4f6f9;
    --surface:        #ffffff;
    --text:           #1b2635;
    --text-muted:     #5b6b7f;
    --border:         #dbe2eb;
    --success:        #14804a;
    --success-soft:   #e6f6ed;
    --warning:        #9a5b00;
    --warning-soft:   #fff4de;
    --danger:         #c0342b;
    --danger-soft:    #fdeceb;

    /* Forma e tipografia */
    --font:           'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --radius:         12px;
    --radius-sm:      8px;
    --shadow:         0 1px 2px rgba(11, 42, 74, .06), 0 8px 24px rgba(11, 42, 74, .08);
    --maxw:           960px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
}

img { max-width: 100%; display: block; }
a { color: var(--accent-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid rgba(242, 106, 27, .55); outline-offset: 2px; }

/* ---------- Cabeçalho ---------- */
.topbar { background: var(--brand); }
.topbar__inner {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 68px; gap: 16px;
}
.brand img { height: 36px; width: auto; }
.topbar__link {
    color: #fff; text-decoration: none; font-weight: 500; font-size: .95rem;
    padding: 8px 14px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px;
    transition: background .15s;
}
.topbar__link:hover { background: rgba(255, 255, 255, .12); }

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    padding: 48px 0 96px;
}
.eyebrow {
    display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .14em;
    text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.hero h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -.02em; }
.hero__lead { margin-top: 14px; max-width: 600px; font-size: 1.1rem; color: rgba(255, 255, 255, .85); }
.hero__lead strong { color: #fff; }

/* ---------- Cartão principal ---------- */
.tool { margin-top: -64px; position: relative; }

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}

.step { display: flex; gap: 18px; }
.step__num {
    flex: 0 0 34px; height: 34px; border-radius: 50%;
    background: var(--brand); color: #fff; font-weight: 700;
    display: grid; place-items: center; margin-top: 2px;
}
.step__body { flex: 1; min-width: 0; }
.step__title { font-size: 1.2rem; font-weight: 700; color: var(--brand); }
.step__hint { color: var(--text-muted); margin-top: 4px; font-size: .95rem; }

.divider { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }

/* ---------- Campos ---------- */
.size-row { display: flex; gap: 10px; margin-top: 16px; max-width: 320px; }
.field { flex: 1; }
.field:last-child { flex: 0 0 96px; }

input[type="number"], select {
    width: 100%; height: 50px; padding: 0 14px;
    font: inherit; font-size: 1.1rem; font-weight: 600; color: var(--text);
    background: #fff; border: 2px solid var(--border); border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s;
}
input[type="number"]:focus, select:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(242, 106, 27, .15);
}
input.is-invalid { border-color: var(--danger); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
    font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
    padding: 7px 14px; border-radius: 999px;
    color: var(--brand); background: var(--brand-soft); border: 1px solid transparent;
    transition: background .15s, color .15s;
}
.chip:hover { background: #d7e2f0; }
.chip.is-active { background: var(--brand); color: #fff; }

.field-error { margin-top: 10px; color: var(--danger); font-size: .92rem; font-weight: 500; }
[hidden] { display: none !important; }

.options { margin-top: 22px; display: grid; gap: 14px; }
.check { display: flex; gap: 12px; cursor: pointer; align-items: flex-start; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.check strong { display: block; font-weight: 600; }
.check small { display: block; color: var(--text-muted); font-size: .88rem; line-height: 1.45; }

/* ---------- Área de envio ---------- */
.dropzone {
    margin-top: 16px; padding: 34px 20px; text-align: center; cursor: pointer;
    border: 2px dashed #b9c6d8; border-radius: var(--radius); background: #fafcfe;
    transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone__icon { margin: 0 auto 8px; color: var(--accent); }
.dropzone__title { font-weight: 700; font-size: 1.1rem; color: var(--brand); }
.dropzone__sub { color: var(--text-muted); margin-top: 2px; }
.dropzone__sub .link { color: var(--accent-dark); font-weight: 600; text-decoration: underline; }
.dropzone__meta { margin-top: 10px; font-size: .85rem; color: var(--text-muted); }

/* ---------- Lista de arquivos ---------- */
.files { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }

.file {
    display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center;
    padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff;
}
.file.is-done  { border-color: #b8e2c9; background: #fbfefc; }
.file.is-error { border-color: #f0b9b5; background: #fffafa; }

.file__thumb { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--brand-soft); }
.file__info { min-width: 0; }
.file__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file__meta { font-size: .88rem; color: var(--text-muted); margin-top: 2px; }
.file__meta strong { color: var(--text); }
.file__saved {
    display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
    background: var(--success-soft); color: var(--success); font-weight: 700; font-size: .8rem;
}
.file__note { margin-top: 4px; font-size: .84rem; color: var(--warning); }
.file__note--info { color: var(--text-muted); }
.file__error { margin-top: 4px; font-size: .88rem; color: var(--danger); font-weight: 500; }

.file__actions { display: flex; gap: 6px; align-items: center; }

.progress { height: 6px; border-radius: 999px; background: var(--brand-soft); margin-top: 8px; overflow: hidden; }
.progress__bar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.progress.is-indeterminate .progress__bar { width: 40%; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* ---------- Botões ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: inherit; font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none;
    padding: 0 22px; height: 48px; border-radius: var(--radius-sm); border: 2px solid transparent;
    transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn--secondary { background: var(--brand); color: #fff; }
.btn--secondary:hover { background: var(--brand-dark); }
.btn--ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn--ghost:hover:not(:disabled) { border-color: var(--text-muted); color: var(--text); }
.btn--sm { height: 36px; padding: 0 14px; font-size: .9rem; }
.btn--download { background: var(--success); color: #fff; }
.btn--download:hover { background: #0f6a3d; }

.icon-btn {
    width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; cursor: pointer;
    color: var(--text-muted); font-size: 1.3rem; line-height: 1;
}
.icon-btn:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.summary {
    margin-top: 16px; padding: 12px 16px; border-radius: var(--radius-sm);
    background: var(--success-soft); color: var(--success); font-weight: 600;
}

.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 500; }
.alert--error { background: var(--danger-soft); color: var(--danger); border: 1px solid #f0b9b5; }

.privacy { text-align: center; color: var(--text-muted); font-size: .9rem; margin-top: 18px; }

/* ---------- Informações ---------- */
.info { padding-top: 48px; padding-bottom: 56px; }
.info__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info__item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.info__item h3 { font-size: 1.05rem; color: var(--brand); margin-bottom: 8px; }
.info__item p { color: var(--text-muted); font-size: .95rem; }

/* ---------- Rodapé ---------- */
.footer { background: var(--brand-dark); color: rgba(255, 255, 255, .75); font-size: .9rem; }
.footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 22px; padding-bottom: 22px; }
.footer a { color: #fff; text-decoration: none; font-weight: 600; }
.footer a:hover { color: var(--accent); }

/* ---------- Responsivo ---------- */
@media (max-width: 760px) {
    .info__grid { grid-template-columns: 1fr; }
    .card { padding: 20px 16px; }
    .step { gap: 12px; }
    .hero { padding: 36px 0 84px; }
    .file { grid-template-columns: 48px 1fr; }
    .file__thumb { width: 48px; height: 48px; align-self: start; }
    .file__actions { grid-column: 1 / -1; justify-content: flex-end; }
    .actions .btn { flex: 1 1 100%; }
}

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