/* MQR — Sistema de Queixas e Reclamações — Custom Styles */

:root {
    --mqr-primary: #1F2937;
    --mqr-secondary: #6c757d;
    --mqr-success: #059669;
    --mqr-danger: #DC2626;
    --mqr-warning: #D97706;
    --mqr-info: #2563EB;
    --mqr-border-radius: 8px;
    --mqr-shadow: 0 1px 3px rgba(0,0,0,.08);
    --mqr-shadow-lg: 0 4px 12px rgba(0,0,0,.15);
}

/* ── Global ── */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #F9FAFB;
    color: #1F2937;
}

/* ── Cards ── */
.card {
    border-radius: var(--mqr-border-radius);
    box-shadow: var(--mqr-shadow);
    transition: box-shadow .2s ease;
}

.card:hover { box-shadow: var(--mqr-shadow-lg); }

.card-header {
    border-bottom: 1px solid #E5E7EB;
    font-weight: 600;
    padding: .85rem 1.25rem;
    border-radius: var(--mqr-border-radius) var(--mqr-border-radius) 0 0 !important;
}

/* ── Botões ── */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all .2s ease;
}

.btn-dark, .btn-dark:focus {
    background-color: #1F2937 !important;
    border-color: #1F2937 !important;
    color: white !important;
}

.btn-dark:hover {
    background-color: #111827 !important;
    border-color: #111827 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,.1);
}

/* ── Forms ── */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #D1D5DB;
    padding: .6rem .9rem;
    font-size: .875rem;
    transition: all .2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--mqr-primary);
    box-shadow: 0 0 0 3px rgba(31,41,55,.15);
}

.form-label {
    font-weight: 600;
    color: #374151;
    font-size: .875rem;
    display: block;
}

/* intl-tel-input — forçar largura total para alinhar com os outros campos */
.iti { width: 100%; }

/* ── Badges de estado ── */
.badge { font-size: .7rem; font-weight: 600; padding: .3em .6em; border-radius: 6px; }

/* ── Status Colors específicos ── */
.bg-submetida { background-color: #6B7280 !important; }
.bg-recebida { background-color: #0EA5E9 !important; }
.bg-em_triagem { background-color: #F59E0B !important; }
.bg-encaminhada { background-color: #3B82F6 !important; }
.bg-em_tratamento { background-color: #8B5CF6 !important; }
.bg-pendente { background-color: #F59E0B !important; }
.bg-respondida { background-color: #10B981 !important; }
.bg-encerrada { background-color: #1F2937 !important; }
.bg-reaberta { background-color: #EF4444 !important; }

/* ── Tables ── */
.table { background-color: white; border-radius: var(--mqr-border-radius); }
.table thead th { background-color: #F9FAFB; border-bottom: 2px solid #E5E7EB; font-weight: 600; color: #374151; font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; padding: .85rem .75rem; }
.table tbody td { padding: .75rem; vertical-align: middle; border-bottom: 1px solid #F3F4F6; font-size: .875rem; }
.table tbody tr:hover { background-color: #F9FAFB; }

/* ── Alertas ── */
.alert { border: none; border-radius: 8px; }

/* ── Summary card ── */
.summary-card {
    background: linear-gradient(135deg, #fff 0%, #F9FAFB 100%);
    border-left: 4px solid var(--mqr-primary);
    border-radius: 10px;
    box-shadow: var(--mqr-shadow);
}

/* ── Search ── */
.search-container { position: relative; }
.search-container .form-control { padding-left: 2.4rem; }
.search-container .search-icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: #9CA3AF; }

/* ── Prioridade ── */
.prioridade-baixa { border-left: 3px solid #10B981; }
.prioridade-media { border-left: 3px solid #F59E0B; }
.prioridade-alta { border-left: 3px solid #EF4444; }
.prioridade-critica { border-left: 3px solid #7F1D1D; animation: pulse-border 2s infinite; }

@keyframes pulse-border {
    0%, 100% { border-left-color: #7F1D1D; }
    50% { border-left-color: #EF4444; }
}

/* ── Responsividade ── */
@media (max-width: 576px) {
    .btn { padding: .5rem .85rem; font-size: .8rem; }
    .card-header { padding: .65rem 1rem; }
    h1.h4 { font-size: 1.1rem; }
}

/* ── Wizard — Progress Steps (igual ao projecto de referência) ── */
.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #1F2937 0%, #374151 100%);
    padding: 1.75rem 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,.3), 0 1px 3px rgba(0,0,0,.2);
    border: 1px solid #4B5563;
    position: relative;
    overflow: hidden;
}
.progress-steps::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4, #10b981);
    border-radius: 16px 16px 0 0;
}
.step {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex: 1;
    position: relative;
}
.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: calc(100% - 20px);
    width: calc(100% - 20px);
    height: 3px;
    background: linear-gradient(90deg, #4B5563, #6B7280);
    z-index: 0;
    border-radius: 2px;
    transition: background .35s;
}
.step.completed:not(:last-child)::after {
    background: linear-gradient(90deg, #10b981, #059669);
    box-shadow: 0 2px 4px rgba(16,185,129,.3);
}
.step.active:not(:last-child)::after {
    background: linear-gradient(90deg, #000000, #4B5563);
}
.step-circle {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .9rem;
    background: #374151; color: #D1D5DB;
    position: relative; z-index: 1; flex-shrink: 0;
    transition: all .3s ease;
    border: 2px solid #4B5563;
}
.step.completed .step-circle {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white; border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16,185,129,.3);
}
.step.active .step-circle {
    background: linear-gradient(135deg, #000000, #1F2937);
    color: white; border-color: #000000;
    box-shadow: 0 4px 12px rgba(0,0,0,.6);
    animation: wizPulse 2s infinite;
}
@keyframes wizPulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(0,0,0,.6); }
    50%       { box-shadow: 0 4px 20px rgba(0,0,0,.8); }
}
.step-info { display: flex; flex-direction: column; min-width: 0; }
.step-label {
    font-weight: 700; font-size: .85rem; color: #F9FAFB;
    white-space: nowrap; margin-bottom: .2rem; transition: color .3s;
}
.step.active .step-label    { color: #FFFFFF; }
.step.completed .step-label { color: #10B981; }
.step-subtitle {
    font-size: .75rem; color: #9CA3AF;
    white-space: nowrap; font-weight: 500; transition: color .3s;
}
.step.active .step-subtitle    { color: #D1D5DB; }
.step.completed .step-subtitle { color: #34D399; }

@media (max-width: 768px) {
    .progress-steps { padding: 1.25rem 1rem; flex-direction: column; gap: .65rem; }
    .progress-steps::before { display: none; }
    .step { width: 100%; justify-content: flex-start; }
    .step:not(:last-child)::after { display: none; }
    .step-circle { width: 34px; height: 34px; font-size: .8rem; }
    .step-label  { font-size: .8rem; }
    .step-subtitle { display: none; }
}

/* ── Wizard panes ── */
.wizard-pane        { display: none; }
.wizard-pane.active { display: block; animation: wizFade .3s ease; }
@keyframes wizFade {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Tipo cards ── */
.tipo-card {
    cursor: pointer; border: 2px solid #E5E7EB; border-radius: 12px;
    padding: 1.2rem 1rem; text-align: center;
    transition: all .2s ease; background: white; user-select: none; height: 100%;
}
.tipo-card:hover {
    transform: translateY(-2px); box-shadow: var(--mqr-shadow-lg);
}
.tipo-icon { font-size: 2rem; display: block; margin-bottom: .45rem; transition: color .2s; }
.tipo-label { font-size: .85rem; font-weight: 600; color: #374151; margin-bottom: .2rem; }
.tipo-desc  { font-size: .72rem; color: #9CA3AF; line-height: 1.3; }

/* Cores por tipo — normal */
.tipo-card[data-tipo="queixa"]           .tipo-icon { color: #F97316; }
.tipo-card[data-tipo="reclamacao"]       .tipo-icon { color: #EF4444; }
.tipo-card[data-tipo="denuncia"]         .tipo-icon { color: #8B5CF6; }
.tipo-card[data-tipo="sugestao"]         .tipo-icon { color: #F59E0B; }
.tipo-card[data-tipo="pedido_informacao"] .tipo-icon { color: #3B82F6; }

/* Hover */
.tipo-card[data-tipo="queixa"]:hover           { border-color: #F97316; background: #FFF7ED; }
.tipo-card[data-tipo="reclamacao"]:hover       { border-color: #EF4444; background: #FEF2F2; }
.tipo-card[data-tipo="denuncia"]:hover         { border-color: #8B5CF6; background: #F5F3FF; }
.tipo-card[data-tipo="sugestao"]:hover         { border-color: #F59E0B; background: #FFFBEB; }
.tipo-card[data-tipo="pedido_informacao"]:hover{ border-color: #3B82F6; background: #EFF6FF; }

/* Seleccionado */
.tipo-card[data-tipo="queixa"].selected           { border-color: #F97316; background: #FFF7ED; box-shadow: 0 4px 16px rgba(249,115,22,.2); }
.tipo-card[data-tipo="reclamacao"].selected       { border-color: #EF4444; background: #FEF2F2; box-shadow: 0 4px 16px rgba(239,68,68,.2); }
.tipo-card[data-tipo="denuncia"].selected         { border-color: #8B5CF6; background: #F5F3FF; box-shadow: 0 4px 16px rgba(139,92,246,.2); }
.tipo-card[data-tipo="sugestao"].selected         { border-color: #F59E0B; background: #FFFBEB; box-shadow: 0 4px 16px rgba(245,158,11,.2); }
.tipo-card[data-tipo="pedido_informacao"].selected{ border-color: #3B82F6; background: #EFF6FF; box-shadow: 0 4px 16px rgba(59,130,246,.2); }

/* Badge de tipo nas listas/detalhe */
.badge-tipo-queixa            { background: #FFEDD5; color: #9A3412; }
.badge-tipo-reclamacao        { background: #FEE2E2; color: #991B1B; }
.badge-tipo-denuncia          { background: #EDE9FE; color: #5B21B6; }
.badge-tipo-sugestao          { background: #FEF3C7; color: #92400E; }
.badge-tipo-pedido_informacao { background: #DBEAFE; color: #1E40AF; }

/* ── Upload drag-drop ── */
.upload-area {
    border: 2px dashed #D1D5DB; border-radius: 12px;
    padding: 2rem 1rem; text-align: center; cursor: pointer;
    transition: all .2s ease; background: #FAFAFA;
}
.upload-area:hover, .upload-area.dragover {
    border-color: #1F2937; background: #F3F4F6;
}
.upload-icon { font-size: 2.5rem; color: #9CA3AF; display: block; margin-bottom: .75rem; }
.upload-file-item {
    display: flex; align-items: center; gap: .6rem;
    padding: .5rem .75rem; border-radius: 8px;
    background: white; border: 1px solid #E5E7EB; margin-bottom: .4rem;
}
.upload-file-item .file-icon { font-size: 1.1rem; color: #6B7280; flex-shrink: 0; }
.upload-file-name { flex: 1; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-file-size { font-size: .75rem; color: #9CA3AF; flex-shrink: 0; }

/* ── Review step ── */
.wiz-rev-row {
    display: flex; gap: 1rem; padding: .65rem 0;
    border-bottom: 1px solid #F3F4F6; font-size: .875rem;
}
.wiz-rev-lbl {
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .4px; color: #9CA3AF; min-width: 110px;
    flex-shrink: 0; padding-top: 2px;
}
.wiz-rev-val { color: #1F2937; font-weight: 500; }

/* ── Anónimo toggle ── */
#anonimaRow { border-radius: 10px; transition: all .2s; }
#anonimaRow.anon-active { background: #F0FDF4; outline: 1px solid #10B981; }

/* ── Welcome Banner ── */
.welcome-banner {
    background: linear-gradient(135deg, #1F2937 0%, #374151 100%);
    color: white;
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 6px rgba(0,0,0,.1);
    position: relative;
}
.welcome-banner h1, .welcome-banner h2 { font-weight: 700; margin-bottom: .5rem; color: white; }
.welcome-banner p  { opacity: .9; margin: 0; }

/* ── Print ── */
@media print {
    .app-sidebar, .navbar, .footer, .btn, .breadcrumb { display: none !important; }
    body { padding-top: 0 !important; }
    .app-main-wrap { margin-left: 0 !important; max-width: 100% !important; }
}

/* ═══════════════════════════════════════════════════════════════
   WIZARD — estilos partilhados por /submeter/ e /ocorrencias/nova/
   ═══════════════════════════════════════════════════════════════ */

/* ── Toggle Anonimato ── */
.anon-toggle {
    position: relative; width: 120px; height: 44px; border-radius: 22px;
    background: #E5E7EB; border: 2px solid #D1D5DB;
    cursor: pointer; transition: all .3s; display: flex; align-items: center; padding: 3px;
    user-select: none;
}
.anon-toggle.active { background: #1F2937; border-color: #374151; }
.anon-toggle-slider {
    width: 56px; height: 36px; border-radius: 18px; background: white;
    transition: all .3s; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.2); position: relative; z-index: 1;
}
.anon-toggle.active .anon-toggle-slider { transform: translateX(56px); background: #374151; }
.anon-toggle-label {
    font-size: .8rem; font-weight: 700; transition: all .3s;
    position: absolute; pointer-events: none;
}
.anon-toggle-label.nao { left: 16px; color: #374151; opacity: 1; }
.anon-toggle.active    .anon-toggle-label.nao { opacity: 0; }
.anon-toggle-label.sim { right: 14px; color: #9CA3AF; opacity: 0; }
.anon-toggle.active    .anon-toggle-label.sim { opacity: 1; color: #FBBF24; }

/* ── Revisão Final (pane5) ── */
.review-form-section {
    background: white; border-radius: 12px; padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.review-header {
    display: flex; align-items: center; gap: 1rem;
    margin-bottom: 2rem; padding-bottom: 1.5rem;
    border-bottom: 2px solid #F3F4F6;
}
.review-number {
    width: 48px; height: 48px; border-radius: 12px;
    background: #1F2937; color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; flex-shrink: 0;
}
.review-title   { font-size: 1.4rem; font-weight: 700; color: #1F2937; margin: 0; }
.review-subtitle{ font-size: .875rem; color: #6B7280; margin: 0; }
.review-section {
    background: #F9FAFB; border: 1px solid #E5E7EB;
    border-radius: 8px; padding: 1.25rem; margin-bottom: 1.25rem;
}
.review-section h6 {
    font-weight: 700; color: #1F2937; margin-bottom: .875rem;
    display: flex; align-items: center; gap: .5rem;
}
.review-item {
    display: flex; justify-content: space-between;
    padding: .45rem 0; border-bottom: 1px solid #E5E7EB;
}
.review-item:last-child { border-bottom: none; }
.review-label { font-weight: 600; color: #6B7280; font-size: .875rem; }
.review-value { color: #1F2937; font-size: .875rem; text-align: right; max-width: 60%; }
.review-sidebar {
    background: white; border-radius: 12px; padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.review-sidebar-title { font-weight: 700; font-size: .95rem; color: #1F2937; margin-bottom: 1rem; }
.review-progress-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.review-progress-list li {
    display: flex; align-items: center; gap: .75rem;
    padding: .65rem 0; border-bottom: 1px solid #F3F4F6; font-size: .875rem; color: #6B7280;
}
.review-progress-list li:last-child { border-bottom: none; }
.review-progress-list li.active { color: #1F2937; font-weight: 600; }
.rp-icon {
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700; flex-shrink: 0;
}
.rp-icon.completed { background: #10B981; color: white; }
.rp-icon.active    { background: #1F2937; color: white; }
.rp-icon.pending   { background: #F3F4F6; color: #6B7280; }
.review-tips-list { list-style: none; padding: 0; margin: 0; }
.review-tips-list li {
    padding: .4rem 0; font-size: .8rem; color: #6B7280;
    display: flex; align-items: flex-start; gap: .5rem;
}
.review-tips-list li::before { content: '•'; color: #1F2937; font-weight: 700; flex-shrink: 0; }
.review-file-item {
    display: flex; align-items: center; gap: .75rem;
    padding: .4rem 0; border-bottom: 1px solid #E5E7EB; font-size: .875rem;
}
.review-file-item:last-child { border-bottom: none; }

/* ── Searchable comarca (província / distrito) ── */
.searchable-location { position: relative; }
.searchable-location input[list] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath d='M7.5 2a5.5 5.5 0 1 0 3.89 9.32l2.64 2.64a.75.75 0 0 0 1.06-1.06L12.41 10.3A5.5 5.5 0 0 0 7.5 2zm0 1.5a4 4 0 1 1 0 8 4 4 0 0 1 0-8z'/%3E%3C/svg%3E") no-repeat 12px center; padding-left: 2rem; }
.distrito-wrap { display: none; }
