body {
    font-family: Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
}

.form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* header com logo fixo no topo */
.form-header {
    position: sticky;
    top: 0;
    background: #00766F;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

/* imagens no header */
#formBrasao {
    max-height: 60px;
    width: auto;
    max-width: 100%;
}

#formLogo {
    max-height: 64px;
    width: auto;
    max-width: 100%;
}

/* Ajuste responsivo para telas menores */
@media (max-width: 480px) {
    #formBrasao {
        max-height: 40px;
    }
    #formLogo {
        max-height: 44px;
    }
    .form-header > * {
        margin: 0 6px;
    }
}

/* Itens do header (sejam links ou imagens diretas) */
.form-header > * {
    margin: 0 12px;
}

/* O primeiro item (Logo) empurra os demais para a direita */
.form-header > :first-child {
    margin-right: auto;
}

/* Se for um link, garante alinhamento correto da imagem interna */
.form-header > a {
    display: flex;
    align-items: center;
}

/* file control */
.file-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.file-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: #333;
    flex: 1;
    min-width: 0;
}

.file-size {
    color: #666;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.remove-file-btn {
    background: #ffebee; /* vermelho suave */
    border: 1px solid #ff8a80;
    color: #b71c1c;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.remove-file-btn:hover {
    background: #ffcdd2;
}

.form-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    display: none;
    opacity: 0;
    transition: opacity 0.35s ease-in-out, transform 0.35s ease-in-out;
}

.form-section.active {
    display: block;
    opacity: 1;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center; /* evita que botões cresçam para igualar altura do maior */
    margin-top: 20px;
    padding: 20px 0;
    /* Reserva altura mínima para evitar CLS quando botões ficam visíveis */
    min-height: 44px;
}

/* Botão circular de recomeçar */
.restart-btn {
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    background: #bc4040;
    border: 1px solid #d0d0d0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    cursor: pointer;
}

.restart-btn:hover {
    background: rgb(109, 43, 43);
}

/* progress bar */
.progress-track {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg,#4CAF50,#66bb6a);
    width: 0%;
    transition: width 400ms ease-in-out;
}

/* animação de entrada/saída */
.form-section.enter {
    display: block;
    opacity: 0;
    transform: translateY(8px);
}

.form-section.enter-active {
    opacity: 1;
    transform: translateY(0);
}

.form-section.exit {
    opacity: 1;
    transform: translateY(0);
}

.form-section.exit-active {
    opacity: 0;
    transform: translateY(8px);
}

.nav-btn {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
    border: 1px solid #d0d0d0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    cursor: pointer;
}

.nav-btn:hover {
    background-color: #45a049;
}

/* Botões da página inicial: tamanho fixo e layout vertical */
.home-nav-btn {
    display: inline-block;
    width: 100%;
    max-width: 380px;
    padding: 14px 18px;
    text-align: center;
    font-size: 16px;
    background-color: #00766F;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    box-sizing: border-box;
    white-space: normal;
    line-height: 1.4;
}

.home-nav-btn:hover {
    background-color: #00655a;
}

.block {
    margin-bottom: 20px;
    position: relative; /* necessário para posicionar tooltips */
}

h1 {
    color: #333;
    font-size: 24px;
    margin-bottom: 30px;
    justify-self: center;
}

h2 {
    color: #343434;
    font-size: 18px;
    margin-bottom: 10px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.tip {
    font-size: 12px;
    color: #ff0000;
    margin-top: 2px;
    display: block;
}

input[type="text"],
input[type="email"],
input[type="tel"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

input[readonly] {
    background-color: #e9ecef;
    color: #495057;
    cursor: not-allowed;
}

input[type="file"] {
    margin-top: 5px;
}

/* Custom File Input */
.file-control {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-direction: row; /* Ensure row layout for button + text */
}

/* Prevent native validation bubble from shifting layout by ensuring wrapper has stable size */
.file-input-wrapper,
.file-custom-btn {
    min-height: 40px;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0; /* Prevent button from shrinking */
}

.file-input-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.file-custom-btn {
    background-color: #eee;
    border: 1px solid #ccc;
    color: #333;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.file-custom-btn:hover {
    background-color: #e0e0e0;
}

.file-name-display {
    font-size: 14px;
    color: #666;
    max-width: 200px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* .name-start and .name-end removed as we use simple ellipsis now */

@media (max-width: 480px) {
    .file-name-display {
        max-width: 100%;
    }
}

.radio-group {
    margin: 10px 0;
}

/* Detailed Radio Options */
.radio-group.detailed {
    display: flex;
    flex-direction: column;
}

.radio-group.detailed label {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-group.detailed label:hover {
    background-color: #f8f9fa;
    border-color: #bbb;
}

.radio-group.detailed input[type="radio"] {
    margin-top: 4px;
    margin-right: 12px;
    flex-shrink: 0;
}

.option-content {
    display: flex;
    flex-direction: column;
}

.option-title {
    font-weight: bold;
    margin-bottom: 4px;
    color: #2c503a;
    font-size: 1rem;
}

.option-desc {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.4;
}

.radio-group.detailed label.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

.checkbox-group {
    margin: 10px 0;
}

.submit-btn {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.submit-btn:hover {
    background-color: #45a049;
}

.progress-bar {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f8f8f8;
    border-radius: 4px;
    font-weight: bold;
}

.submission-message {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px 20px;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    color: #1b5e20;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
}

.numero-inscricao-container {
    margin: 20px 0;
    padding: 20px;
    background: rgba(0, 118, 111, 0.1);
    border: 2px solid #00766f;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.numero-inscricao {
    font-size: 48px;
    font-weight: bold;
    color: #00766f;
    margin: 0;
    letter-spacing: 2px;
}

@media (max-width: 600px) {
    .numero-inscricao {
        font-size: 36px;
        letter-spacing: 1px;
    }
}

.processing-message {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px 20px;
    background: #fff3e0;
    border: 1px solid #ffe0b2;
    color: #e65100;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ffe0b2;
    border-top: 4px solid #e65100;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-container {
    width: 100%;
    max-width: 720px;
    margin: 20px auto;
}

.progress-bar-upload {
    width: 100%;
    height: 30px;
    background-color: #ffe0b2;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00766f 0%, #00a896 100%);
    border-radius: 15px;
    transition: width 0.3s ease;
    width: 0%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: bold;
}

.progress-percent {
    margin-top: 10px;
    font-size: 20px;
    font-weight: bold;
    color: #00766f;
}

.error {
    color: red;
    font-size: 14px;
    margin-top: 5px;
}

/* estilo para inputs marcados com erro */
.error input,
.error textarea,
.error select {
    border-color: #f44336;
}

/* Campos obrigatórios */
label[for*="*"]::after {
    content: " *";
    color: red;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.tab-button {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #00766F;
    background-color: #f5f5f5;
}

.tab-button.active {
    color: #00766F;
    border-bottom: 2px solid #00766F;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s;
}

.tab-content.active {
    display: block;
}

/* ========== Modal de Persistência de Dados ========== */

.storage-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.storage-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 450px;
    width: 90%;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.storage-modal-header {
    background: linear-gradient(135deg, #00766F 0%, #004F4A 100%);
    color: white;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.storage-modal-icon {
    font-size: 32px;
}

.storage-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.storage-modal-body {
    padding: 24px;
    line-height: 1.6;
    color: #333;
}

.storage-modal-body p {
    margin: 12px 0;
}

.storage-modal-body strong {
    color: #00766F;
    font-weight: 600;
}

.storage-modal-actions {
    display: flex;
    gap: 12px;
    padding: 0 24px 24px;
}

.storage-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.storage-btn-continue {
    background: #00766F;
    color: white;
}

.storage-btn-continue:hover {
    background: #005550;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 118, 111, 0.3);
}

.storage-btn-continue:active {
    transform: translateY(0);
}

.storage-btn-new {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.storage-btn-new:hover {
    background: #e8e8e8;
    border-color: #999;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.storage-btn-new:active {
    transform: translateY(0);
}

/* Responsivo */
@media (max-width: 480px) {
    .storage-modal {
        max-width: 100%;
        width: 95%;
        border-radius: 8px;
    }

    .storage-modal-header {
        padding: 16px;
    }

    .storage-modal-header h2 {
        font-size: 18px;
    }

    .storage-modal-body {
        padding: 16px;
    }

    .storage-modal-actions {
        padding: 0 16px 16px;
        flex-direction: column;
    }

    .storage-btn {
        padding: 14px 12px;
        font-size: 13px;
    }
}

/* ========== Modal de Retry de Upload ========== */

.retry-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.retry-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 450px;
    width: 90%;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.retry-modal-header {
    background: linear-gradient(135deg, #d97757 0%, #b85c3c 100%);
    color: white;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.retry-modal-icon {
    font-size: 32px;
}

.retry-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.retry-modal-body {
    padding: 24px;
    line-height: 1.6;
    color: #333;
}

.retry-modal-body p {
    margin: 12px 0;
}

.retry-progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0;
}

.retry-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #d97757 0%, #b85c3c 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.retry-modal-actions {
    display: flex;
    gap: 12px;
    padding: 0 24px 24px;
}

.retry-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.retry-btn-retry {
    background: #d97757;
    color: white;
}

.retry-btn-retry:hover {
    background: #b85c3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 87, 0.3);
}

.retry-btn-retry:active {
    transform: translateY(0);
}

.retry-btn-cancel {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.retry-btn-cancel:hover {
    background: #e8e8e8;
    border-color: #999;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.retry-btn-cancel:active {
    transform: translateY(0);
}

/* Responsivo */
@media (max-width: 480px) {
    .retry-modal {
        max-width: 100%;
        width: 95%;
        border-radius: 8px;
    }

    .retry-modal-header {
        padding: 16px;
    }

    .retry-modal-header h2 {
        font-size: 18px;
    }

    .retry-modal-body {
        padding: 16px;
    }

    .retry-modal-actions {
        padding: 0 16px 16px;
        flex-direction: column;
    }

    .retry-btn {
        padding: 14px 12px;
        font-size: 13px;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========== Connection Status Banner (Responsivo) ========== */
#connection-status-banner {
    line-height: 1.4;
}

@media (max-width: 768px) {
    #connection-status-banner {
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    #connection-status-banner {
        padding: 8px 10px;
        font-size: 12px;
        word-break: break-word;
        white-space: normal;
    }
}

/* ==========================================================================
   LEGACY COMPATIBILITY OVERRIDES

