:root {
    --bg:       #0f1117;
    --surface:  #1a1d27;
    --surface2: #22263a;
    --border:   #2e3350;
    --accent:   #5865f2;
    --accent-h: #4752c4;
    --green:    #57f287;
    --red:      #ed4245;
    --text:     #e3e5ea;
    --muted:    #8b8fa8;
    --radius:   12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────── */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
}
.header-inner {
    max-width: 860px;
    margin: 0 auto;
}
.logo {
    display: flex;
    align-items: center;
    gap: 14px;
}
.logo-icon { font-size: 2rem; }
.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}
.logo p { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }

/* ── Pix Banner ─────────────────────────────────────────── */
.pix-banner {
    background: linear-gradient(90deg, #1a2a1a, #1e2e1e);
    border-bottom: 1px solid #2a4a2a;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: #9de89d;
}
.pix-key {
    background: #0d1f0d;
    border: 1px solid #3a6a3a;
    padding: 3px 10px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--green);
    cursor: pointer;
    user-select: all;
}
.pix-key:hover { background: #142814; }

/* ── Main ───────────────────────────────────────────────── */
main {
    flex: 1;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ── How it works ───────────────────────────────────────── */
.how-it-works h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.step {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.step p { font-size: 0.9rem; line-height: 1.5; color: var(--text); }
.note {
    font-size: 0.825rem;
    color: var(--muted);
    line-height: 1.6;
}
.note code { background: var(--surface2); padding: 1px 5px; border-radius: 4px; font-size: 0.8rem; }

/* ── Converter ──────────────────────────────────────────── */
.converter {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    padding: 48px 24px;
}
.dropzone:hover, .dropzone.drag-over {
    border-color: var(--accent);
    background: var(--surface2);
}
.dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.drop-icon { font-size: 2.5rem; }
.drop-text { font-size: 1rem; font-weight: 500; }
.drop-sub { font-size: 0.85rem; color: var(--muted); }

.progress-msg {
    text-align: center;
    color: var(--muted);
    font-size: 0.875rem;
    padding: 4px 0;
}

.progress-bar-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.progress-bar-track {
    width: 100%;
    height: 6px;
    background: var(--surface2);
    border-radius: 99px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 99px;
    transition: width 0.3s ease;
}
.progress-bar-label {
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
}

.status {
    border-radius: var(--radius);
    padding: 14px 18px;
    font-size: 0.9rem;
    line-height: 1.5;
}
.status.success {
    background: #0d1f17;
    border: 1px solid #2a5a3a;
    color: #7de8a8;
}
.status.error {
    background: #1f0d0d;
    border: 1px solid #5a2a2a;
    color: #ed8a8a;
}

.download-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.btn-download {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-download:hover { background: var(--accent-h); }

.download-hint {
    font-size: 0.825rem;
    color: var(--muted);
    text-align: center;
}
.download-hint code { background: var(--surface2); padding: 1px 5px; border-radius: 4px; }

/* ── Info box ───────────────────────────────────────────── */
.info-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
}
.info-box h3 { font-size: 0.95rem; margin-bottom: 12px; }
.tree {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.7;
    white-space: pre;
    overflow-x: auto;
}

/* ── Seção AES ──────────────────────────────────────────────── */
.aes-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.aes-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    cursor: pointer;
    font-size: 0.95rem;
    list-style: none;
    user-select: none;
}
.aes-summary::-webkit-details-marker { display: none; }
.aes-badge {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 99px;
    background: var(--surface2);
    color: var(--muted);
    border: 1px solid var(--border);
}
.aes-body {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-top: 1px solid var(--border);
}
.aes-explain {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--muted);
    padding-top: 14px;
}
.aes-explain strong { color: var(--text); }
.aes-explain code { background: var(--surface2); padding: 1px 5px; border-radius: 4px; font-size: 0.8rem; }
.dropzone-exe { padding: 28px 24px; }
.exe-status {
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 0.875rem;
}
.exe-status.success { background:#0d1f17; border:1px solid #2a5a3a; color:#7de8a8; }
.exe-status.error   { background:#1f0d0d; border:1px solid #5a2a2a; color:#ed8a8a; }
.exe-status.loading { background:var(--surface2); border:1px solid var(--border); color:var(--muted); }
.dropzone.done { border-color: var(--green); }

/* ── Footer ─────────────────────────────────────────────── */
footer {
    border-top: 1px solid var(--border);
    padding: 20px 24px;
    font-size: 0.8rem;
    color: var(--muted);
}
.footer-inner {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}
footer a { color: var(--muted); text-decoration: underline; }
footer a:hover { color: var(--text); }

/* ── Responsivo ─────────────────────────────────────────── */
@media (max-width: 600px) {
    .steps { grid-template-columns: 1fr; }
    .pix-banner { font-size: 0.8rem; }
}
