:root {
    --primary-blue: #007bff;
    --dark-blue: #003366;
    --light-blue: #eef6ff;
    --text-dark: #212529;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --background-light: #f4f7f9;
    --success-green: #28a745;
    --success-light: #d4edda;
    --error-red: #dc3545;
    --error-light: #f8d7da;
    --warning-orange: #fd7e14;
    --warning-light: #fff3cd;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-light);
    margin: 0;
    padding: 2rem 1rem;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 800px;
    background-color: #ffffff;
    padding: 2rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    text-align: center;
}

header {
    margin-bottom: 1.5rem;
}

.header-logo {
    height: 100px;
    width: auto;
    margin-bottom: 1rem;
}

header h1 {
    font-size: 2em;
    color: var(--dark-blue);
    margin: 0 0 0.5rem 0;
}

header p {
    color: var(--text-light);
    font-size: 1em;
    margin-bottom: 1.5rem;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: transparent;
    color: var(--primary-blue);
    /* ALTERADO AQUI para alinhar verticalmente com o botão azul */
    padding: 1rem 1.5rem;
    font-size: 1.1em;
    /* FIM DA ALTERAÇÃO */
    border-radius: 8px;
    border: 1px solid var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    /* Garante que o cursor mude para o botão */
    transition: all 0.2s ease-in-out;
}

.btn-secondary:hover {
    background-color: var(--primary-blue);
    color: white;
}

.mode-selection-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
    text-align: left;
}

.mode-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
    font-size: 1em;
}

.radio-group {
    border-radius: 12px;
    background-color: #fff;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    padding: 10px 0;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1em;
    color: var(--text-dark);
    padding: 5px 10px;
    border-radius: 6px;
    transition: background-color 0.2s ease-in-out;
}

.radio-option input[type="radio"] {
    margin-right: 0.8rem;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-blue);
}

.radio-option:hover {
    color: var(--primary-blue);
    background-color: var(--light-blue);
}

.upload-section {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.upload-section:hover {
    border-color: var(--primary-blue);
    background-color: var(--light-blue);
}

.upload-section input[type="file"] {
    display: none;
}

.upload-icon {
    margin-bottom: 1rem;
}

.upload-prompt {
    font-weight: 500;
    color: var(--primary-blue);
    font-size: 1.1em;
    margin: 0;
}

.loading-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
}

.loading-text {
    font-size: 1.1em;
    font-weight: 500;
    color: var(--text-dark);
    margin-top: 1rem;
}

.flash-messages {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0 0;
}

.flash-messages li {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.flash-success {
    background-color: var(--success-light);
    color: var(--success-green);
    border: 1px solid var(--success-green);
}

.flash-error {
    background-color: var(--error-light);
    color: var(--error-red);
    border: 1px solid var(--error-red);
}

.flash-warning {
    background-color: var(--warning-light);
    color: #856404;
    border: 1px solid #ffeeba;
}

.results-section {
    margin-top: 1.5rem;
    text-align: left;
}

.results-section h2 {
    color: var(--dark-blue);
    margin-bottom: 1.5rem;
    text-align: center;
}

.report-group-container:first-of-type {
    margin-top: 0;
}

.report-group-title {
    font-size: 1.2em;
    color: var(--dark-blue);
    text-align: left;
    margin-bottom: 1rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid var(--border-color);
}

.report-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-blue);
}

.card-icon {
    background-color: var(--light-blue);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.card-icon.icon-primary svg {
    stroke: var(--primary-blue);
}

.card-icon.icon-warning svg {
    stroke: var(--warning-orange);
}

.card-icon.icon-error svg {
    stroke: var(--error-red);
}

.card-icon img {
    width: 28px;
    height: 28px;
}

.card-title {
    font-size: 1.05em;
    font-weight: 700;
    color: var(--dark-blue);
    margin: 0 0 0.25rem 0;
}

.card-subtitle {
    font-size: 0.85em;
    color: var(--text-light);
    margin: 0;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.card-cta {
    margin-top: auto;
    background-color: var(--primary-blue);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9em;
}

.card-cta:hover {
    background-color: var(--dark-blue);
}

@media (max-width:768px) {
    body {
        padding: 1rem;
    }

    .container {
        padding: 1.5rem;
    }

    header h1 {
        font-size: 1.8em;
    }

    .action-buttons {
        flex-direction: column;
    }
}

#ai-guide-display {
    margin-top: 2rem;
    text-align: left;
}

.ai-guide-section {
    background-color: var(--light-blue);
    border: 1px solid var(--primary-blue);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.ai-guide-section h2 {
    color: var(--dark-blue);
    font-size: 1.4em;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-blue);
    text-align: center;
    line-height: 1.2;
}

.ai-guide-content {
    flex-grow: 1;
    margin-top: 0;
    line-height: 1.6;
    color: var(--text-dark);
    font-size: 1em;
}

.ai-guide-content p {
    margin-bottom: 1rem;
}

.ai-guide-content strong {
    color: var(--dark-blue);
    font-weight: 700;
}

.ai-guide-content ul {
    padding-left: 25px;
    margin-top: 0.8rem;
    margin-bottom: 1rem;
    list-style-type: disc;
}

.ai-guide-content li {
    margin-bottom: 0.6rem;
    color: var(--text-dark);
}

.ai-guide-section div:last-child em {
    font-size: 0.75em;
    color: var(--text-light);
    display: block;
    text-align: right;
    margin-top: 1.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-color);
}

.ai-guide-section.flash-error {
    background-color: var(--error-light);
    border-color: var(--error-red);
    color: var(--error-red);
}

.ai-guide-section.flash-error h2 {
    color: var(--error-red);
    border-bottom-color: var(--error-red);
}

#new-analysis-button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.main-action-row {
    width: 100%;
    display: flex;
    justify-content: center;
}

.secondary-action-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    width: 100%;
}

.btn-secondary-action {
    background-color: transparent;
    color: var(--primary-blue);
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--primary-blue);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 200px;
}

.btn-secondary-action:hover {
    background-color: var(--primary-blue);
    color: white;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    text-decoration: none;
    display: inline-block;
    min-width: 350px;  
    text-align: center; 
    box-sizing: border-box; 
}

.btn-primary:hover {
    background-color: var(--dark-blue);
}