/* =============================
   VÍDEO E BOTÕES DE CAPTURA
   ============================= */

video {
    display: block;
    width: 100%;
    max-width: 640px;
    height: auto;
    background: black;
    margin: 0 auto;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

button {
    padding: 15px 25px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

#capture {
    background-color: #007bff;
    color: white;
    padding: 15px 25px;
    font-size: 18px;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    display: block;
    margin: 20px auto !important;
    text-align: center;
}

#capture:hover {
    background-color: #0056b3;
}

button[type="submit"]:not(.btn-danger) {
    background-color: #28a745;
    color: white;
}

button[type="submit"]:not(.btn-danger):hover {
    background-color: #1e7e34;
}

@media (max-width: 600px) {
    #capture {
        width: 80%;
        max-width: 300px;
        margin: 20px auto !important;
    }

    .button-container {
        flex-direction: column;
        align-items: center;
    }

    button {
        width: 80%;
        margin-bottom: 10px;
    }
}


/* =============================
   IMAGENS DE CADASTRO (DEFAULT E UPLOAD)
   ============================= */

/* Estilo das imagens default (antes do upload) */
.default-preview {
    max-height: 180px;
    object-fit: contain;
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    background-color: white;
    margin-bottom: 0.5rem;
    display: block;
}

/* Estilo aplicado após o upload da imagem */
.photo-preview {
    width: 100%;
    height: 270px;
    max-height: 270px;
    min-height: 270px;
    object-fit: cover;
    display: block;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    background-color: white;
    margin-bottom: 0.5rem;
    overflow: hidden;
}


/* =============================
   LAYOUT DOS CARDS DE IMAGEM
   ============================= */

/* Corpo do card fixo para alinhar botão e imagem */
.photo-card-body {
    height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

/* Card externo com altura fixa para padronização */
.photo-card {
    height: 370px;
}

/* Tabelas da listagem */
/* Estilização da tabela zebra */
.zebra-table thead th {
    background-color: #96d8ff;
    color: #000;
    font-weight: bold;
    vertical-align: middle;
    text-align: center;
}

.zebra-table {
    border-radius: 10px;
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

.zebra-table th,
.zebra-table td {
    padding: 6px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.zebra-table tbody tr:nth-child(even) td {
    background-color: #f5f5f5;
}

.zebra-table tbody tr:nth-child(odd) td {
    background-color: #eeeeee;
}

.zebra-table tbody tr:hover td {
    background-color: #f4f9d8;
    cursor: pointer;
}

.zebra-table tbody tr.no-hover:hover>td {
    background-color: #ffffff !important;
    cursor: default !important;
}

.row-success td {
    background-color: #e9f9ee !important;
}

.row-error td {
    background-color: #ffecec !important;
}

.row-success:hover td {
    background-color: #d4f4e2 !important;
    /* verde um pouco mais forte */
}

.row-error:hover td {
    background-color: #ffd6d6 !important;
    /* vermelho um pouco mais forte */
}

.user-checkbox,
.car-checkbox {
    width: 16px;
    height: 16px;
    margin: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.user-checkall {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
}

/* Desabilitar hover quando a classe .no-hover for aplicada */
.no-hover tr:hover {
    background-color: inherit;
    cursor: default;
}


/* Lupa da listagem */
.btn-outline-secondary {
    background-color: white !important;
    color: #333;
    border-color: #ced4da;
}

.btn-outline-secondary:hover {
    background-color: #e9ecef !important;
    border-color: #adb5bd;
}

.btn_custom {
    text-decoration: none !important;
    color: white;
    border: none;
    font-weight: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 20px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.btn_apagar:hover {
    background-color: #b02a37;
    /* vermelho mais escuro no hover */
}

.btn_centered {
    display: block;
    margin: 0 auto;
}


.btn_red {
    background-color: #dc3545 !important;
    color: white !important;
    border: none;
}

.btn_red:hover {
    background-color: #8b1e2b !important;
    color: white !important;
}


.btn_green {
    background-color: rgb(0, 132, 104) !important;
}

.btn_green:hover {
    background-color: #0f3d22 !important;
    color: #fff !important;
}


.btn_blue {
    background-color: #00548c;
}

.btn_blue:hover {
    background-color: #003f68;
}

.btn_yellow {
    background-color: #f7c948;
    /* Amarelo dourado */
    color: #000;
    /* Texto preto pra contraste */
}

.btn_yellow:hover {
    background-color: #d4a017;
    /* Tom âmbar mais escuro */
    color: #fff;
    /* Texto branco no hover pra destaque */
}

.btn_royal {
    background-color: #0d6efd;
    color: white;
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
}

.btn_royal:hover {
    background-color: #0b5ed7;
}

.btn_brown {
    background-color: #8B4513;
    /* SaddleBrown */
    color: white;
}

.btn_brown:hover {
    background-color: #5C3317;
    /* Darker brown */
    color: white;
}

.btn_gray {
    background-color: #dfdfdf;
    /* SaddleBrown */
    color: white;
}

/* === fonte do botao dos steps diferente */
.btn_action {
    font-weight: bold;
    font-size: 16px;
    /* ou o tamanho que preferir */
}

.btn-group-print {
    display: inline-flex;
    gap: 12px;
    justify-content: center;
}

.status-line {
    font-size: 1.6rem;
    font-weight: bold;
    margin-bottom: 1.2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.status-success {
    color: green;
}

.status-error {
    color: red;
}

.btn-wrapper {
    margin-top: 2rem;
    text-align: center;
    /* ← garante centralização */
}

.result-image {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin: 1rem auto;
}

.info-box {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 3rem auto 2rem auto;
    /* ← adiciona espaço no topo */
    max-width: 600px;
    background: #f9f9f9;
}

.btn-main {
    background-color: rgb(0, 132, 104) !important;
    color: #fff !important;
    font-size: 1rem;
    font-weight: 500;
    width: 160px;
    text-align: center;
    padding: 14px 20px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
    border: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin: 0 auto;
}

.btn-main:hover,
.btn-main:focus {
    background-color: #0f3d22 !important;
    color: #fff !important;
}

/* line divider bottom of title */
.section-divider {
    height: 2px;
    background-color: #e0e0e0;
    margin: 16px auto 12px auto;
    width: 100%;
    max-width: 1000px;
}

/* CABEÇALHO CINZA CLARO ESPECÍFICO */
.plan-car-table thead th {
    background-color: #f5f5f5;
}

/* REDUZ MARGEM ACIMA DA TABELA */
.plan-car-table {
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .plan-car-table thead {
        display: none;
    }

    .plan-car-table tbody,
    .plan-car-table tr,
    .plan-car-table td {
        display: block;
        width: 100%;
    }

    .plan-car-table tr {
        margin-bottom: 1rem;
        border: 1px solid #ccc;
        border-radius: 0.5rem;
        padding: 0.5rem;
        background-color: #f9f9f9;
    }

    .plan-car-table td {
        text-align: left;
        padding: 0.4rem 0.6rem;
        position: relative;
    }

    .plan-car-table td::before {
        content: attr(data-label);
        font-weight: bold;
        display: block;
        margin-bottom: 0.2rem;
        color: #333;
    }
}

@media (max-width: 768px) {
    .card {
        padding: 2rem !important;
    }

    .card h4 {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }

    .card .fw-bold {
        font-size: 1.1rem;
    }

    .card div {
        font-size: 0.95rem;
    }

    .form-check {
        background: rgb(245, 245, 245);
        border-radius: 12px;
        padding: 1rem;
        margin-bottom: 1rem;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
        display: flex;
        align-items: flex-start;
        gap: 1rem;
    }

    .form-check-input {
        transform: scale(2);
        margin-top: 6px;
        flex-shrink: 0;
    }

    .form-check-label {
        font-size: 1.1rem;
        line-height: 1.6;
        font-weight: 500;
    }

    .text-primary {
        font-size: 1.1rem;
    }
}

.form-check.checked {
    background-color: #b0d1ff !important;
    /* verde clarinho igual da zebra-table */
}

#qr-reader {
    width: 100%;
    max-width: 480px;
    max-height: 320px;
    aspect-ratio: 1 / 1;
    /* mantém quadrado */
    margin: auto;
    position: relative;
    overflow: hidden;
}

.html5-qrcode video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
}



.html5-qrcode-shadow {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.3) !important;
    /* sombra opaca */
    pointer-events: none;
    z-index: 2;
}

#qr-reader__dashboard_section_csr span,
#qr-reader__dashboard_section_csr svg {
    display: none !important;
}

.camera-box {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.video-frame {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    transform: scaleX(-1);
}

/* Carro (normal) */
.video-frame-car {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 8px;
  transform: none;
}

.face-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
    mask-image: radial-gradient(ellipse 90px 130px at center, transparent 90px, black 100px);
    -webkit-mask-image: radial-gradient(ellipse 90px 130px at center, transparent 90px, black 100px);
}

.oval-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180px;
    height: 260px;
    transform: translate(-50%, -50%);
    border: 1px dashed white;
    border-radius: 50% / 70%;
    pointer-events: none;
    z-index: 10;
}

.step-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    padding: 0 0px;
    gap: 14px;
    /* ← aumenta horizontalmente */
}

.step-wrapper {
    text-align: center;
    flex: 1;
    position: relative;
}

.step {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: #ccc;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    color: white;
    margin: 0 auto;
    position: relative;
    z-index: 1;

}

.step-label {
    font-size: 0.8rem !important;
    margin-top: 5px;
    color: #333;
}

.step-wrapper:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    width: 100%;
    height: 4px;
    background-color: #ccc;
    z-index: 0;
}

.step.done {
    background-color: #198754;
}

.step.active {
    background-color: #dc3545;
}

.step-box {
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    padding: 8px 0;
    margin-top: 10px;
    margin-bottom: 15px;
}

/* ===== FINAL VERSION OF CSS 27-08 ============================================== */
/* ===== Global CSS ===== */

/*****************************/
/* Global Header and Content */
/*****************************/
/* Global spacing below fixed navbar (responsive) */
.f-global-body {
    padding-top: clamp(56px, 6vw + 24px, 90px);
    margin-top: 0;
}



/* Title */
.f-global-title {
    font-size: clamp(1.5rem, 2.6vw + 0.2rem, 1.6rem);
    line-height: 1.3;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    text-align: center;
    text-wrap: nowrap;
}

/* Content card width */
.f-global-content {
    max-width: clamp(680px, 92vw, 1000px);
    width: 100%;
    padding: 0 !important;
    overflow: hidden;
    margin: 0 auto;
}

/* Header things */
.f-global-content>.card-header {
    padding: 0 !important;
    border-bottom: 0 !important;
    background: transparent !important;
}

/* Green background title */
.f-global-card-header {
    background: #008468;
    color: #fff;
    padding: 1rem 1.25rem;
}

/* Green background text color */
.f-global-card-header .f-global-title {
    margin: 0;
    color: #fff;
}

/* ===== Body layout (no navbar global) ===== */
.f-global-no-navbar {
    padding-top: 0 !important;
}

/* ===== swal alerts small size ===== */
.swal-smaller {
    transform: scale(0.75);
    /* 85% do tamanho padrão */
}


/******************************/
/* pending_registrations.html */
/******************************/
/* cards background */
.f-pending .pending-card {
    background-color: #f8f9fa;
    box-shadow: none;
}

/* photo cards */
.f-photo-face {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
    border: 1px solid #e9ecef;
    background: #f8f9fa;
}

/* spaces of photos */
.f-pending .pending-card .row.g-3 {
    --bs-gutter-x: .2rem;
    --bs-gutter-y: .2rem;
}

@media (min-width: 576px) {
    .f-pending .pending-card .row.g-3 {
        --bs-gutter-x: .5rem;
        --bs-gutter-y: .5rem;
    }
}

@media (min-width: 992px) {
    .f-pending .pending-card .row.g-3 {
        --bs-gutter-x: .75rem;
        --bs-gutter-y: .75rem;
    }
}

/* orange badge */
.f-badge-pending {
    background: linear-gradient(45deg, #ffc107, #fd7e14);
    color: #ffffff;
}

/* time */
.f-timestamp {
    font-size: .85em;
    color: #6c757d;
}

/* empty */
.f-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.f-empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: .5;
}

/* custom modal footer */
.f-modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    padding: .75rem;
    border-top: 1px solid #dee2e6;
    margin-top: 1rem;
}

.f-modal-footer .f-global-btn {
    width: 100%;
}

/* utility: stack vertically (full width) */
.f-modal-footer.stack {
    grid-template-columns: 1fr;
}

/* media */
@media (max-width: 576px) {
    .f-pending .pending-card {
        overflow: hidden;
    }

    .f-pending .pending-card .card-body {
        padding: 0;
        margin: -15px;
    }

    .f-global-actions {
        display: flex !important;
        flex-direction: column;
        gap: .5rem;
    }

    .f-global-actions .f-global-btn {
        width: 100%;
    }

    .f-modal-footer.stack-sm {
        grid-template-columns: 1fr;
    }
}

/*************************/
/* authorized_list.html  */
/* Consolidated & cleaned*/
/*************************/

/* ===== Section titles ===== */
.f-authorized-car-title {
    background: #495057;
    color: #fff;
}

/* ===== Search form (input + buttons) ===== */
.f-authorized-search-form {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.f-authorized-search-input {
    flex-grow: 1;
    height: 38px;
}

.f-authorized-search-btn,
.f-authorized-search-reset {
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.f-authorized-search-btn {
    width: 44px;
}

.f-authorized-search-reset {
    min-width: 70px;
    font-size: 0.85rem;
}

/* ===== Card container ===== */
.f-authorized-card {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 0.75rem;
    padding: .75rem;
    overflow: hidden;
    box-sizing: border-box;
}

/* Grid that distributes N steps evenly.
   Change --steps on a specific container if needed (e.g., vehicle flow). */
.f-authorized-card .step-container {
    --steps: 5;
    display: grid;
    grid-template-columns: repeat(var(--steps), 1fr);
    align-items: start;
    position: relative;
}

/* Full-width connecting line (behind circles).
   Works for both standard flow and vehicle flow (1st ↔ last column). */
.f-authorized-card .step-container::before {
    content: "";
    position: absolute;
    top: 16px;
    left: calc(50% / var(--steps));
    right: calc(50% / var(--steps));
    height: 4px;
    background: #ccc;
    z-index: 0;
}

/* Each step cell */
.f-authorized-card .step-wrapper {
    min-width: 0;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Circle visual (match legacy look) */
.f-authorized-card .step {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-inline: auto;
    line-height: 1;
    background-color: #ccc;
    color: #fff;
    font-weight: bold;
    font-size: 1.1rem;
    border: 0;
}

/* Labels under circles */
.f-authorized-card .step-label {
    margin-top: 5px;
    font-size: .8rem;
    color: #333;
    line-height: 1.1;
    white-space: nowrap;
}

/* States */
.f-authorized-card .step.done {
    background-color: #198754;
    color: #fff;
}

.f-authorized-card .step.active {
    background-color: #dc3545;
    color: #fff;
}

.f-authorized-tick {
    color: #fff;
    font-weight: 900;
    font-size: 1.2rem;
    line-height: 1;
}

/* ===== Small screens: slightly smaller circles & labels ===== */
@media (max-width: 420px) {
    .f-authorized-card .step {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .f-authorized-card .step-label {
        font-size: .8rem;
    }
}


/* ========== VEHICLE FLOW (step 1 on col 1, step 2 on last col) ====== */
/* Place 1st and 2nd circles at the extremes (1 and --steps) */
.f-authorized-card .step-container.f-vehicle-steps {
    --steps: 5;
}

.f-authorized-card .step-container.f-vehicle-steps .step-wrapper:first-child {
    grid-column: 1;
}

.f-authorized-card .step-container.f-vehicle-steps .step-wrapper:last-child {
    grid-column: var(--steps);
}

/* Prevent inner per-step connectors (we rely on the full container ::before line) */
.f-authorized-card .step-container.f-vehicle-steps .step-wrapper::after {
    content: none !important;
    display: none !important;
}


/**********************************/
/* checklist_part1 and part2.html */
/**********************************/

.f-check-name {
    font-size: 1.8rem;
    color: red;
    font-weight: bold;
    text-align: center;
    margin-bottom: 1rem;
}

/*************************/
/* recognize_qrcode.html */
/*************************/

#qr-reader {
    width: 100%;
    height: 100%;
}

.qr-reader-frame {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1/1;
    /* quadrado perfeito */
    overflow: hidden;
    /* corta o que passar */
    background: black;
}

#qr-reader video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Overlay */
.f-qr-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
    /* garante que fica por cima do vídeo */
}

.f-qr-overlay::before {
    content: "";
    width: 200px;
    /* tamanho do quadrado */
    height: 200px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    /* escurece fora do quadrado */
    border: 3px solid #fff;
    /* borda do quadrado */
    border-radius: 6px;
}


/***********************/
/* recognize_face.html */
/***********************/

.f-recognize-instruction-text {
    font-size: 0.9rem !important;
    width: 100% !important;     
}

/*************/
/* home.html */
/*************/

.menu-btn {
    font-size: 1.1rem;     
    padding: 0.6rem 1rem;  
    font-weight: 600;
    max-width: 280px;

    background-color: #e9ecef; /* cinza clarinho (Bootstrap usa esse tom em cards) */
    color: #212529;            /* preto/cinza escuro */
    border: 1px solid #ced4da; /* borda suave pra dar definição */
}

.menu-btn:hover {
    background-color: #dee2e6; /* um pouco mais escuro no hover */
    color: #000;
}

/***************/
/* navbar.html */
/***************/

.navbar-bg {
    background-color: #ebe8e2; 
}

/* Hide Bootstrap's default dropdown arrow */
.navbar .dropdown-toggle::after {
    display: none;
}

/* Default link style */
.navbar .nav-link {
    color: #2c2c2c;         
    font-weight: 600;       
    transition: color 0.2s ease;
}

/* Link hover effect */
.navbar .nav-link:hover {
    color: #28a745;         
}

/* Underline animation only on the label text (not icons) */
.navbar .nav-label {
    position: relative;
    display: inline-block;
}

.navbar .nav-label::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    height: 2px;
    width: 0;
    background-color: #28a745; 
    transition: width 0.3s ease;
}

.navbar .nav-link:hover .nav-label::after {
    width: 100%;
}

/* Icon styles */
.navbar .nav-link i {
    color: #b74a4a;          
    margin-right: 2px;       
    transition: color 0.3s ease;
}

.navbar .nav-link:hover i {
    color: #28a745;          
}

/* Dropdown menu background */
.dropdown-menu {
    background-color: #ebe8e2; 
}

/* Hover do item dentro do dropdown */
.dropdown-menu .dropdown-item:hover {
    background-color: #28a745;   /* fundo verde no hover */
    color: #fff;                 /* texto branco */
}

/* Ícones dentro do dropdown */
.dropdown-menu .dropdown-item i {
    color: #b74a4a;              /* cor padrão do ícone */
    margin-right: 2px;
    transition: color 0.3s ease;
}

/* Ícone no hover do item */
.dropdown-menu .dropdown-item:hover i {
    color: #fff;                 /* muda pro branco junto com o texto */
}

/* submenu dentro do dropdown */
.dropdown-submenu {
  position: relative;
}

.dropdown-submenu > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -1px;
}
