/* ======================================
   LASCAP FIRE ESTILO INSTITUCIONAL GERAL
=========================================*/

/* ------------------ */
/* Tokens institucionais */
:root {
  --brand: #0b5f8a;           /* Azul Institucional */
  --brand-contrast: #ffffff;
  --accent-orange: #ff6f00;   /* Ação / Destaque */
  --accent-yellow: #f9c80e;
  --accent-green: #1ca66b;    /* Sucesso */
  --danger: #b00020;          /* Erro / Emergência */
  --muted: #6d7680;
  --card-bg: #ffffff;
  --bg: #f4f6f8;              /* Fundo geral suave */
  --radius: 8px;
  --shadow: 0 2px 6px rgba(0,0,0,0.12);
  --max-width: 1100px;
  --gap: 12px;
}

/* ------------------ */
/* Reset e Base */
*{box-sizing:border-box}
html,body{height:100%;margin:0;font-family:Inter,Roboto,"Helvetica Neue",Arial,sans-serif;background:var(--bg);color:#111}
a{color:inherit;text-decoration:none}
.container{max-width:var(--max-width);margin:18px auto;padding:12px}

/* ------------------ */
/* Header / Navbar */
.header {
  background: var(--brand);
  color: var(--brand-contrast);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  padding: 10px 20px;
  position: relative;
  z-index: 1000;
  box-shadow: var(--shadow);
  border-bottom: 4px solid var(--danger);
}

.header .brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.header .brand img.logo { 
  width: 58px; height: 58px; object-fit: contain;
  background-color: transparent; border: none; border-radius: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); flex-shrink: 0;
}

.header .brand div { 
  display: flex; flex-direction: column; justify-content: center;
  line-height: 1.1; margin-left: 6px; 
}
.header .brand div div:first-child { font-weight: 900; font-size: 18px; }

.header .nav { 
  display: flex; gap: 16px; align-items: center; 
  flex-wrap: wrap; justify-content: center; margin: 0 20px;
}
.header .nav a {
  color: var(--brand-contrast); padding: 8px 12px; font-weight: 700;
  border-radius: 8px; transition: background 0.2s; position: relative; opacity: 0.9;
}
.header .nav a:hover { background: rgba(255,255,255,0.15); opacity: 1; }

.header .nav a.active { background: rgba(255,255,255,0.2); opacity: 1; }
.header .nav a.active::after {
  content: ''; position: absolute; bottom: -14px; left: 50%;
  transform: translateX(-50%); width: 0; height: 0; 
  border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-top: 8px solid #fff; top: 100%; margin-top: 2px;
}

.header .actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.menu-toggle { display: none; background: transparent; border: 0; color: var(--brand-contrast); font-weight: 800; font-size: 22px; cursor: pointer; padding: 8px; }
.mobile-menu { background: var(--brand); padding: 12px 16px; border-bottom: 2px solid var(--danger); display: flex; flex-direction: column; gap: 6px; width: 100%; box-sizing: border-box; }
.mobile-menu a { color: var(--brand-contrast); padding: 10px 12px; text-align: center; border-radius: 6px; font-weight: 600; display: block; }

@media (max-width: 900px) {
  .header { padding: 10px 12px; }
  .header .brand img.logo { width: 42px; height: 42px; }
  .header .brand div div:first-child { font-size: 16px; }
  .header .brand div div:last-child { font-size: 11px; }
  .header .nav { display: none; }
  .menu-toggle { display: block; }
}

/* ------------------ */
/* Componentes Gerais */
.card { background: var(--card-bg); padding: 20px; border-radius: var(--radius); border: 1px solid #e1e4e8; box-shadow: var(--shadow); margin-bottom: 16px; }
h1,h2,h3{color:var(--brand);margin:0 0 12px 0;font-weight:700}
h2{border-bottom:2px solid var(--danger);padding-bottom:8px;margin-bottom:20px}
.muted{color:var(--muted)}
.center{text-align:center}

.btn{border:none;padding:12px 18px;border-radius:6px;cursor:pointer;font-weight:700;text-transform:uppercase;transition:0.15s; display:inline-block; text-align: center; font-size: 14px;}
.btn:hover{opacity:0.95; transform: translateY(-1px);}
.btn.primary{background:var(--brand);color:var(--brand-contrast)}
.btn.action{background:var(--accent-orange);color:#fff}
.btn.secondary{background:#e6eef3;color:var(--brand)}
.btn.secondary:hover { background: #cdd8e0; }
.btn.small{padding:8px 12px;font-size:12px}

.footer{padding:24px;text-align:center;color:var(--muted);border-top:1px solid #e6e9ec;margin-top:30px;font-size: 0.9em; background: #fff;}

/* ------------------ */
/* Estilos Específicos por Página */

/* --- APP (Ocorrências) --- */
.desc-wrapper { position: relative; }
#btnMic { 
  position: absolute; right: 10px; bottom: 10px; 
  background: #f0f0f0; border: 1px solid #ccc; border-radius: 50%; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: #0b5f8a; font-size: 20px; z-index: 10; transition: all 0.3s ease;
}
#btnMic.recording { background-color: #d9534f; color: white; border-color: #d9534f; animation: pulse 1.5s infinite; }
@keyframes pulse { 
  0% { box-shadow: 0 0 0 0 rgba(217, 83, 79, 0.7); } 
  70% { box-shadow: 0 0 0 15px rgba(217, 83, 79, 0); } 
  100% { box-shadow: 0 0 0 0 rgba(217, 83, 79, 0); } 
}
.map, #map { width: 100%; height: 350px; border-radius: 8px; border: 2px solid #e3e8ec; margin-top: 8px; margin-bottom: 12px; z-index: 1; }
.digital-stamp { border: 2px solid #0b5f8a; border-radius: 8px; background: #f4f9fc; padding: 15px; margin-top: 15px; display: flex; align-items: center; justify-content: center; gap: 15px; max-width: 90%; margin-left: auto; margin-right: auto; }
.digital-stamp img { width: 50px; height: auto; border-radius: 4px; }
.stamp-text h4 { margin: 0; color: #0b5f8a; font-weight: 800; font-size: 16px; text-transform: uppercase; }
.stamp-text p { margin: 0; color: #666; font-size: 11px; line-height: 1.3; }
.stamp-check { color: #1ca66b; font-size: 24px; }

/* Custom Alert */
.custom-alert-overlay { position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; }
.custom-alert-box { background: #fff; border-radius: 8px; width: 90%; max-width: 400px; text-align: center; box-shadow: 0 4px 20px rgba(0,0,0,0.3); overflow: hidden; }
.custom-alert-header { padding: 15px; color: white; font-size: 1.2em; font-weight: bold; background-color: #0b5f8a; }
.custom-alert-header.error { background-color: #d9534f; }
.custom-alert-header.success { background-color: #1ca66b; }
.custom-alert-body { padding: 25px; font-size: 16px; color: #333; line-height: 1.5; }
.custom-alert-footer { padding: 0 20px 20px 20px; }
#customAlertClose { width: 100%; }

/* --- CONTATO --- */
.contact-wrapper { display: flex; flex-direction: column; gap: 20px; }
.contact-row { display: flex; gap: 20px; flex-wrap: wrap; }
.contact-row .left { flex: 2; min-width: 300px; }
.contact-row .right { flex: 1; min-width: 250px; }
.input-icon { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #ccd0d4; border-radius: 6px; padding: 0 12px; transition: border 0.3s; }
.input-icon:focus-within { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(11, 95, 138, 0.1); }
.input-icon input, .input-icon textarea { border: none !important; margin-top: 0 !important; padding: 14px 0 !important; background: transparent !important; outline: none !important; width: 100%; }
.success-box { background-color: #d4edda; color: #155724; padding: 15px; border-radius: 6px; border: 1px solid #c3e6cb; margin-top: 15px; display: none; text-align: center; font-weight: 600; }

/* --- PERFIL --- */
.profile-card { max-width: 450px; margin: 40px auto; padding: 30px; border-top: 6px solid var(--brand); }
.profile-avatar { text-align: center; margin-bottom: 25px; }
.profile-avatar i { font-size: 50px; color: #0b5f8a; background: #eef5f9; border-radius: 50%; padding: 25px; width: 100px; height: 100px; display: inline-flex; align-items: center; justify-content: center; }
.profile-section-title { font-size: 13px; text-transform: uppercase; color: var(--muted); letter-spacing: 0.5px; font-weight: 700; margin: 25px 0 10px 0; border-bottom: 1px solid #eee; padding-bottom: 5px; }

/* --- AJUDA --- */
.help-hero { text-align: center; padding: 20px; margin-bottom: 20px; }
.help-search { width: 100%; max-width: 500px; margin: 0 auto; padding: 12px; border-radius: 30px; border: 2px solid #e1e4e8; font-size: 16px; padding-left: 20px; }
details { border: 1px solid #e1e4e8; border-radius: 8px; margin-bottom: 10px; background: #fff; overflow: hidden; transition: all 0.3s ease; }
details[open] { border-color: var(--brand); box-shadow: 0 4px 10px rgba(11, 95, 138, 0.08); }
summary { padding: 15px; cursor: pointer; font-weight: 600; color: #333; display: flex; align-items: center; justify-content: space-between; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '\f078'; font-family: "Font Awesome 6 Free"; font-weight: 900; color: var(--muted); transition: transform 0.3s; }
details[open] summary::after { transform: rotate(180deg); color: var(--brand); }
details[open] summary { background: #f8fbff; color: var(--brand); border-bottom: 1px solid #f0f0f0; }
details p { padding: 20px; margin: 0; line-height: 1.6; color: #555; }
.feedback-card { background: #f4f9fc; border: 1px dashed #0b5f8a; padding: 20px; text-align: center; border-radius: 8px; margin-top: 30px; }
.feedback-actions { display: flex; gap: 15px; justify-content: center; margin-top: 15px; }
.feedback-btn { background: #fff; border: 1px solid #ccc; padding: 8px 20px; border-radius: 20px; cursor: pointer; font-weight: 600; color: #555; transition: 0.2s; }
.feedback-btn:hover { border-color: var(--brand); color: var(--brand); }
.feedback-btn.active { background: var(--brand); color: white; border-color: var(--brand); }

/* --- HOME (Index) --- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
main.container { animation: fadeInUp 0.8s ease-out forwards; }
.hero-container { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px; }
.hero-text { flex: 1; }
.hero-img { flex: 0 0 200px; display: flex; justify-content: center; }
.hero-img img { width: 100%; max-width: 180px; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 4px solid #fff; }
.hero-buttons .btn { transition: all 0.3s ease; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.hero-buttons .btn:hover { transform: translateY(-3px); box-shadow: 0 7px 14px rgba(0,0,0,0.15); }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(250px,1fr)); gap: 20px; margin-top: 15px; }
.service-card { text-align: center; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); cursor: default; border: 1px solid transparent; }
.service-card:hover, .service-card:active { transform: translateY(-8px) scale(1.03); box-shadow: 0 15px 30px rgba(11, 95, 138, 0.15); border-color: rgba(11, 95, 138, 0.2); z-index: 2; }
.service-icon { font-size: 36px; margin-bottom: 15px; display: block; transition: transform 0.3s ease; }
.service-card:hover .service-icon { transform: scale(1.1); }

/* ------------------ */
/* Formulários Globais (Login, Perfil, Contato) */
label { display: block; margin-bottom: 6px; font-weight: 700; color: #0b5f8a !important; font-size: 14px; margin-top: 15px; }
label:first-child { margin-top: 0; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="date"], select, textarea {
  width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 15px; background: #fff; transition: border 0.3s, box-shadow 0.3s; font-family: inherit; color: #333;
}
input:focus, select:focus, textarea:focus { border-color: #0b5f8a; outline: none; box-shadow: 0 0 0 3px rgba(11, 95, 138, 0.1); }
input:disabled, textarea:disabled { background-color: #f2f4f6; color: #666; border-color: #dbe0e4; cursor: not-allowed; }

/* ------------------ */
/* Layout de Cartão Dividido (Login/Perfil/Minha Conta) */
body.centered-layout { display: flex; flex-direction: column; min-height: 100vh; }
main.centered-content { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; }
.split-card-wrapper { background: #fff; border-radius: 12px; box-shadow: 0 15px 35px rgba(0,0,0,0.1); width: 100%; max-width: 900px; overflow: hidden; display: flex; animation: fadeInUp 0.6s ease-out; }
.split-side-visual { background: linear-gradient(135deg, #0b5f8a 0%, #063d5a 100%); width: 40%; padding: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: white; }
.split-side-visual h2 { color: white !important; margin: 0 0 10px 0; font-size: 1.8rem; }
.split-side-visual p { color: rgba(255,255,255,0.9); font-size: 0.95rem; margin: 0; }
.split-icon-large { font-size: 50px; margin-bottom: 20px; width: 100px; height: 100px; background: rgba(255,255,255,0.1); border: 2px solid rgba(255,255,255,0.3); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.split-side-form { width: 60%; padding: 50px; display: flex; flex-direction: column; justify-content: center; }
.btn-google-split { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3); color: white; width: 100%; padding: 12px; border-radius: 6px; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; margin-top: 30px; transition: 0.3s; font-weight: 600; font-size: 14px; }
.btn-google-split:hover { background: rgba(255,255,255,0.2); }

/* =========================================
   BANNER DE INSTALAÇÃO PWA (Via Shared.js)
   ========================================= */
.pwa-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: rgba(11, 95, 138, 0.95); /* Azul Lascap */
    backdrop-filter: blur(10px);
    color: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    display: none; /* Começa oculto */
    flex-direction: column;
    gap: 15px;
    z-index: 9999;
    animation: slideUp 0.5s ease-out;
    border: 1px solid rgba(255,255,255,0.1);
}

.pwa-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pwa-text {
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', sans-serif;
}

.pwa-text strong { font-size: 16px; }
.pwa-text span { font-size: 12px; opacity: 0.8; }

.pwa-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-install {
    background: white;
    color: #0b5f8a;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-install:active { transform: scale(0.95); }

.btn-dismiss {
    background: transparent;
    color: rgba(255,255,255,0.7);
    border: none;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 13px;
}

@keyframes slideUp {
    from { transform: translate(-50%, 100px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* ==========================================================
   LAYOUT MOBILE: TEXTOS VISÍVEIS E ALINHAMENTO LINEAR
   ========================================================== */
@media (max-width: 768px) {

    /* 1. CABEÇALHO (Header) - Container Flexível */
    .header {
        padding: 5px 10px; /* Padding fino para ganhar pixels */
        height: 60px;
        justify-content: space-between;
        gap: 5px;
    }

    /* 2. LOGO E TÍTULO (Ficam menores para dar espaço aos botões) */
    .brand {
        flex-shrink: 1; /* Permite encolher se necessário */
        min-width: 0;   /* Permite que o texto corte se for muito longo */
        gap: 8px;
    }

    .brand img.logo {
        width: 38px; /* Logo discreta */
        height: 38px;
    }

    .brand div div:first-child {
        font-size: 13px !important; /* Fonte do título menor */
        white-space: nowrap;
    }

    /* ESCONDE O SUBTÍTULO ("Sistema de Ocorrências") NO CELULAR */
    /* Isso é o segredo para liberar espaço para os botões de ação */
    .brand div div:last-child {
        display: none !important;
    }
    
    /* Esconde o e-mail (necessário no painel) */
    .user-email-display { display: none !important; }

    /* 3. BOTÕES DE AÇÃO (Linear e com Texto) */
    .header .actions {
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        gap: 6px !important; /* Espaço pequeno entre botões */
        flex-shrink: 0; /* Garante que os botões NÃO encolham */
    }

    .header .actions .btn {
        width: auto !important;
        padding: 6px 10px !important; /* Padding confortável */
        height: 34px !important;
        font-size: 11px !important; /* Texto pequeno mas legível */
        display: flex !important;
        align-items: center;
        gap: 5px; /* Distância ícone-texto */
        white-space: nowrap; /* Não deixa o texto quebrar linha */
    }

    /* Ícones dentro dos botões */
    .header .actions .btn i {
        font-size: 12px !important;
        margin: 0 !important;
        display: block !important;
    }

    /* GARANTE QUE O TEXTO APAREÇA */
    .header .actions .btn span {
        display: inline-block !important;
        font-weight: 700;
        text-transform: uppercase;
    }

    /* Ajuste do Botão Menu (Hambúrguer) */
    .menu-toggle {
        font-size: 22px;
        padding: 0 0 0 5px;
        margin: 0;
    }

    /* --- RESTO DOS ESTILOS MOBILE (MANTIDOS) --- */
    .hero-container { flex-direction: column-reverse !important; text-align: center; }
    .hero-img { margin-bottom: 15px; }
    .hero-buttons { display: flex !important; flex-direction: column !important; width: 100% !important; gap: 15px !important; margin-top: 20px; }
    .hero-buttons .btn { width: 100% !important; display: flex; justify-content: center; align-items: center; padding: 15px !important; margin: 0 !important; }
    .split-card-wrapper { flex-direction: column; max-height: none; }
    .split-side-visual { width: 100%; padding: 30px 20px; flex-direction: row; justify-content: flex-start; gap: 15px; text-align: left; }
    .split-icon-large { width: 60px; height: 60px; font-size: 24px; margin: 0; }
    .btn-google-split { display: none; }
    .split-side-form { width: 100%; padding: 30px 20px; }
}