:root {
    --color-bg: #f5f7fb;
    --color-white: #ffffff;
    --color-border: #e2e6f0;
    --color-text: #1f2933;
    --color-muted: #6b7280;
    --color-primary: #4f46e5;
    --color-primary-dark: #4338ca;
    --color-success: #0f9d58;
    --shadow-lg: 0 20px 45px rgba(15, 20, 40, 0.1);
    --shadow-sm: 0 6px 18px rgba(39, 44, 75, 0.08);
}

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

body {
    font-family: "Inter", "Segoe UI", "Helvetica Neue", sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.validation-page {
    width: 100%;
    max-width: 960px;
    margin: 40px 16px;
    background: var(--color-white);
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.validation-header {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #eef2ff;
    padding: 32px;
}

.validation-header .brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.validation-header img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    padding: 8px;
}

.validation-header h1 {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.validation-page main {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 32px;
}

.validation-form-section,
.validation-result {
    background: var(--color-white);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.validation-form-section h2 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: #111827;
}

.validation-form-section .muted {
    color: var(--color-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.validation-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.validation-form label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
}

.validation-form input {
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.validation-form input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.validation-form button {
    background: linear-gradient(135deg, #4f46e5, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.validation-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.2);
}

.alert {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
}

.alert-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.validation-result header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.validation-result header strong {
    font-size: 1.1rem;
}

.badge {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge.success {
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
}

.result-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 16px;
}

.result-grid article {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 16px;
}

.result-grid h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: #1f2937;
}

.result-grid p {
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.validation-note {
    margin-top: 16px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 16px;
    background: #f8fafc;
}

.validation-note p {
    margin-bottom: 8px;
    color: var(--color-text);
}

.validation-note .muted {
    color: var(--color-muted);
    font-size: 0.9rem;
}

.validation-footer {
    padding: 18px;
    text-align: center;
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    font-size: 0.95rem;
    color: var(--color-muted);
}

.document-display {
    background: var(--color-white);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.document-display header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--color-border);
}

.document-display header h2 {
    font-size: 1.2rem;
    color: var(--color-text);
}

.document-actions {
    display: flex;
    gap: 12px;
}

.document-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-print {
    background: linear-gradient(135deg, #4f46e5, #3b82f6);
    color: #fff;
}

.btn-print:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.2);
    color: #fff;
}

.btn-pdf {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
}

.btn-pdf:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(220, 38, 38, 0.2);
    color: #fff;
}

.document-actions .btn svg {
    width: 16px;
    height: 16px;
}

.document-content {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 32px;
    overflow-x: auto;
}

/* Estilos para o conteúdo do documento renderizado */
.document-content .document {
    max-width: 100%;
    margin: 0 auto;
}

/* Ajustes para impressão */
@media print {
    .validation-header,
    .validation-form-section,
    .validation-result,
    .document-display header,
    .document-actions {
        display: none;
    }

    .document-display {
        border: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
    }

    .document-content {
        border: none;
        padding: 0;
    }
}

@media (max-width: 768px) {
    .validation-page {
        margin: 24px 16px;
    }

    .validation-header {
        padding: 24px;
    }

    .validation-header .brand {
        flex-direction: column;
        align-items: flex-start;
    }

    .validation-page main {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .document-display header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .document-content {
        padding: 20px;
    }
}

