/* =====================================================
   PORTAL IMOBILIÁRIO - CSS GLOBAL
   ===================================================== */

/* ==================== VARIÁVEIS ==================== */
:root {
    /* Cores principais */
    --azul: #1E3A8A;
    --azul-escuro: #172554;
    --azul-claro: #3B82F6;
    --laranja: #F97316;
    --laranja-escuro: #EA580C;
    --laranja-claro: #FB923C;
    
    /* Neutras */
    --branco: #FFFFFF;
    --preto: #0F172A;
    --cinza-50: #F8FAFC;
    --cinza-100: #F1F5F9;
    --cinza-200: #E2E8F0;
    --cinza-300: #CBD5E1;
    --cinza-400: #94A3B8;
    --cinza-500: #64748B;
    --cinza-600: #475569;
    --cinza-700: #334155;
    --cinza-800: #1E293B;
    --cinza-900: #0F172A;
    
    /* Estados */
    --sucesso: #10B981;
    --erro: #EF4444;
    --aviso: #F59E0B;
    --info: #3B82F6;
    
    /* Sombras */
    --sombra-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --sombra: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --sombra-md: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --sombra-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --sombra-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    
    /* Espaçamento */
    --container: 1280px;
    --espaco-xs: 0.5rem;
    --espaco-sm: 1rem;
    --espaco-md: 1.5rem;
    --espaco-lg: 2rem;
    --espaco-xl: 3rem;
    --espaco-2xl: 4rem;
    
    /* Bordas */
    --raio-sm: 6px;
    --raio: 10px;
    --raio-md: 14px;
    --raio-lg: 20px;
    --raio-xl: 30px;
    --raio-full: 9999px;
    
    /* Transições */
    --transicao: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transicao-rapida: all 0.15s ease;
}

/* ==================== RESET ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--cinza-800);
    background: var(--branco);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--azul);
    text-decoration: none;
    transition: var(--transicao);
}

a:hover {
    color: var(--laranja);
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ==================== TIPOGRAFIA ==================== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--cinza-900);
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--cinza-600);
}

strong, b {
    font-weight: 700;
    color: var(--cinza-900);
}

/* ==================== CONTAINER ==================== */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ==================== BOTÕES ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: var(--raio-full);
    cursor: pointer;
    transition: var(--transicao);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Botão primário (laranja) */
.btn-primary {
    background: var(--laranja);
    color: var(--branco);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.btn-primary:hover {
    background: var(--laranja-escuro);
    color: var(--branco);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
}

/* Botão secundário (azul) */
.btn-secondary {
    background: var(--azul);
    color: var(--branco);
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3);
}

.btn-secondary:hover {
    background: var(--azul-escuro);
    color: var(--branco);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.4);
}

/* Botão outline */
.btn-outline {
    background: transparent;
    border-color: var(--cinza-300);
    color: var(--cinza-700);
}

.btn-outline:hover {
    background: var(--azul);
    border-color: var(--azul);
    color: var(--branco);
    transform: translateY(-2px);
}

/* Botão outline branco (para header) */
.btn-outline-light {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--branco);
}

.btn-outline-light:hover {
    background: var(--branco);
    border-color: var(--branco);
    color: var(--azul);
}

/* Botão grande */
.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
}

/* Botão pequeno */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Botão bloco */
.btn-block {
    width: 100%;
}

/* ==================== FORMULÁRIOS ==================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cinza-700);
}

.form-label .obrigatorio {
    color: var(--erro);
    margin-left: 3px;
}

.form-control,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--cinza-800);
    background: var(--branco);
    border: 2px solid var(--cinza-200);
    border-radius: var(--raio);
    transition: var(--transicao);
}

.form-control:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--azul);
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.1);
}

.form-control::placeholder,
.form-textarea::placeholder {
    color: var(--cinza-400);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--cinza-500);
}

.form-error {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--erro);
    font-weight: 500;
}

/* ==================== MENSAGENS FLASH ==================== */
.flash-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    width: calc(100% - 40px);
}

.flash {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: var(--branco);
    border-radius: var(--raio);
    box-shadow: var(--sombra-lg);
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.flash-sucesso { border-color: var(--sucesso); }
.flash-sucesso .flash-icon { color: var(--sucesso); }

.flash-erro { border-color: var(--erro); }
.flash-erro .flash-icon { color: var(--erro); }

.flash-aviso { border-color: var(--aviso); }
.flash-aviso .flash-icon { color: var(--aviso); }

.flash-info { border-color: var(--info); }
.flash-info .flash-icon { color: var(--info); }

.flash-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.flash-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--cinza-700);
}

.flash-close {
    background: none;
    border: none;
    color: var(--cinza-400);
    font-size: 1rem;
    cursor: pointer;
    padding: 5px;
    transition: var(--transicao);
}

.flash-close:hover {
    color: var(--cinza-800);
}

/* ==================== UTILITÁRIOS ==================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--azul) !important; }
.text-orange { color: var(--laranja) !important; }
.text-success { color: var(--sucesso) !important; }
.text-danger { color: var(--erro) !important; }
.text-muted { color: var(--cinza-500) !important; }

.bg-light { background: var(--cinza-50) !important; }
.bg-white { background: var(--branco) !important; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* ==================== ANIMAÇÕES ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in { animation: fadeIn 0.5s ease; }
.fade-in-up { animation: fadeInUp 0.5s ease; }

/* ==================== RESPONSIVO ==================== */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .flash-container {
        top: 80px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }
    
    .btn {
        padding: 11px 20px;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 14px 26px;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 10px 18px;
        font-size: 0.85rem;
    }
}

    /* =====================================================
   HEADER MOBILE - CORREÇÃO DEFINITIVA
   ===================================================== */

/* Esconder o botão hamburger no desktop */
.menu-toggle {
    display: none !important;
}

/* Até 900px — esconde menu lateral e mostra hamburger */
@media screen and (max-width: 900px) {

    /* Header: dar espaço pros botões */
    .header .container {
        gap: 10px !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }

    /* Logo menor pra caber */
    .logo-icon {
        width: 38px !important;
        height: 38px !important;
    }

    .logo-text strong,
    .logo-text span {
        font-size: 0.95rem !important;
    }

    .logo-text small {
        font-size: 0.55rem !important;
        letter-spacing: 2px !important;
    }

    /* Esconder botões "Entrar" e "Registar" no mobile */
    .header-actions .btn-outline,
    .header-actions .btn-primary {
        display: none !important;
    }

    /* Mostrar o hamburger */
    .menu-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 42px;
        height: 42px;
        background: var(--cinza-100, #F1F5F9);
        border: 1px solid var(--cinza-200, #E2E8F0);
        border-radius: 10px;
        color: var(--azul, #1E3A8A);
        font-size: 1.2rem;
        cursor: pointer;
        margin-left: auto;
        flex-shrink: 0;
    }

    .menu-toggle:hover,
    .menu-toggle:active {
        background: var(--azul, #1E3A8A);
        color: #fff;
        border-color: var(--azul, #1E3A8A);
    }

    /* Menu lateral (drawer) */
    .nav {
        position: fixed !important;
        top: 0;
        left: -100% !important;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: #fff;
        box-shadow: 5px 0 30px rgba(0, 0, 0, 0.15);
        z-index: 1002 !important;
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 90px 20px 30px;
        overflow-y: auto;
        display: block !important;
        flex-direction: column !important;
    }

    .nav.active {
        left: 0 !important;
    }

    /* Menu vertical */
    .nav-menu {
        flex-direction: column !important;
        gap: 6px !important;
        width: 100%;
        list-style: none;
    }

    .nav-menu a {
        display: block !important;
        width: 100% !important;
        padding: 14px 18px !important;
        font-size: 1rem !important;
        border-radius: 10px;
        text-align: left;
        color: #334155;
        background: transparent;
    }

    .nav-menu a:hover {
        background: #F1F5F9;
    }

    .nav-menu a.active {
        background: var(--azul, #1E3A8A) !important;
        color: #fff !important;
    }

    .nav-menu a.active::after {
        display: none !important;
    }

    /* Botões Entrar/Registar DENTRO do menu mobile */
    .nav-mobile-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 25px;
        padding-top: 20px;
        border-top: 1px solid #E2E8F0;
    }

    .nav-mobile-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Telas muito pequenas — ajustes finos */
@media screen and (max-width: 480px) {
    .logo-text strong,
    .logo-text span {
        font-size: 0.85rem !important;
    }

    .logo-text small {
        display: none;   /* esconde "ANGOLA" pra economizar espaço */
    }

    .header .container {
        padding: 8px 15px !important;
    }
}