:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-sidebar: #1e293b;
    --bg-app: #e2e8f0;
    --text-sidebar: #94a3b8;
    --text-main: #334155;
    --border: #cbd5e1;
}

body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background-color: var(--bg-sidebar);
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
}

.brand {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 40px;
    color: white;
}

.doc-info label, .control-group label {
    font-size: 0.8rem;
    color: var(--text-sidebar);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.doc-info h3 {
    margin-top: 5px;
    font-weight: 500;
}

.badge {
    background: #f59e0b;
    color: black;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

hr {
    border: 0;
    border-top: 1px solid #334155;
    width: 100%;
    margin: 30px 0;
}

.control-group select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    background: #334155;
    border: 1px solid #475569;
    color: white;
    border-radius: 6px;
}

.control-group small {
    color: var(--text-sidebar);
    font-size: 0.75rem;
    display: block;
    margin-top: 5px;
}

.actions {
    margin-top: auto;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    width: 100%;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
}

.btn-primary:hover { background-color: var(--primary-hover); }
.btn-primary:disabled { background-color: #64748b; cursor: not-allowed; }

.btn-secondary {
    background-color: transparent;
    border: 1px solid #94a3b8;
    color: #334155;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-text {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    text-decoration: underline;
}

/* PDF Viewer */
.pdf-viewer-container {
    flex: 1;
    background-color: var(--bg-app);
    overflow-y: auto;
    display: flex;
    justify-content: center;
    padding: 40px;
}

#pdf-wrapper {
    position: relative; /* Importante para o posicionamento da assinatura */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* A assinatura sobreposta */
.signature-img {
    position: absolute;
    bottom: 150px; /* Posição fixa exemplo */
    right: 100px;  /* Posição fixa exemplo */
    width: 200px;
    height: auto;
    z-index: 10;
    mix-blend-mode: multiply; /* Faz o fundo branco da assinatura "sumir" no papel */
    border: 2px dashed var(--primary); /* Feedback visual */
}

.hidden { display: none !important; }

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    width: 550px;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.close-modal {
    font-size: 1.5rem;
    cursor: pointer;
}

.canvas-wrapper {
    border: 2px dashed #cbd5e1;
    background-color: #f8fafc;
    border-radius: 4px;
    cursor: crosshair;
}

/* Cert List */
.cert-list {
    list-style: none;
    padding: 0;
}

.cert-item {
    border: 1px solid var(--border);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cert-item:hover, .cert-item.selected {
    border-color: var(--primary);
    background-color: #eef2ff;
}

/* PIN Input */
.pin-display {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    justify-content: center;
    margin: 20px 0;
}

.pin-display input {
    font-size: 1.5rem;
    width: 150px;
    padding: 5px;
    text-align: center;
    letter-spacing: 5px;
}

/* Sucesso */
.success-animation {
    color: #10b981;
    font-size: 4rem;
    text-align: center;
    margin: 20px 0;
}

#step-success p { text-align: center; font-size: 1.2rem; }