:root {
    /* Base colours */
    --color-bg: #0b0e17;
    --color-card: rgba(255, 255, 255, 0.05);
    --color-card-blur: rgba(255, 255, 255, 0.07);
    --color-border: rgba(255, 255, 255, 0.15);
    --color-primary: #2fa38a;
    --color-secondary: #0d493a;
    --color-success: #4caf50;
    --color-danger: #ff0400;
    --color-text: #e0e0e0;
    --color-muted: #929fb3;

}

/* Global reset and typography */
body {
    background: linear-gradient(135deg, #0b091f, #1b1a27, #04041a);
    background-size: 400% 400%;
    animation: animar_fundo 10s ease infinite;
    color: var(--color-text);
    font-family: "Poppins", Arial, sans-serif;
    min-height: 100vh;
    padding-bottom: 40px;
}

@keyframes animar_fundo {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}


.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 16px;
}

h1,
h2,
h3 {
    margin-bottom: 14px;
    font-weight: 600;
    color: var(--color-text);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

p {
    margin-bottom: 12px;
    color: var(--color-muted);
    line-height: 1.5;
}

.header {
    text-align: center;
    margin-bottom: 32px;
}

/* Wizard card */
.wizard-form {
    background: var(--color-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.527);
}

/* passo 1: torne o container relativo para posicionar o ::before */
.wizard-form {
    position: relative;
    z-index: 0;
    /* mantém o resto do seu estilo */
}

/* passo 2: pseudo‑elemento animado para a borda */
.wizard-form::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 16px;
    /* gradiente cônico que será “varrido” */
    background: conic-gradient(from 0deg at 10% 550%,
            transparent 0deg,
            var(--color-primary) 30deg,
            var(--color-secondary) 90deg,
            transparent 120deg);
    /* máscara para deixar só a faixa externa visível */
    mask-composite: exclude;
    /* Firefox */
    padding: 1px;
    /* espessura da faixa animada */
    box-sizing: border-box;
    opacity: 0;
    /* começa invisível */
    pointer-events: none;
    /* não atrapalha cliques */
    animation: borderCycle 7s ease-in-out infinite;
}

/* passo 3: keyframes definindo aparição, rotação e desaparecimento */
@keyframes borderCycle {
    0% {
        opacity: 0.2;
    }


    50% {
        opacity: 0;
    }

    100% {
        opacity: 0.2;
    }

    /* espera até reiniciar */
}

/* Progress bar */
.progress-container {
    margin-bottom: 32px;
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.progress-step.active,
.progress-step.completed {
    opacity: 1;
}

.step-number {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    font-weight: 700;
    font-size: 1rem;
    transition: background 0.3s ease, transform 0.3s ease;
}

.progress-step.active .step-number {
    background: linear-gradient(45deg, var(--color-primary), var(--color-secondary));
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
}

.progress-step.completed .step-number {
    background: linear-gradient(45deg, var(--color-success), var(--color-primary));
    color: #fff;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.4);
}

.step-label {
    font-size: 0.8rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-line {
    flex: 1;
    height: 4px;
    background: var(--color-border);
    margin: 0 12px;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

.progress-line::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(45deg, var(--color-primary), var(--color-secondary));
    transition: width 0.4s ease;
}

/* When marked as completed, fill the connector */
.progress-line.completed::before {
    width: 100%;
}

/* Steps visibility */
.step-content {
    display: none;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.step-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Toggle switch */
.toggle-container {
    margin-bottom: 24px;
}

.toggle-label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-muted);
    font-size: 0.9rem;
}

.toggle-switch {
    display: flex;
    gap: 12px;
}

.toggle-option {
    cursor: pointer;
    padding: 8px 20px;
    border: 1px solid var(--color-border);
    border-radius: 25px;
    background: var(--color-card);
    color: var(--color-muted);
    font-size: 0.85rem;
    user-select: none;
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

input[type="radio"] {
    display: none;
}

input[type="radio"]:checked+.toggle-option {
    background: linear-gradient(45deg, var(--color-primary), var(--color-secondary));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

.campos-tipo {
    display: none;
}

.campos-tipo.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

/* Form groups */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: border-color 0.3s ease;
}

.form-group input {
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--color-text);
    font-size: 0.9rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group.focused input,
.form-group input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.2);
    outline: none;
}

.form-group input.error {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.2);
}

.error-message {
    color: var(--color-danger);
    font-size: 0.75rem;
    margin-top: 4px;
}

.field-hint {
    color: var(--color-muted);
    font-size: 0.75rem;
    margin-top: 4px;
}

/* Step actions */
.step-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 32px;
}

/* Buttons */
.btn {
    position: relative;
    overflow: hidden;
    padding: 12px 24px;
    border: none;
    border-radius: 32px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    background: var(--color-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.btn-primary {
    background: linear-gradient(45deg, var(--color-primary), var(--color-secondary));
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
    background: var(--color-border);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.alertCelular {
    color: white;
    text-align: center;
    font-size: 1.2rem;
    margin-top: 20px;
    width: 100%;
    height: 100vh;
}

.btn-upload {
    display: none;
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.75rem;
    margin-top: 10px;
}

/* Ripple effect element */
.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    background: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Upload area */
.upload-group {
    margin-bottom: 24px;
}

.upload-area {
    background: var(--color-card);
    border: 2px dashed var(--color-border);
    border-radius: 14px;
    padding: 24px;
    position: relative;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.upload-area:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
}

/* When a file has been selected, add a highlight */
.upload-area.uploaded {
    border-color: var(--color-success);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

.upload-placeholder {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--color-muted);
    transition: color 0.3s ease;
}

.upload-area:hover .upload-placeholder {
    color: var(--color-primary);
}

.upload-icon {
    font-size: 2.4rem;
}

.upload-preview {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
}

.upload-preview .preview-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid var(--color-border);
}

.upload-preview .upload-status {
    font-size: 0.8rem;
    color: var(--color-success);
}

.upload-preview .btn {
    align-self: flex-start;
}

/* Feedback messages */
.upload-feedback {
    display: block;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--color-muted);
}

.upload-feedback.ok {
    color: var(--color-success);
}

.upload-feedback.erro {
    color: var(--color-danger);
}

/* Example block */
.example-block {
    background: var(--color-card);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 16px;
    display: grid;
    gap: 20px;
    border: 1px solid var(--color-border);
    margin-bottom: 32px;
}

.example-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    border: 1px solid var(--color-border);
    border-radius: 10px;
}

.example-label {
    display: block;
    text-align: center;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--color-primary);
}

/* Document card */
.doc-block {
    background: var(--color-card);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    margin-bottom: 32px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.doc-instruction {
    color: var(--color-muted);
    margin-bottom: 5px;
}

/* Review section */
.review-container {
    background: var(--color-card);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    margin-bottom: 32px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.review-section {
    margin-bottom: 24px;
}

.review-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 22px;
}

.review-label {
    display: block;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.85rem;
}

.review-value {
    color: var(--color-text);
    font-size: 0.9rem;
    word-break: break-word;
}

.review-thumb {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid var(--color-border);
}

/* Ensure document containers have spacing from the preceding content */
.docs-container {
    margin-top: 24px;
}

/* Example item wrapper is allowed to overflow for images */
.example-item {
    overflow: visible;
}

/* Checkbox group */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--color-muted);
}

.checkbox-group input {
    margin-top: 4px;
    accent-color: var(--color-primary);
    width: 18px;
    height: 18px;
}

.checkbox-group label {
    cursor: pointer;
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: var(--color-card);
    backdrop-filter: blur(10px);
    padding: 32px;
    border-radius: 18px;
    text-align: center;
    width: 90%;
    max-width: 420px;
    border: 1px solid var(--color-border);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.spinner {
    border: 5px solid var(--color-border);
    border-top: 5px solid var(--color-primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.success-icon {
    font-size: 2.6rem;
    margin-bottom: 16px;
    color: var(--color-success);
}

/* Camera modal */
.modal-camera {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.camera-box {
    background: var(--color-card);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 16px;
    max-width: 540px;
    width: 90%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid var(--color-border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

#video_camera,
#canvas_camera {
    width: 100%;
    border-radius: 12px;
    background: #000;
}

.camera-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.btn-ok {
    background: linear-gradient(45deg, var(--color-success), var(--color-primary));
    color: #fff;
}

.btn-cancel {
    background: var(--color-danger);
    color: #fff;
}

/* Disabled submit button */
#btnEnviar:disabled {
    background: var(--color-border) !important;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .step-label {
        display: none;
    }

    .review-label {
        font-size: 0.8rem;
    }

    .btn {
        font-size: 0.8rem;
    }

    .step-number {
        width: 38px;
        height: 38px;
        font-size: 0.85rem;
    }
}

/* Fade in animation used throughout */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- CÂMERA ---------- */
/* ---------- CÂMERA ---------- */
/* Modal da câmera ocupa toda a largura disponível */
.modal-camera {
    justify-content: center;
    align-items: center;
    padding: 0 12px;
    /* evita colar na borda do celular */
}

/* Caixa que envolve vídeo/canvas + botões */
.camera-box {
    width: 100%;
    /* 100 % da viewport */
    max-width: 500px;
    /* porém nunca passa de 500 px */
}

/* Vídeo ao vivo, canvas e previews sempre quadrados e fluidos */
#video_camera,
#canvas_camera,
.preview-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
}

/* Barra de botões adaptável */
.camera-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
}

#capturarVerde {
    background-image: linear-gradient(45deg, var(--color-primary), var(--color-secondary));
}

.selfie_no_botao {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    margin-top: 5px;
}

.btn-camera {
    background-image: linear-gradient(45deg, var(--color-primary), var(--color-secondary));
    color: #fff;
    font-size: 0.9rem;
    font-weight: 400;
    box-shadow: 0px 4px 12px rgba(0, 212, 255, 0.4);
    margin-top: 10px;
    width: 100%;
}

/* ---------- MOLDE/GUIA DA CÂMERA ---------- */
.camera-box {
    /* já existe – só acrescente position */
    position: relative;
    /* para posicionamento absoluto do molde */
}

.molde-camera {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    /* não bloqueia toques */
}

.molde-camera::before {
    content: "";
    margin-top: -60px;
    width: 87%;
    /* tamanho interno desejado */
    aspect-ratio: 8 / 5.5;
    /* mantém quadrado */
    border: 2px dashed var(--color-primary);
    border-radius: 15px;
    /* escurece a área fora do quadrado */
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55);
}