/* ========================================
   FormaText — Light Theme CSS
   Clean, white, professional — paper feel
   ======================================== */

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --blue-600: #2563eb;
    --blue-500: #3b82f6;
    --blue-100: #dbeafe;
    --blue-50: #eff6ff;
    --purple-600: #7c3aed;
    --purple-100: #ede9fe;
    --amber-600: #d97706;
    --amber-100: #fef3c7;
    --green-600: #16a34a;
    --green-100: #dcfce7;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);
    --radius: 10px;
    --radius-lg: 16px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--gray-800);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 7px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 99px;
}

::selection {
    background: rgba(37, 99, 235, 0.15);
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes progressFill {
    0% {
        width: 0;
    }

    30% {
        width: 35%;
    }

    60% {
        width: 65%;
    }

    90% {
        width: 92%;
    }

    100% {
        width: 100%;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes bounceDown {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(5px);
    }
}

@keyframes pulseRing {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35);
    }

    70% {
        box-shadow: 0 0 0 14px rgba(37, 99, 235, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

/* ===========================================================
   WELCOME OVERLAY
   =========================================================== */
.welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.3s ease-out;
}

.welcome-overlay.hidden {
    display: none;
}

.welcome-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
}

.welcome-box {
    position: relative;
    width: 100%;
    max-width: 560px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: fadeInUp 0.4s ease-out;
}

.welcome-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
}

.welcome-close:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.welcome-content {
    padding: 40px 32px 32px;
    text-align: center;
}

.welcome-brand {
    margin-bottom: 24px;
}

.welcome-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--blue-50);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-brand h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--gray-900);
}

.welcome-brand h2 span {
    color: var(--blue-600);
}

.welcome-brand p {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 6px;
}

.welcome-enter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 13px 32px;
    background: var(--blue-600);
    color: white;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.welcome-enter-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ===========================================================
   HEADER
   =========================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--gray-900);
}

.logo-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--blue-600), #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.logo-text {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.logo-text strong {
    font-weight: 800;
    color: var(--blue-600);
}

.header-nav {
    display: flex;
    gap: 4px;
}

.header-nav a {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
}

.header-nav a:hover {
    color: var(--blue-600);
    background: var(--blue-50);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    padding-left: 16px;
    border-left: 1px solid var(--gray-200);
}

/* --- New Diagnostic Modal Single Layout --- */
.diag-single-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
}

.diag-col-info {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
    background: linear-gradient(to bottom, #fff, #fef2f2);
    border-radius: 16px;
    border: 1px solid #fee2e2;
    height: 100%;
    box-sizing: border-box;
}

.diag-col-info .diag-norm-selection {
    margin-bottom: 0;
    background: rgba(255,255,255,0.7);
}

.diag-col-action {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (max-width: 680px) {
    .diag-single-container {
        grid-template-columns: 1fr;
    }
    .modal-box--diagnostic {
        max-height: 95vh;
    }
}

.diag-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.diag-column--ai {
    background: linear-gradient(to bottom, #fff, #fef2f2);
    border-color: #fee2e2;
    position: relative;
    overflow: hidden;
}

.diag-column--ai::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at top right, rgba(239, 68, 68, 0.05), transparent);
    pointer-events: none;
}

.diag-column:hover {
    border-color: #fca5a5;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.diag-column-header {
    margin-bottom: 12px;
}

.diag-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}



.diag-badge--ai {
    background: #fee2e2;
    color: #b91c1c;
}

.diag-column h4 {
    font-size: 18px;
    color: #1e293b;
    margin-bottom: 8px;
    font-weight: 700;
}

.diag-column p {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}



.diag-upload-box {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.diag-upload-box:hover {
    border-color: var(--blue-500);
    background: #f0f9ff;
}

.diag-column--ai .diag-upload-box:hover {
    border-color: #ef4444;
    background: #fffaf0;
}

.upload-icon {
    font-size: 32px;
}

.diag-upload-box span {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.diag-benefits {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.diag-benefits li {
    font-size: 13px;
    color: #334155;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.diag-legal-box-mini {
    background: #fff;
    border: 1px solid #f1f5f9;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.diag-checkbox-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.diag-checkbox-row input {
    margin-top: 3px;
}

.diag-checkbox-row label {
    font-size: 11px;
    line-height: 1.4;
    color: #64748b;
    cursor: pointer;
}

.file-info-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f1f5f9;
    border-radius: 8px;
    margin-bottom: 15px;
}

.file-info-mini span {
    font-size: 12px;
    color: #1e293b;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

/* Response for Mobile */
@media (max-width: 768px) {
    .diag-column {
        max-width: 100% !important;
    }
}

/* Score Dashboard Adjustment inside Modal */
.score-dashboard--modal {
    margin: 20px 0;
    padding: 30px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
}

#diag-results-area {
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.lang-btn {
    background: transparent;
    border: 2px solid transparent;
    width: 36px;
    height: 36px;
    padding: 0;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.5;
    filter: grayscale(0.5);
}

.lang-btn:hover {
    background: var(--gray-100);
    opacity: 1;
    filter: grayscale(0);
}

.lang-btn.active {
    background: var(--blue-50);
    border-color: var(--blue-200);
    opacity: 1;
    filter: grayscale(0);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

.flag-icon {
    line-height: 1;
}

@media (max-width: 768px) {
    .nav-links {
        gap: 16px;
    }

    .lang-switcher {
        margin-left: 0;
        padding-left: 12px;
    }

    .lang-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}



/* ===========================================================
   TOOL SECTION (Screen 1 & 2)
   =========================================================== */
.tool-section {
    margin-top: 40px; /* Natural space for Auto Ads AND Score Button to breathe */
    animation: fadeInUp 0.5s ease-out;
}

.tool-section.hidden {
    display: none;
}

.tool-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 20px 40px;
}

#screen-input .tool-container {
    padding-bottom: 0px;
}

/* Title Bar (legacy - still used inside tool-layout) */
.tool-title-bar {
    background: var(--blue-600);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 14px 24px;
    text-align: center;
}

/* Full-width Input Banner (matches result-banner layout) */
.input-banner {
    background: var(--blue-600);
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 56px;
    z-index: 90;
    margin-bottom: 20px;
}

.input-banner-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    position: relative;
}

.input-banner-title-col {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    padding-left: 25px;
}



.input-banner h1 {
    font-size: 26px;
    font-weight: 900;
    margin: 0;
    color: white;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-banner h1 strong {
    color: #facc15;
}

.tool-title-bar h1,
.tool-title-bar h2 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tool-title-bar h1 strong,
.tool-title-bar h2 strong {
    font-weight: 800;
    color: #fde68a;
}

.tool-title-icon {
    font-size: 20px;
}

.tool-title-bar--green {
    background: var(--green-600);
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* Layout */
.tool-layout {
    display: flex;
    gap: 0;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--white);
}

/* Textarea */
.tool-textarea-col {
    flex: 1;
    min-width: 0;
}

.textarea-wrapper {
    height: 100%;
    position: relative;
}

.textarea-placeholder-overlay {
    position: absolute;
    inset: 0;
    padding: 24px;
    /* Matches textarea padding */
    pointer-events: none;
    user-select: none;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.textarea-cursor-indicator {
    position: absolute;
    top: 24px;
    left: 24px;
    width: 2px;
    height: 24px;
    background: #9ca3af;
    animation: blink-caret 1s step-end infinite;
    display: flex;
    align-items: center;
}

.cursor-message {
    position: absolute;
    top: 24px;
    left: 36px;
    /* 24px cursor + some gap */
    white-space: nowrap;
    font-size: 15px;
    color: #9ca3af;
    font-weight: 500;
    opacity: 0.8;
    letter-spacing: -0.01em;
    pointer-events: none;
    line-height: 24px;
}

@keyframes blink-caret {

    from,
    to {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

/* Hide overlay when textarea is NOT showing placeholder (meaning it has content) */
.textarea-field:not(:placeholder-shown)~.textarea-placeholder-overlay {
    opacity: 0;
    visibility: hidden;
    display: none;
}

.title-hint-box {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--white);
    padding: 16px 24px;
    border-radius: 12px;
    border: 1.5px dashed #ef4444;
    opacity: 0.6;
}

.title-hint-graphic {
    width: 60px;
    height: 72px;
}

.title-hint-box p {
    font-size: 16px;
    color: var(--gray-700);
    line-height: 1.4;
    text-align: left;
    margin: 0;
}

.title-hint-box p strong {
    color: #ef4444;
    font-weight: 800;
}

.textarea-sub-placeholder {
    font-size: 14px;
    color: var(--gray-400);
    line-height: 1.6;
    font-weight: 500;
    opacity: 0.6;
}

/* Conteúdo de dicas restaurado (apenas sem a borda tracejada) */
.hint-main-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    width: 95%;
    max-width: fit-content;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.9);
    padding: 32px;
    border-radius: 20px;
    /* Retângulo tracejado removido conforme solicitado */
}

.hint-visual {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hint-image-placeholder {
    max-width: 200px;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.hint-list {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hint-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.hint-bullet {
    color: var(--blue-600);
    font-size: 18px;
    line-height: 1.2;
}

.hint-item p {
    font-size: 15px;
    color: var(--gray-700);
    line-height: 1.5;
    margin: 0;
    text-align: left;
}

@media (max-width: 768px) {
    .hint-main-content {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
        width: 100%;
    }
    .hint-visual {
        min-width: unset;
    }
}



.disclaimer-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 0;
    opacity: 0.9;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto 0 auto;
}

.disclaimer-icon {
    font-size: 22px;
    flex-shrink: 0;
    margin-top: 2px;
}

.disclaimer-text {
    font-size: 15px;
    color: var(--gray-600);
    line-height: 1.6;
    margin: 0 !important;
    text-align: center;
    font-style: italic;
    white-space: nowrap;
}

.textarea-field {
    width: 100%;
    height: 100%;
    min-height: 420px;
    padding: 24px;
    border: none;
    outline: none;
    resize: vertical;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.75;
    color: var(--gray-800);
    background: transparent;
    position: relative;
    z-index: 2;
}

.textarea-field::placeholder {
    color: transparent;
    /* We use our custom overlay instead */
}

.textarea-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    font-size: 12px;
    color: var(--gray-500);
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

/* Sidebar */
.tool-sidebar {
    width: 280px;
    flex-shrink: 0;
    border-left: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.sidebar-card {
    padding: 24px 20px;
}

.sidebar-label {
    text-align: center;
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 4px;
}

.sidebar-label strong {
    color: var(--blue-600);
}

.sidebar-arrows {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    animation: bounceDown 1.8s ease-in-out infinite;
}

.sidebar-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Action Buttons */
.action-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 18px 20px;
    border-radius: var(--radius);
    border: 2px solid var(--gray-200);
    background: var(--white);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-btn-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.action-btn-text {
    display: flex;
    flex-direction: column;
}

.action-btn-text strong {
    font-size: 17px;
    color: var(--gray-900);
}

.action-btn-text small {
    font-size: 13px;
    color: var(--gray-400);
    margin-top: 3px;
}

.action-btn--blue:hover {
    border-color: var(--blue-500);
    background: var(--blue-50);
}

.action-btn--purple:hover {
    border-color: var(--purple-600);
    background: var(--purple-100);
}

.action-btn--amber:hover {
    border-color: var(--amber-600);
    background: var(--amber-100);
}

/* ---- Back & Copy buttons ---- */
.back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    color: white;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn--header {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.copy-btn--header:hover {
    background: rgba(255, 255, 255, 0.25);
}

.copy-btn--large {
    padding: 14px 36px;
    font-size: 15px;
    font-weight: 700;
    background: var(--blue-600);
    color: white;
    border-radius: var(--radius);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    animation: pulseRing 2.5s infinite;
}

.copy-btn--large:hover {
    background: #1d4ed8;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.copy-bottom-wrap {
    text-align: center;
    margin-top: 28px;
}

.copy-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 10px;
}

/* ========================================
   New Result Screen (Canva Design)
   ======================================== */

.result-banner {
    background: var(--green-600);
    color: white;
    padding: 12px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 56px;
    z-index: 90;
}

.result-banner-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.result-banner-left {
    flex: 1;
}

.result-banner-center {
    flex: 2;
    text-align: center;
}

.result-banner-right {
    flex: 3;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.result-banner-center h2 {
    font-size: 20px;
    font-weight: 900;
    margin: 0;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    /* "Floating" shadow effect */
    letter-spacing: -0.02em;
}

.result-banner-center h2 strong {
    color: #facc15;
    /* Stronger, vibrant yellow */
}

/* Banner Buttons */
.banner-back-btn {
    background: rgba(0, 0, 0, 0.2);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.banner-back-btn:hover {
    background: rgba(0, 0, 0, 0.3);
}

.action-btn-prominent {
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
    position: relative;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
}

.action-btn-prominent:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.action-btn-prominent--blue {
    background: #2563eb;
    animation: pulse-jump 2s infinite ease-in-out;
    /* Attention-grabber animation */
}

@keyframes pulse-jump {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-3px) scale(1.02);
    }
}

.action-btn-prominent--blue:hover {
    background: #1d4ed8;
    animation-play-state: paused;
    /* Pause animation on hover for better UX */
}

.action-btn-prominent--dark-blue {
    background: #1e3a8a;
}

.action-btn-prominent--dark-blue:hover {
    background: #172554;
}

.action-btn-prominent--orange {
    background: linear-gradient(135deg, #f97316, #ea580c);
    animation: pulse-jump-orange 2s infinite ease-in-out;
}

@keyframes pulse-jump-orange {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-3px) scale(1.02);
    }
}

.action-btn-prominent--orange:hover {
    background: linear-gradient(135deg, #fb923c, #f97316);
    animation-play-state: paused;
}

.action-btn-prominent--green {
    background: linear-gradient(135deg, var(--green-600), var(--green-700));
}

.action-btn-prominent--green:hover {
    background: linear-gradient(135deg, var(--green-500), var(--green-600));
}

/* ===========================================================
   PDF QUEUE STYLES
   =========================================================== */
.pdf-queue-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 6px 12px;
    margin-right: 16px;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.pdf-queue-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

.pdf-queue-count {
    color: var(--white);
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.pdf-queue-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.pdf-queue-icons {
    display: flex;
    gap: 4px;
    height: 24px;
    align-items: center;
}

.pdf-queue-icon {
    width: 20px;
    height: 24px;
    background: var(--white);
    border-radius: 3px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pdf-queue-icon::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 6px;
    background: rgba(0, 0, 0, 0.05);
    border-bottom-left-radius: 3px;
}

.pdf-queue-icon::after {
    content: 'PDF';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 6px;
    font-weight: 800;
    color: var(--amber-600);
}

.pdf-queue-icon.added-animation {
    animation: queueIconPulse 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes queueIconPulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.pdf-queue-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 16px;
}

.btn-clear-queue {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear-queue:hover {
    background: rgba(220, 38, 38, 0.8);
    transform: scale(1.1);
}

.copy-btn-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.copy-warning {
    font-size: 11px;
    margin-top: 4px;
    opacity: 0.9;
    font-weight: 500;
}

/* Two-column Layout */
.tool-container--wide {
    max-width: 1400px;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 480px;
    gap: 40px;
    align-items: start;
    margin-top: 20px;
}

.result-sidebar {
    position: sticky;
    top: 100px;
    width: 100%;
}

/* Instruction Card */
.instruction-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--green-600);
    margin-bottom: 32px;
    width: 100%;
}

.instruction-header {
    background: var(--green-600);
    color: white;
    padding: 16px;
    text-align: center;
}

.instruction-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.instruction-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.instruction-step {
    display: flex;
    align-items: center;
    gap: 16px;
}

.step-number {
    background: var(--gray-100);
    border: 2px solid var(--gray-900);
    width: 60px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 900;
    border-radius: 8px;
    position: relative;
}

/* Folded corner effect for steps */
.step-number::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    border-width: 10px;
    border-style: solid;
    border-color: white white var(--gray-900) var(--gray-900);
}

.step-text {
    flex: 1;
}

.step-text strong {
    display: block;
    font-size: 16px;
    line-height: 1.3;
    margin-bottom: 4px;
}

.step-text p {
    font-size: 14px;
    color: var(--gray-500);
    font-weight: 600;
}

.text-right {
    text-align: right;
}

/* Ebook Sidebar (matches reference design) */
.ebook-section {
    padding: 4px 0;
}

.ebook-instruction-text {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.4;
    margin: 0;
}

.ebook-instruction-link {
    margin: 4px 0 0 0;
}

.ebook-instruction-link a {
    color: var(--green-600);
    font-size: 17px;
    font-weight: 700;
    text-decoration: underline;
}

.ebook-instruction-link a:hover {
    color: var(--green-700, #15803d);
}

.ebook-visual-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.ebook-file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ebook-file-item span {
    font-size: 15px;
    font-weight: 800;
    color: var(--gray-800);
}

.pdf-file-icon {
    width: 48px;
    height: 48px;
}

.cover-file-icon {
    width: 44px;
    height: 48px;
}

.ebook-plus {
    font-weight: 900;
    font-size: 24px;
    color: var(--gray-400);
    margin: 0 2px;
    align-self: center;
}

/* Sidebar Articles */
.sidebar-articles {
    padding: 16px 24px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    margin-bottom: 24px;
}

.sidebar-articles-list {
    display: flex;
    flex-direction: column;
}

.sidebar-article-link {
    font-size: 19px;
    font-weight: 800;
    color: var(--blue-900);
    text-decoration: none;
    line-height: 1.2;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-200);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    position: relative;
    letter-spacing: -0.02em;
}

.sidebar-article-link:last-child {
    border-bottom: none;
}

.sidebar-article-link:hover {
    color: var(--blue-600);
    padding-left: 10px;
    background: linear-gradient(90deg, var(--blue-50) 0%, transparent 100%);
}

.sidebar-article-link::after {
    content: ' →';
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 1.2em;
    vertical-align: middle;
}

.sidebar-article-link:hover::after {
    opacity: 1;
    margin-left: 8px;
}



/* Global Typography Boost */
h1 {
    font-size: 32px;
}

.action-btn strong {
    font-size: 18px;
}

/* Responsive Result */
@media (max-width: 1100px) {
    .result-grid {
        grid-template-columns: 1fr;
    }

    .result-sidebar {
        position: static;
    }

    .result-banner-inner {
        flex-direction: column;
        text-align: center;
    }

    .result-banner-right {
        justify-content: center;
        width: 100%;
    }
}

/* ---- Download Buttons ---- */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.download-btn--header {
    background: var(--green-600);
    color: white;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.2);
}

.download-btn--header:hover {
    background: #15803d;
    transform: translateY(-1px);
}

.download-btn--large {
    padding: 14px 36px;
    font-size: 15px;
    font-weight: 700;
    background: var(--green-600);
    color: white;
    border-radius: var(--radius);
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
}

.download-btn--large:hover {
    background: #15803d;
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
    transform: translateY(-1px);
}

.flex-col {
    flex-direction: column;
}

.sm\:flex-row {
    display: flex;
    flex-direction: row;
}

.justify-center {
    justify-content: center;
}

.gap-4 {
    gap: 16px;
}

.ad-inline-wrap {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===========================================================
   PAPER PREVIEW
   =========================================================== */
.paper-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding-top: 8px;
}

.paper-page {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 3px;
    position: relative;
    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.06),
        0 6px 24px rgba(0, 0, 0, 0.08),
        0 16px 48px rgba(0, 0, 0, 0.04);
    animation: fadeInUp 0.5s ease-out both;
    page-break-after: always;
    /* Force PDF page break */
}

/* Styles for a clean PDF export - Forced block layout */
.pdf-export-mode {
    display: block !important;
    background: white !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 440px !important;
    visibility: visible !important;
    opacity: 1 !important;
    border: none !important;
    box-shadow: none !important;
}

.pdf-export-mode .paper-page {
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    animation: none !important;
    transition: none !important;
    page-break-after: always !important;
    page-break-inside: avoid !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}

.pdf-export-mode .page-number {
    display: none !important;
}

.paper-page .page-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: #1a1a1a;
}

.paper-page .page-number {
    position: absolute;
    bottom: 20px;
    right: 32px;
    font-size: 10px;
    color: var(--gray-400);
    font-family: 'Inter', sans-serif;
}

/* Paper sizes */
/* Paper sizes (96 DPI Standards) */
.paper-a4 {
    width: 794px;
    /* 210mm */
    max-width: 100%;
    height: 1123px;
    /* 297mm */
    padding: 96px;
    /* 1 inch approx (2.54cm) */
    overflow: hidden;
}

.paper-abnt {
    width: 794px;
    max-width: 100%;
    height: 1123px;
    /* ABNT Margins: 3cm top/left, 2cm bottom/right */
    padding: 3cm 2cm 2cm 3cm;
    overflow: hidden;
}

/* Global fallback for lists if not norm-specific */
ul {
    list-style-type: disc;
    margin-left: 1.25cm;
    padding-left: 0;
    margin-bottom: 0.8em;
}

li {
    margin-bottom: 0.5em;
    padding-left: 0.5em;
}

/* ABNT Norm List */
.paper-abnt ul {
    margin-left: 1.25cm;
    /* Bullet starts exactly at paragraph indent (1.25cm) */
    padding-left: 0;
}

.paper-abnt li {
    padding-left: 0.25cm;
    /* Small gap between bullet and text to mimic Word exactly */
    margin-bottom: 0.5em;
}

/* APA Norm List */
.paper-apa ul {
    margin-left: 0.5in;
    padding-left: 0;
}

.paper-apa li {
    padding-left: 0.25in;
    text-indent: -0.25in;
    margin-bottom: 0.5em;
}

/* IEEE Norm List (Calculated for column width) */
.paper-ieee ul {
    margin-left: 0.25in;
    padding-left: 0;
}

.paper-ieee li,
.paper-ieee .ieee-list-item {
    padding-left: 0.25in;
    text-indent: -0.25in;
    margin-bottom: 4px;
}

/* Editorial/Book List: Bullet at 1cm, Text at 1.5cm */
.paper-book-editorial ul,
.paper-ebook ul {
    margin-left: 1cm;
    padding-left: 0;
}

.paper-book-editorial li,
.paper-ebook li {
    padding-left: 0.5cm;
    text-indent: -0.5cm;
    margin-bottom: 0.5em;
}

.paper-ebook {
    width: 454px;
    max-width: 100%;
    height: 680px;
    padding: 60px 40px 60px 40px;
    overflow: hidden;
    display: block !important;
    background: #fff;
    margin: 0 auto 40px auto;
    font-family: 'Arial', sans-serif !important;
}

.paper-book {
    width: 520px;
    max-width: 100%;
    height: 780px;
    padding: 60px 48px;
    overflow: hidden;
    font-family: 'Times New Roman', serif !important;
}

/* Professional Editorial Book Design (6x9 inches standard: 152mm x 228mm) */
.paper-book-editorial {
    width: 152mm;
    height: 228mm;
    background: #fff;
    font-family: 'Times New Roman', serif !important;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.015) 0%, transparent 15%, transparent 85%, rgba(0, 0, 0, 0.015) 100%);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    position: relative;
    transition: transform 0.3s ease;
    overflow: hidden;
    border-radius: 3px;
    margin-bottom: 50px;
    /* Professional Editorial Book Design (6x9 inches standard: 152.4mm x 228.6mm) */
    padding: 20mm 15mm 25mm 15mm;
    /* Default margins: Top 20, Left 15, Bottom 25, Right 15 */
}

/* Chapter Start Drop: Fixed 20mm padding-top per user request */
.paper-book-editorial.chapter-start {
    padding-top: 20mm !important;
}

/* Ensure no vertical centering */
.paper-book-editorial .page-content {
    display: block !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Running Header & Page Number - HIDDEN PER USER RULE */
.running-header,
.page-footer,
.page-number {
    display: none !important;
}

/* Pagination Footer */
.paper-book-editorial .page-footer {
    position: absolute;
    bottom: 45px;
    left: 0;
    right: 0;
    text-align: center;
}

.paper-book-editorial .page-number {
    font-family: 'Georgia', serif;
    font-size: 10pt;
    opacity: 0.7;
}

/* Mirror Margins (Gutter) for 6x9 Editorial Standard */
/* Odd pages (Right/Recto): Gutter on the left (Inner margin) */
.paper-book-editorial:nth-child(odd) {
    padding: 20mm 15mm 25mm 20mm !important;
    /* Inner margin (Left) is 20mm */
    box-shadow: 20px 0 20px -20px rgba(0, 0, 0, 0.15) inset, 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* Even pages (Left/Verso): Gutter on the right (Inner margin) */
.paper-book-editorial:nth-child(even) {
    padding: 20mm 20mm 25mm 15mm !important;
    /* Inner margin (Right) is 20mm */
    box-shadow: -20px 0 20px -20px rgba(0, 0, 0, 0.15) inset, 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* Drop Cap Styling */
.first-paragraph::first-letter {
    float: left;
    font-size: 3.8em;
    line-height: 0.85em;
    padding-top: 4px;
    padding-right: 12px;
    padding-left: 3px;
    font-family: inherit;
    font-weight: bold;
    color: #222;
}

.paper-book-editorial .page-content p {
    margin-bottom: 0 !important;
}


/* IEEE Paper Preview (Scaled to A4 proportions) */
.paper-ieee {
    width: 794px;
    /* 210mm A4 */
    max-width: 100%;
    min-height: 1123px;
    /* 297mm A4 */
    /* Exact IEEE Margins: Top 1.9cm, Right 1.6cm, Bottom 2.54cm, Left 1.6cm */
    padding: 1.9cm 1.6cm 2.54cm 1.6cm;
}

/* IEEE Header — single-column title block */
.ieee-header {
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.ieee-title {
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 24pt;
    font-weight: bold;
    text-align: center;
    line-height: 1.15;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.ieee-authors {
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 11pt;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 2px;
    color: #1a1a1a;
}

.ieee-affiliation {
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 10pt;
    text-align: center;
    font-style: italic;
    line-height: 1.3;
    margin-bottom: 2px;
    color: #333;
}

.ieee-abstract {
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 9pt;
    text-align: justify;
    line-height: 1.2;
    margin: 8px 0 4px;
    color: #1a1a1a;
}

.ieee-abstract-label {
    font-weight: bold;
    font-style: italic;
}

.ieee-keywords {
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 9pt;
    line-height: 1.2;
    margin-bottom: 6px;
    color: #1a1a1a;
}

.ieee-keywords-label {
    font-weight: bold;
    font-style: italic;
}

/* IEEE Two-Column Body */
.ieee-columns {
    display: flex;
    gap: 7.5mm;
    /* Exactly 425 twips as defined in DOCX export */
}

.ieee-col {
    flex: 1;
    min-width: 0;
}

/* IEEE Body Text */
.ieee-body {
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 10pt;
    text-align: justify;
    line-height: 1.15;
    margin-bottom: 6px;
    color: #1a1a1a;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.ieee-list-item {
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 10pt;
    text-align: justify;
    line-height: 1.15;
    margin-bottom: 4px;
    padding-left: 0.5in;
    text-indent: -0.25in;
    color: #1a1a1a;
}

/* IEEE Headings */
.ieee-heading-l1 {
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 10pt;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    font-variant: small-caps;
    line-height: 1.2;
    margin: 10px 0 4px;
    color: #1a1a1a;
}

.ieee-heading-l2 {
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 10pt;
    font-style: italic;
    line-height: 1.2;
    margin: 8px 0 3px;
    color: #1a1a1a;
}

.ieee-heading-l3 {
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 10pt;
    font-style: italic;
    line-height: 1.2;
    margin: 4px 0 2px;
    color: #1a1a1a;
}

/* IEEE References */
.ieee-reference {
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 9pt;
    line-height: 1.2;
    padding-left: 18px;
    text-indent: -18px;
    margin-bottom: 3px;
    color: #1a1a1a;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* IEEE Column Height Measurement Helper */
.ieee-column-measure {
    position: absolute;
    visibility: hidden;
    left: -9999px;
    top: -9999px;
}

/* IEEE Norm Button Hover */
.norm-btn[data-norm="ieee"]:hover {
    border-color: #0d9488;
    background: #f0fdfa;
}

/* IEEE PDF Export Overrides */
.pdf-export-mode .paper-ieee {
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    animation: none !important;
}

/* ===========================================================
   CONTENT SECTION (Articles + Ads)
   =========================================================== */
.content-section {
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    padding: 10px 0 40px;
}

.content-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-section-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--gray-900);
    text-align: center;
}

.content-section-sub {
    text-align: center;
    font-size: 14px;
    color: var(--gray-500);
    margin: 6px 0 40px;
}

.article-row {
    margin-bottom: 48px;
}

.article-card {
    flex: 1;
    min-width: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

.article-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 10px 0 14px;
    line-height: 1.35;
}

.article-card p {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 12px;
    line-height: 1.7;
}

.article-card ul {
    margin: 8px 0 14px 18px;
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.8;
}

.article-card li {
    margin-bottom: 4px;
}

.article-tag {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    background: var(--green-100);
    color: var(--green-600);
    border-radius: 4px;
}

.article-tag--blue {
    background: var(--blue-100);
    color: var(--blue-600);
}

.article-tag--amber {
    background: var(--amber-100);
    color: var(--amber-600);
}

.article-link {
    display: inline-block;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--blue-600);
    text-decoration: none;
}

.article-link:hover {
    text-decoration: underline;
}

/* Comparison table */
.comparison-table {
    margin: 14px 0;
    overflow-x: auto;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.comparison-table th {
    background: var(--gray-100);
    padding: 10px 14px;
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid var(--gray-200);
}

.comparison-table td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--gray-100);
}



/* ===========================================================
   NORM MODAL
   =========================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.modal-box {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: fadeInUp 0.3s ease-out;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px 16px;
    border-bottom: 1px solid var(--gray-100);
    flex-shrink: 0;
}

.modal-head h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.modal-body {
    padding: 16px 24px 24px;
}

.modal-box--legal {
    max-width: 800px;
    width: 95%;
}

.modal-body--scrollable {
    max-height: 70vh;
    overflow-y: auto;
    padding: 32px 40px;
    text-align: left;
}

.modal-body--scrollable h1 {
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--gray-900);
}

.modal-body--scrollable h2 {
    font-size: 18px;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--gray-900);
}

.modal-body--scrollable p {
    margin-bottom: 16px;
    line-height: 1.7;
    color: var(--gray-700);
}

.loading-spinner-small {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-200);
    border-top: 2px solid var(--blue-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

.modal-desc {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 16px;
}

.norm-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.norm-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    background: var(--white);
    cursor: pointer;
    transition: all 0.25s;
    text-align: left;
}

.norm-btn:hover {
    border-color: var(--blue-500);
    background: var(--blue-50);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.diag-norm-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    background: var(--white);
    cursor: pointer;
    transition: all 0.25s;
    text-align: left;
}

.diag-norm-card:hover {
    border-color: var(--blue-500);
    background: var(--blue-50);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.norm-flag {
    font-size: 28px;
}

.norm-info {
    display: flex;
    flex-direction: column;
}

.norm-info strong {
    font-size: 15px;
    color: var(--gray-900);
}

.norm-info small {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 3px;
}

/* ===========================================================
   LOADING OVERLAY
   =========================================================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease-out;
}

.loading-overlay.hidden {
    display: none;
}

.loading-box {
    text-align: center;
    max-width: 340px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    border-radius: 50%;
    border: 3px solid var(--gray-200);
    border-top-color: var(--blue-600);
    animation: spin 0.7s linear infinite;
}

.loading-box h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
}

.loading-box p {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 20px;
}

.loading-bar {
    width: 100%;
    height: 4px;
    border-radius: 99px;
    background: var(--gray-200);
    overflow: hidden;
}

.loading-bar-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--blue-600), var(--purple-600), var(--blue-600));
    background-size: 200% 100%;
    animation: progressFill 3s ease-out forwards, shimmer 1.5s linear infinite;
}

.loading-step {
    display: block;
    margin-top: 12px;
    font-size: 12px;
    color: var(--gray-400);
}

/* ===========================================================
   TOAST
   =========================================================== */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
    z-index: 700;
    opacity: 0;
    transition: all 0.35s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
}

/* Global Utilities */
.hidden {
    display: none !important;
}

/* ===========================================================
   FOOTER
   =========================================================== */
.site-footer {
    border-top: 1px solid var(--gray-200);
    background: var(--gray-900);
    color: var(--gray-400);
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 48px 20px 32px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.footer-col h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 8px;
}

.footer-col a {
    font-size: 13px;
    color: var(--gray-400);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--blue-500);
}

.footer-bottom {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-col-logo {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

.footer-logo-main {
    opacity: 0.9;
    transition: opacity 0.2s;
}

.footer-logo-main:hover {
    opacity: 1;
}

.footer-logo-main .logo-text {
    color: var(--white);
    font-size: 20px;
}

.footer-logo-main .logo-icon {
    width: 38px;
    height: 38px;
}

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 900px) {

    .article-row,
    .article-row--reverse {
        flex-direction: column;
    }

    .article-ad {
        width: 100%;
        position: static;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .tool-layout {
        flex-direction: column;
    }

    .tool-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--gray-200);
    }

    .textarea-field {
        min-height: 280px;
    }

    .header-nav {
        display: none;
    }

    .welcome-content {
        padding: 32px 20px 24px;
    }

    .paper-a4,
    .paper-book,
    .paper-ebook {
        width: 100%;
        padding: 28px 20px 36px;
        min-height: auto;
    }

    .result-header {
        justify-content: center;
    }

    .result-header h2 {
        font-size: 14px;
        order: -1;
        width: 100%;
        text-align: center;
    }

    .tool-container {
        padding: 20px 12px 32px;
    }
}

/* Diagnostic Modal Polishing */
.diag-legal-box {
    margin-top: 24px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
}

.diag-legal-box .disclaimer-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--amber-600);
    margin-bottom: 8px;
    font-weight: 700;
}

.diag-legal-box .disclaimer-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--gray-600);
    margin: 0;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    display: block;
}

.diag-checkbox-container {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 0 4px;
}

.diag-checkbox-container input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.diag-checkbox-container label {
    font-size: 13.5px;
    color: var(--gray-700);
    line-height: 1.4;
    cursor: pointer;
}

.diag-upload-zone {
    border: 2px dashed var(--gray-200);
    border-radius: 16px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--white);
    margin-top: 16px;
}

.diag-upload-zone .upload-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.diag-upload-zone p {
    margin: 4px 0;
}

.diag-upload-zone:hover {
    border-color: var(--blue-400);
    background: var(--blue-50);
}

/* BLOCO 1 — Format orientation notice */
/* BLOCO 1 — File error */
.diag-file-error {
    color: var(--red-600);
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
    text-align: center;
}

/* BLOCO 2 — Inline disclaimer */
.diag-disclaimer-inline {
    margin-top: 0;
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.diag-disclaimer-inline p {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 4px 0;
}

.diag-terms-link {
    font-size: 12px;
    color: var(--blue-600);
    text-decoration: underline;
    cursor: pointer;
}

.diag-terms-link:hover {
    color: var(--blue-800);
}

/* Footer disclaimer */
.footer-disclaimer {
    font-size: 12px;
    color: #999;
    max-width: 600px;
    margin: 0 auto 12px auto;
    line-height: 1.5;
    text-align: center;
}

/* BLOCO 3 — Consent box */
.diag-consent-box {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--gray-50);
    border-radius: 10px;
    border: 1px solid var(--gray-200);
}

.diag-consent-box .diag-checkbox-container {
    margin-top: 0;
}

/* BLOCO 3 — Disabled button */
.diag-btn-wrapper {
    position: relative;
}

.diag-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
}

.action-btn-prominent--gray {
    background: #94a3b8;
    box-shadow: 0 4px 0 rgba(0,0,0,0.15);
}

.diag-btn-tooltip {
    font-size: 12px;
    color: var(--amber-600);
    text-align: center;
    margin-top: 6px;
    font-weight: 500;
}


@media (max-width: 480px) {

    .tool-title-bar h1,
    .tool-title-bar h2 {
        font-size: 14px;
    }

    .content-section-title {
        font-size: 20px;
    }

    .article-card {
        padding: 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================================================
   LOGO TYPOGRAPHY COLORS
   =========================================================== */
/* Default (Light Backgrounds like Header and Welcome) */
.logo-forma,
.logo-free {
    color: #1a1a1a;
}

.logo-text-blue {
    color: #2563eb;
    font-weight: 800;
}

/* Dark Backgrounds (Footer) */
.site-footer .logo-forma,
.site-footer .logo-free {
    color: #ffffff;
}

/* ===========================================================
   DIAGNOSTICO / SCORE BUTTONS (New Feature)
   =========================================================== */
.score-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #ef4444;
    /* Catchy Red */
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    /* Rectangular Rounded */
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    z-index: 50;
    font-family: 'Inter', sans-serif;
}

.score-btn:hover {
    background: #dc2626;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.5);
}

.score-btn:active {
    transform: translateY(0) scale(0.98);
}

.score-btn-icon {
    font-size: 1.3em;
}

/* Placements */
.score-btn--banner {
    position: absolute;
    right: 30px;
    bottom: -35px;
    /* Pulls it even further down */
    padding: 18px 45px;
    font-size: 18px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #991b1b 100%);
    background-size: 200% auto;
    animation: pulse-red-score 2s infinite, score-shine 4s infinite linear;
    border: 3px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 40px rgba(239, 68, 68, 0.7);
}

@keyframes score-shine {
    from {
        background-position: 0% center;
    }

    to {
        background-position: 200% center;
    }
}

@keyframes score-pulse-glow {
    0% {
        transform: scale(1);
        box-shadow: 0 10px 40px rgba(239, 68, 68, 0.7);
    }

    50% {
        transform: scale(1.03);
        box-shadow: 0 15px 60px rgba(239, 68, 68, 0.9);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 10px 40px rgba(239, 68, 68, 0.7);
    }
}

.score-btn--sidebar {
    width: 100%;
    margin-bottom: 24px;
    padding: 20px 16px;
    font-size: 18px;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.3);
    animation: pulse-red-score 2s infinite;
}

@keyframes pulse-red-score {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* ===========================================================
   DIAGNOSTIC MODAL & STEPS
   =========================================================== */
.modal-box--diagnostic {
    max-width: 920px;
    width: 96%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}

.modal-body--diag {
    overflow-y: auto;
    flex: 1;
    padding: 20px 28px 28px;
}

.diag-norm-selection {
    background: var(--blue-50);
    padding: 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 0;
    text-align: center;
}

.diag-step-title {
    font-weight: 700;
    color: var(--blue-800);
    margin-bottom: 15px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.diag-norm-btns {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.diag-norm-btn {
    background: white;
    border: 2px solid var(--gray-200);
    padding: 10px 25px;
    border-radius: var(--radius-full);
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.diag-norm-btn:hover {
    border-color: var(--blue-300);
    color: var(--blue-600);
}

.diag-norm-btn.active {
    background: var(--blue-600);
    border-color: var(--blue-600);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.diagnostic-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    padding: 0 20px;
}

.diag-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s;
}

.diag-step.active {
    background: var(--blue-600);
    color: white;
    box-shadow: 0 0 0 4px var(--blue-50);
}

.diag-step.complete {
    background: var(--green-600);
    color: white;
}

.diag-line {
    flex: 1;
    height: 2px;
    background: var(--gray-200);
    max-width: 60px;
}

.diag-content h4 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 18px;
    color: var(--gray-800);
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--gray-50);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--blue-500);
    background: var(--blue-50);
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.upload-zone p {
    font-size: 14px;
    color: var(--gray-500);
}

/* Report Modal Styles */
.modal-box--report {
    max-width: 900px;
    height: 85vh;
    display: flex;
    flex-direction: column;
}

.report-markdown-body {
    padding: 20px;
    line-height: 1.6;
    color: var(--gray-800);
}

/* ─── Report Viewer: structured trecho layout ─── */
.rr-disclaimer {
    background: #fffbe6;
    border-left: 4px solid #f59e0b;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    color: #78350f;
    margin-bottom: 16px;
    line-height: 1.45;
}

.rr-disclaimer--static {
    margin-bottom: 20px;
    border-radius: 0;
    border-left: none;
    border-bottom: 1px solid #f5e6a3;
    background: #fffdf0;
    padding: 12px 20px;
}

.rr-page-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--blue-700, #1d4ed8);
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 7px 12px;
    border-radius: 6px;
    margin: 14px 0 4px;
}

/* Card de problema numerado (Problema 1, 2, ...) */
.rr-problema {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0 6px;
    background: #fefce8;
    border-left: 3px solid #eab308;
    padding: 8px 12px;
    border-radius: 0 6px 6px 0;
    margin: 6px 0 6px 8px;
    font-size: 13px;
    color: #1e293b;
    line-height: 1.5;
}

.rr-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    background: #eab308;
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 4px;
}


    background: #fefce8;
    border-left: 3px solid #eab308;
    padding: 7px 12px;
    border-radius: 0 6px 6px 0;
    margin: 4px 0 4px 8px;
    font-size: 13px;
    color: #1e293b;
    line-height: 1.45;
}

.rr-prob {
    font-weight: 600;
    color: #92400e;
}

.rr-snippet {
    display: block;
    width: 100%;
    font-size: 11.5px;
    font-style: italic;
    color: #6b7280;
    margin: 2px 0 4px 28px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rr-arrow {
    display: inline-block;
    margin: 0 6px;
    color: #3b82f6;
    font-weight: 700;
}

.rr-fix {
    color: #15803d;
}

.rr-ok {
    color: #15803d;
    font-size: 13px;
    padding: 4px 12px 4px 8px;
    margin: 2px 0 2px 8px;
}

.rr-spacer { height: 4px; }

/* Título de seção do documento (📌) */
.rr-section-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e40af;
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 8px 12px;
    border-radius: 0 6px 6px 0;
    margin: 16px 0 4px 0;
}

/* Item de problema dentro de uma seção (→) */
.rr-item {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0 4px;
    background: #fefce8;
    border-left: 3px solid #eab308;
    padding: 6px 12px;
    border-radius: 0 6px 6px 0;
    margin: 3px 0 3px 16px;
    font-size: 13px;
    color: #1e293b;
    line-height: 1.45;
}

.rr-item-arrow {
    color: #eab308;
    font-weight: 700;
    margin-right: 4px;
    flex-shrink: 0;
}

/* Dica de navegação (Ctrl+F) */
.rr-nav-hint {
    background: #f0f9ff;
    border-left: 4px solid #38bdf8;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    color: #0c4a6e;
    margin-bottom: 14px;
    line-height: 1.45;
}

/* Preview de riscos na área de resultado do modal diagnóstico */
.risks-preview-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.risks-preview-list li {
    font-size: 12.5px;
    color: #b91c1c;
    background: #fff1f2;
    border-left: 3px solid #f87171;
    border-radius: 4px;
    padding: 6px 10px;
    margin-bottom: 6px;
    line-height: 1.45;
    text-align: left;
}

.rr-line {
    font-size: 13px;
    color: #475569;
    padding: 2px 8px;
}

.report-actions {
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--gray-100);
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   Report Generator v2.0 — Structured Report Styles
   ═══════════════════════════════════════════════════════════════ */

/* Header */
.rpt-header {
    text-align: center;
    padding: 24px 20px 16px;
    border-bottom: 3px solid var(--blue-600);
    margin-bottom: 20px;
}
.rpt-header-icon { font-size: 36px; margin-bottom: 8px; }
.rpt-header-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: 1px;
    margin: 0 0 12px;
}
.rpt-header-meta {
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 14px;
    color: var(--gray-600);
    flex-wrap: wrap;
}
.rpt-header-meta strong { color: var(--gray-800); }

/* Disclaimer */
.rpt-disclaimer {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 6px;
}
.rpt-disclaimer-icon {
    font-weight: 700;
    font-size: 14px;
    color: #92400e;
    margin-bottom: 6px;
}
.rpt-disclaimer p {
    margin: 0;
    font-size: 13px;
    color: #78350f;
    line-height: 1.5;
}

/* Sections */
.rpt-section {
    margin-bottom: 24px;
}
.rpt-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--blue-700);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--blue-100);
    margin: 0 0 16px;
}

/* Summary */
.rpt-summary-total {
    font-size: 15px;
    color: var(--gray-700);
    margin-bottom: 12px;
}
.rpt-summary-total strong { font-size: 20px; color: var(--gray-900); }

.rpt-confidence-grid {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.rpt-conf-item {
    flex: 1;
    min-width: 140px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}
.rpt-conf-item strong { font-size: 18px; display: block; margin-top: 2px; }
.rpt-conf-alta { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.rpt-conf-media { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.rpt-conf-baixa { background: #f9fafb; color: #6b7280; border: 1px solid #e5e7eb; }

/* Parser warnings */
.rpt-parser-warnings {
    background: #fff7ed;
    border-left: 4px solid #ea580c;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 6px;
    max-height: 150px;
    overflow-y: auto;
}
.rpt-pw-title { font-weight: 700; font-size: 13px; color: #9a3412; margin-bottom: 6px; }
.rpt-parser-warnings ul { margin: 0; padding-left: 18px; }
.rpt-parser-warnings li { font-size: 12px; color: #7c2d12; margin-bottom: 3px; }

/* Category summary table */
.rpt-cat-summary { margin-bottom: 14px; }
.rpt-cat-summary h4 { font-size: 14px; color: var(--gray-700); margin: 0 0 8px; }
.rpt-cat-table { width: 100%; border-collapse: collapse; }
.rpt-cat-table tr:nth-child(even) { background: var(--blue-50); }
.rpt-cat-name { padding: 5px 10px; font-size: 13px; color: var(--gray-700); font-weight: 600; }
.rpt-cat-count { padding: 5px 10px; font-size: 13px; color: var(--gray-600); text-align: right; }

/* Clean pages */
.rpt-clean-pages {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 12px;
    padding: 6px 0;
}

/* Confidence legend */
.rpt-conf-legend {
    background: #f9fafb;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--gray-600);
    line-height: 1.8;
}
.rpt-conf-legend-title { font-weight: 700; color: var(--gray-700); margin-bottom: 4px; }

/* Grouped section — collapsible */
.rpt-section-grouped { border: 1px solid var(--blue-100); border-radius: 8px; padding: 0; }
.rpt-toggle-btn {
    width: 100%;
    text-align: left;
    padding: 14px 20px;
    background: var(--blue-50);
    border: none;
    font-size: 15px;
    font-weight: 700;
    color: var(--blue-700);
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.rpt-toggle-btn:hover { background: var(--blue-100); }
.rpt-toggle-arrow { transition: transform 0.2s; }

.rpt-grouped-content {
    display: none;
    padding: 12px 16px;
}
.rpt-section-grouped.rpt-expanded .rpt-grouped-content { display: block; }
.rpt-section-grouped.rpt-expanded .rpt-toggle-arrow { transform: rotate(180deg); }

/* Grouped items */
.rpt-grouped-item {
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 4px solid #d1d5db;
}
.rpt-grouped-item.rpt-conf-alta { border-left-color: #ef4444; background: #fef2f2; }
.rpt-grouped-item.rpt-conf-media { border-left-color: #f59e0b; background: #fffbeb; }
.rpt-grouped-item.rpt-conf-baixa { border-left-color: #9ca3af; background: #f9fafb; }

.rpt-gi-header { font-size: 14px; margin-bottom: 4px; }
.rpt-gi-header code { background: rgba(0,0,0,.06); padding: 1px 6px; border-radius: 3px; font-size: 11px; }
.rpt-gi-pages, .rpt-gi-count { font-size: 12px; color: var(--gray-500); }
.rpt-gi-suggestion { font-size: 13px; color: var(--gray-700); margin-top: 6px; line-height: 1.5; }
.rpt-gi-fix { font-size: 13px; color: var(--blue-700); margin-top: 4px; font-weight: 500; line-height: 1.5; }

/* Page-by-page section */
.rpt-page {
    margin-bottom: 10px;
    border-radius: 6px;
    overflow: hidden;
}
.rpt-page-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-800);
    padding: 8px 12px;
    background: var(--blue-50);
    border-bottom: 1px solid var(--blue-100);
}
.rpt-page-ok {
    padding: 8px 12px;
    font-size: 13px;
    color: #16a34a;
    background: #f0fdf4;
}
.rpt-page-has-items { border: 1px solid #e5e7eb; }
.rpt-page-clean { border: 1px solid #e5e7eb; }
.rpt-page-items { padding: 6px 12px; }

.rpt-page-item {
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
}
.rpt-page-item:last-child { border-bottom: none; }
.rpt-pi-main { font-size: 13px; color: var(--gray-700); line-height: 1.4; }
.rpt-pi-fix { font-size: 12px; color: var(--blue-600); margin-top: 2px; padding-left: 24px; }

/* Footer */
.rpt-footer {
    text-align: center;
    padding: 16px 20px;
    margin-top: 20px;
    border-top: 3px solid var(--blue-600);
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.8;
}

@media print {
    body * { visibility: hidden; }
    #diagnostic-report-modal, #diagnostic-report-modal * { visibility: visible; }
    #diagnostic-report-modal { position: absolute; left: 0; top: 0; width: 100%; height: auto; }
    #report-close, #report-modal-backdrop, .modal-footer, .report-actions { display: none !important; }
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--blue-50);
    border-radius: 8px;
    border: 1px solid var(--blue-100);
}

#diag-filename {
    font-size: 13px;
    font-weight: 600;
    color: var(--blue-600);
}

#diag-remove-file {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 18px;
    cursor: pointer;
}

/* Score Dashboard */
.score-dashboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 10px 0;
}

.score-circle-container {
    position: relative;
    width: 120px;
    height: 120px;
}

.score-svg {
    transform: rotate(-90deg);
}

.score-bg {
    fill: none;
    stroke: var(--gray-100);
    stroke-width: 8;
}

.score-fill {
    fill: none;
    stroke: var(--blue-600);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.score-number {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 900;
    color: var(--gray-900);
}

.risk-info {
    text-align: center;
}

.risk-info p {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

#risk-status {
    font-size: 22px;
    font-weight: 800;
}

.risk-low { color: var(--green-600); }
.risk-medium { color: var(--amber-600); }
.risk-high { color: #ef4444; }

/* Adjustments for existing score button */
.score-btn-content {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.score-btn-subtext {
    font-size: 11px;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
    opacity: 0.9;
    margin-top: 2px;
}
