/**
 * Estilos do Sistema de Consulta por Agente
 *
 * @author Deltaway
 * @version 1.0.0
 */

/* ============================================================================
   Variáveis CSS (podem ser sobrescritas inline)
   ============================================================================ */
:root {
    --cor-primaria: #0F74B7;
    --cor-secundaria: #112058;
    --cor-hover: #002B4A;
    --cor-sucesso: #28a745;
    --cor-erro: #dc3545;
    --cor-warning: #ffc107;
    --cor-info: #17a2b8;
    --border-radius: 8px;
    --transition-speed: 0.3s;
}

/* ============================================================================
   Reset e Base
   ============================================================================ */
* {
    box-sizing: border-box;
}

body.consulta-context {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   Modal de Informações
   ============================================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 15px;
}

.modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--cor-primaria);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-title {
    margin: 0;
    font-size: 1.3em;
    color: #333;
}

#modal-content {
    padding: 20px;
    color: #555;
    line-height: 1.6;
}

.modal-actions {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================================================
   Formulário de Consulta
   ============================================================================ */
.consulta-infracao__container-form {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.consulta-infracao__form {
    max-width: 600px;
    margin: 0 auto;
}

.consulta-input-container {
    position: relative;
    margin-bottom: 15px;
}

.consulta-input-container:last-child {
    margin-bottom: 0;
}

.consulta-infracao__input-text {
    width: 100%;
    padding: 20px 18px; /* Maior padding vertical */
    font-size: 18px; /* Fonte maior */
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
    background: white;
    min-height: 56px; /* Altura mínima consistente */
    box-sizing: border-box;
}

.consulta-infracao__input-text:focus {
    outline: none;
    border-color: var(--cor-primaria);
    box-shadow: 0 0 0 3px rgba(15, 116, 183, 0.1);
}

/* Estados de validação */
.consulta-infracao__input-text.valid {
    border-color: var(--cor-sucesso);
    background-color: rgba(40, 167, 69, 0.05);
}

.consulta-infracao__input-text.invalid {
    border-color: var(--cor-erro);
    background-color: rgba(220, 53, 69, 0.05);
}

/* Floating Labels */
.floating-label {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    font-size: 12px;
    color: #999;
    pointer-events: none;
    transition: all var(--transition-speed);
    background: white;
    padding: 0 5px;
    z-index: 1;
    opacity: 0;
}

.floating-label.active {
    opacity: 1;
    top: -10px;
    left: 10px;
    transform: translateY(0);
    font-size: 10px;
    font-weight: 700;
    color: var(--cor-primaria);
}

/* Botão Consultar */
.consulta-infracao__btn-primary,
#btn-consultar {
    width: 100%; /* Largura fixa em vez de 100% */
    padding: 18px 32px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    background-color: var(--cor-secundaria);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    margin: 20px auto 0; /* Centralizado com margem */
    display: block;
    min-height: 56px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.consulta-infracao__btn-primary:hover:not(:disabled),
#btn-consultar:hover:not(:disabled) {
    background-color: var(--cor-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 26, 51, 0.3);
}

.consulta-infracao__btn-primary:disabled,
#btn-consultar:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.consulta-infracao__btn-primary:active:not(:disabled),
#btn-consultar:active:not(:disabled) {
    transform: translateY(0);
}

/* Loader */
.loader {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* ============================================================================
   Sistema de Banners
   ============================================================================ */
#banner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--cor-primaria);
    z-index: 99999;
    display: none;
    flex-direction: column;
}

#banner-overlay.active {
    display: flex;
}

.banner-header {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cor-secundaria);
}

.banner-header img {
    max-height: 200px;
    max-width: 80%;
    object-fit: contain;
}

.banner-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

.banner-content img,
.banner-content video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-speed);
}

.banner-content img:hover,
.banner-content video:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.banner-footer {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cor-secundaria);
}

/* Desktop - altura reduzida para 150px */

.banner-footer button {
    padding: 25px 80px;
    font-size: 28px;
    font-weight: bold;
    color: white;
    background-color: var(--cor-primaria);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.banner-footer button:hover {
    background-color: var(--cor-hover);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Telas médias e desktop - altura ajustada */
@media (min-width: 769px) and (max-width: 1200px) {
    .banner-header {
        height: 150px;
    }

    .banner-header img {
        max-height: 120px;
        max-width: 60%;
    }

    .banner-footer {
        height: 150px;
    }

    .banner-footer button {
        padding: 18px 60px;
        font-size: 24px;
    }
}

/* Telas grandes e ultra-wide - otimizado */
@media (min-width: 1201px) and (max-width: 1600px) {
    .banner-header {
        height: 120px;
    }

    .banner-header img {
        max-height: 100px;
        max-width: 50%;
    }

    .banner-footer {
        height: 120px;
    }

    .banner-footer button {
        padding: 16px 50px;
        font-size: 22px;
    }
}

/* Ultra-wide e telas muito grandes */
@media (min-width: 1601px) {
    .banner-header {
        height: 100px;
    }

    .banner-header img {
        max-height: 80px;
        max-width: 40%;
    }

    .banner-footer {
        height: 100px !important;
    }

    .banner-footer button {
        padding: 14px 40px !important;
        font-size: 20px !important;
    }

}

/* ============================================================================
   Responsividade
   ============================================================================ */
@media (max-width: 768px) {
    .consulta-infracao__container-form {
        padding: 20px;
    }

    .consulta-infracao__input-text {
        font-size: 18px; /* Maior no mobile */
        padding: 18px 16px;
        margin-bottom: 20px;
        min-height: 54px;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }

    .consulta-infracao__btn-primary,
    #btn-consultar {
        font-size: 18px;
        padding: 18px 24px;
        margin: 15px auto 0;
        display: block;
        min-height: 54px;
    }

    .consulta-input-container {
        margin-bottom: 12px;
    }

    .banner-header,
    .banner-footer {
        height: 250px;
    }

    .banner-footer button {
        padding: 20px 60px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .consulta-infracao__container-form {
        padding: 15px;
    }

    .consulta-infracao__input-text {
        font-size: 17px; /* Maior no mobile pequeno */
        padding: 16px 14px;
        margin-bottom: 18px;
        min-height: 50px;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }

    .consulta-infracao__btn-primary,
    #btn-consultar {
        font-size: 17px;
        padding: 16px 20px;
        min-height: 50px;
        margin: 12px auto 0;
    }

    .consulta-input-container {
        margin-bottom: 10px;
    }

    .floating-label {
        font-size: 10px;
    }

    .modal {
        width: 95%;
    }

    .banner-header,
    .banner-footer {
        height: 200px;
    }

    .banner-footer button {
        padding: 15px 40px;
        font-size: 20px;
    }
}

/* ============================================================================
   Totem Mode (1080x1920)
   ============================================================================ */
@media (width: 1080px) and (height: 1920px) {
    .consulta-infracao__container-form {
        padding: 50px;
    }

    .consulta-infracao__input-text {
        font-size: 24px;
        padding: 25px;
    }

    .floating-label {
        font-size: 22px;
    }

    .floating-label.active {
        font-size: 16px;
    }

    .consulta-infracao__btn-primary {
        font-size: 28px;
        padding: 30px;
    }
}

/* ============================================================================
   Utilidades
   ============================================================================ */
.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* ============================================================================
   Resoluções Específicas - Telas Comuns
   ============================================================================ */

/* Tablets em paisagem e desktops pequenos */
@media (min-width: 1024px) and (max-width: 1280px) {
    .consulta-infracao__input-text {
        font-size: 17px;
        padding: 18px 16px;
        min-height: 52px;
    }

    .consulta-infracao__btn-primary,
    #btn-consultar {
        font-size: 17px;
        padding: 18px 28px;
        min-height: 52px;
    }
}

/* Desktops padrão (1280px - 1440px) */
@media (min-width: 1281px) and (max-width: 1440px) {
    .consulta-infracao__input-text {
        font-size: 18px;
        padding: 16px 18px; /* Reduzido padding vertical */
        min-height: 50px;
    }

    .consulta-infracao__btn-primary,
    #btn-consultar {
        width: 100%;
        font-size: 18px;
        padding: 20px 32px;
        min-height: 56px;
    }
}

/* Desktops grandes (1441px - 1920px) */
@media (min-width: 1441px) and (max-width: 1920px) {
    .consulta-infracao__input-text {
        font-size: 19px;
        padding: 22px 20px;
        min-height: 60px;
    }

    .consulta-infracao__btn-primary,
    #btn-consultar {
        width: 100%;
        font-size: 19px;
        padding: 22px 36px;
        min-height: 60px;
    }

    .consulta-infracao__container-form-wrapper {
        padding: 30px 0;
        min-height: calc(100vh - 160px);
    }
}

/* Ultra-wide (1921px+) */
@media (min-width: 1921px) {
    .consulta-infracao__input-text {
        font-size: 20px;
        padding: 24px 22px;
        min-height: 64px;
    }

    .consulta-infracao__btn-primary,
    #btn-consultar {
        width: 100%;
        font-size: 20px;
        padding: 24px 40px;
        min-height: 64px;
    }

    .consulta-infracao__container-form-wrapper {
        padding: 40px 0;
        min-height: calc(100vh - 180px);
    }
}

/* ============================================================================
   Logo Styles for Menu Superior
   ============================================================================ */
.agent-logo-container {
    display: flex;
    align-items: center;
    text-align: center;
    justify-content: center;
    height: 100%;
}

.agent-logo {
    height: auto;
    width: 250px;
    object-fit: contain;
}

/* ============================================================================
   Container do Formulário - Layout Fluido
   ============================================================================ */
.consulta-infracao__container-form-wrapper {
    min-height: 100vh;
    padding: 25px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.consulta-infracao__container-form-wrapper .container-fluid {
    flex: 1;
}

/* ============================================================================
   Nova Área de Título - Consulta Infração
   ============================================================================ */
.consulta-titulo-area {
    background-color: #112058;
    padding: 10px 0;
    margin-top: 80px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.consulta-titulo-texto {
    color: white;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .consulta-titulo-texto {
        font-size: 24px;
    }

    .consulta-titulo-area {
        padding: 15px 0;
        margin-top: 1px;
    }

    .agent-logo {
        max-height: 40px;
        max-width: 140px;
    }
}

@media (max-width: 480px) {
    .consulta-titulo-texto {
        font-size: 20px;
    }

    .consulta-titulo-area {
        padding: 12px 0;
    }
}


/* Mobile adjustments for footer */
@media (max-width: 768px) {
    .footer-copyright-area {
        padding: 12px 0;
    }

    .footer-copyright-area .footer-copy-right p {
        font-size: 12px;
    }
}

/* ============================================================================
   Breadcome Area Footer - Otimizações Mobile
   ============================================================================ */
.breadcome-area-footer {
    background-color: #f5f5f5;
    padding: 8px 0;
    margin-top: auto;
    position: relative;
    z-index: 10;
}

.breadcome-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.breadcome-area-footer .row {
    margin: 0;
}

/* Logo no Footer - Tamanho aumentado */
.breadcome-area-footer img {
    width: 180px !important;
    height: auto !important;
    max-width: 100%;
    transition: all 0.3s ease;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .breadcome-area-footer {
        padding: 6px 0;
    }

    .breadcome-list {
        gap: 3px;
    }

    .breadcome-area-footer img {
        width: 120px !important;
    }
}

@media (max-width: 480px) {
    .breadcome-area-footer {
        padding: 5px 0;
    }

    .breadcome-list {
        gap: 2px;
    }

    .breadcome-area-footer img {
        width: 110px !important;
    }
}

/* Garantir que o botão de consulta não seja tapado - Abordagem Moderna Otimizada */
.consulta-infracao__container-form-wrapper {
    min-height: calc(100vh - 250px); /* Reduzido espaço footer */
    padding-bottom: 15px;
}

@media (max-width: 768px) {
    .consulta-infracao__container-form-wrapper {
        min-height: calc(100vh - 200px);
        padding-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .consulta-infracao__container-form-wrapper {
        min-height: calc(100vh - 180px);
        padding-bottom: 8px;
    }
}


/* ============================================================================
   Print Styles
   ============================================================================ */
@media print {
    #banner-overlay,
    .banner-header,
    .banner-footer,
    .modal-overlay {
        display: none !important;
    }
}
