:root {
    --navy: #1B2B4B;
    --gold: #C9A84C;
    --bg: #F4F5F7;
    --text: #1B2B4B;
    --white: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.topbar {
    background: var(--navy);
    color: var(--white);
    padding: 1rem 1.5rem;
}

.brand { font-size: 1.25rem; letter-spacing: .02em; }
.brand strong { color: var(--gold); }

.container {
    max-width: 420px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.card {
    background: var(--white);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(27, 43, 75, .08);
    border-top: 4px solid var(--gold);
}

h1 { font-size: 1.35rem; margin: 0 0 1.5rem; color: var(--navy); }

label { display: block; font-size: .85rem; margin-bottom: .3rem; color: #555; }

input[type=text], input[type=email], input[type=password] {
    width: 100%;
    padding: .6rem .7rem;
    margin-bottom: 1rem;
    border: 1px solid #d4d7dd;
    border-radius: 6px;
    font-size: 1rem;
}

button {
    width: 100%;
    padding: .7rem;
    background: var(--navy);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}

button:hover { background: #142038; }

.erro {
    background: #fdecea;
    color: #a4373a;
    padding: .6rem .8rem;
    border-radius: 6px;
    font-size: .85rem;
    margin-bottom: 1rem;
}

.hint { font-size: .8rem; color: #777; margin-top: -0.5rem; margin-bottom: 1rem; }

.qr-wrap { text-align: center; margin-bottom: 1rem; }
.qr-wrap img { width: 200px; height: 200px; }

.secret {
    font-family: monospace;
    word-break: break-all;
    background: #f0f1f4;
    padding: .5rem;
    border-radius: 6px;
    font-size: .85rem;
    text-align: center;
    margin-bottom: 1rem;
}

.painel-header { display: flex; justify-content: space-between; align-items: center; }
.logout-link { color: var(--gold); text-decoration: none; font-size: .85rem; }

.container-wide {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.container-viewer {
    max-width: 720px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

h2 { font-size: 1.05rem; margin: 0 0 1rem; color: var(--navy); }

.btn, .btn-secondary {
    display: inline-block;
    text-decoration: none;
    border-radius: 6px;
    font-size: .9rem;
    cursor: pointer;
    padding: .55rem 1rem;
    border: none;
}

.btn { background: var(--navy); color: var(--white); }
.btn:hover { background: #142038; }

.btn-secondary {
    background: var(--bg);
    color: var(--navy);
    border: 1px solid #d4d7dd;
    margin-right: .4rem;
}
.btn-secondary:hover { background: #e8e9ed; }

.tabela { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabela th, .tabela td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid #ececf0; }
.tabela tbody tr { cursor: pointer; }
.tabela tbody tr:hover { background: #f8f9fb; }

.mono { font-family: monospace; font-size: .85rem; }

.badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    background: #eef0f4;
    color: var(--navy);
    text-transform: capitalize;
}
.badge-assinada { background: #e3f5e8; color: #1e7a3a; }
.badge-expirada, .badge-cancelada, .badge-recusada { background: #fdecea; color: #a4373a; }
.badge-visualizada, .badge-em_assinatura { background: #fff3d6; color: #8a6300; }

.fieldset { border: 1px solid #e0e2e7; border-radius: 6px; padding: 1rem; margin-bottom: 1rem; }
.fieldset legend { padding: 0 .4rem; font-size: .85rem; color: #555; }
.check { display: flex; align-items: center; gap: .4rem; font-size: .9rem; margin-bottom: .5rem; }
.check input { width: auto; margin: 0; }

.signer-row {
    position: relative;
    border: 1px solid #ececf0;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: .75rem;
}
.remove-signer {
    position: absolute;
    top: .5rem;
    right: .5rem;
    background: none;
    border: none;
    color: #a4373a;
    font-size: 1.1rem;
    cursor: pointer;
    width: auto;
    padding: 0 .3rem;
}

.signer-card { border: 1px solid #ececf0; border-radius: 6px; padding: 1rem; margin-bottom: 1rem; }
.link-box { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .5rem; }
.link-box input { flex: 1; min-width: 200px; margin-bottom: 0; font-size: .8rem; font-family: monospace; }

.pdf-wrap { margin: 1rem 0; }
.pdf-wrap iframe { width: 100%; height: 70vh; border: 1px solid #d4d7dd; border-radius: 6px; }

input[type=number], input[type=file] {
    width: 100%;
    padding: .6rem .7rem;
    margin-bottom: 1rem;
    border: 1px solid #d4d7dd;
    border-radius: 6px;
    font-size: 1rem;
}

.destaque-lgpd {
    background: #fdf8ec;
    border: 1px solid var(--gold);
    border-radius: 6px;
    padding: .9rem 1rem;
    margin-bottom: 1rem;
    font-size: .85rem;
}
.destaque-lgpd p { margin: 0 0 .5rem; }
.destaque-lgpd p:last-child { margin-bottom: 0; }

.etapa { scroll-margin-top: 1rem; }

#selfie-video, #selfie-preview { max-height: 60vh; object-fit: cover; }

#assinatura-canvas { cursor: crosshair; display: block; }

