/* Desenvolvido pelo Sr. Engenheiro João */
/* Compressão PDF — tema SaaS minimalista, PT-PT */

:root {
    --bg0: #070a10;
    --bg1: #0c111c;
    --panel: rgba(18, 24, 38, 0.55);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text: #e8ecf5;
    --muted: #94a0b8;
    --accent: #5b8cff;
    --accent2: #7c5cff;
    --ok: #3dd68c;
    --warn: #f5b14a;
    --err: #ff6b7a;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

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

html {
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    background: radial-gradient(1200px 600px at 10% -10%, rgba(91, 140, 255, 0.12), transparent 55%),
        radial-gradient(900px 500px at 90% 0%, rgba(124, 92, 255, 0.1), transparent 50%),
        linear-gradient(165deg, var(--bg0), var(--bg1));
    color: var(--text);
    line-height: 1.5;
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, black, transparent);
    pointer-events: none;
    z-index: 0;
}

.glow {
    position: fixed;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

.glow-a {
    top: -120px;
    left: 10%;
    background: var(--accent);
}

.glow-b {
    bottom: -160px;
    right: 5%;
    background: var(--accent2);
}

.site-header {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.25rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
    line-height: 0;
}

.brand-mark .brand-logo {
    display: block;
    height: clamp(3.5rem, 12vw, 6.25rem);
    width: auto;
    max-width: min(22rem, 88vw);
    object-fit: contain;
}

.brand-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.brand-sub {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--panel-border);
}

.pill-soft {
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
}

.shell {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.25rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alert {
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(14px);
    background: rgba(18, 24, 38, 0.65);
}

.alert-warn {
    border-color: rgba(245, 177, 74, 0.35);
    background: rgba(245, 177, 74, 0.08);
    color: #ffe7c2;
}

.alert-ok {
    border-color: rgba(61, 214, 140, 0.35);
    color: #c9ffe8;
}

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

.panel {
    border-radius: var(--radius);
    border: 1px solid var(--panel-border);
    background: var(--panel);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.drop-panel {
    padding: 2rem 1.5rem;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.drop-panel.is-dragover {
    border-color: rgba(91, 140, 255, 0.55);
    background: rgba(91, 140, 255, 0.08);
    transform: translateY(-1px);
}

.drop-inner {
    text-align: center;
}

.drop-icon {
    color: var(--accent);
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.drop-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.drop-hint {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.linkish {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.linkish:hover {
    color: #8fb4ff;
}

.controls-panel {
    padding: 1.25rem 1.35rem 1.35rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: stretch;
}

.row-actions {
    margin-top: 1rem;
    align-items: center;
}

.quality-fieldset {
    border: none;
    margin: 0;
    padding: 0;
    flex: 1;
    min-width: min(100%, 280px);
}

.legend {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.65rem;
}

.seg {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.5rem;
}

.seg-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.seg-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.seg-item span {
    font-weight: 600;
    font-size: 0.9rem;
}

.seg-item small {
    color: var(--muted);
    font-size: 0.72rem;
}

.seg-item:has(input:checked) {
    border-color: rgba(91, 140, 255, 0.55);
    background: rgba(91, 140, 255, 0.1);
}

.seg-item:hover {
    border-color: rgba(255, 255, 255, 0.18);
}

.btn {
    font: inherit;
    cursor: pointer;
    border-radius: 12px;
    padding: 0.65rem 1.1rem;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.92rem;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #3d6dff);
    color: #fff;
    box-shadow: 0 10px 30px rgba(91, 140, 255, 0.35);
}

.btn-primary:not(:disabled):hover {
    transform: translateY(-1px);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--panel-border);
    color: var(--text);
}

.btn-ghost:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.09);
}

.btn-icon {
    padding: 0.45rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--panel-border);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.progress-wrap {
    margin-top: 1rem;
}

.progress-label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.progress-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent2), var(--accent));
    transition: width 0.25s ease;
}

.list-panel {
    padding: 1rem 1.1rem 1.25rem;
}

.list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.list-title {
    margin: 0;
    font-size: 1rem;
}

.list-count {
    font-size: 0.8rem;
    color: var(--muted);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--panel-border);
}

.file-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.03);
    animation: rowIn 0.35s ease both;
}

@keyframes rowIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.file-main {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    flex: 1;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.file-row[data-state="ready"] .status-dot {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.2);
}

.file-row[data-state="compressing"] .status-dot {
    background: var(--warn);
    animation: pulse 1s ease infinite;
}

.file-row[data-state="done"] .status-dot {
    background: var(--ok);
    box-shadow: 0 0 0 4px rgba(61, 214, 140, 0.2);
}

.file-row[data-state="error"] .status-dot {
    background: var(--err);
}

@keyframes pulse {
    50% {
        opacity: 0.45;
    }
}

.file-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.empty-hint {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.empty-hint[hidden] {
    display: none;
}

.foot-note {
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
    padding: 0.5rem 0 0;
}

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

code {
    font-size: 0.85em;
    padding: 0.1em 0.35em;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
}

@media (max-width: 560px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .row-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}
