/**
 * AlmeidaImob - Design System Unificado
 * Cores, Tipografia, Componentes e Utilitários
 * Versão: 2.0.0
 */

/* ===== VARIÁVEIS GLOBAIS ===== */
:root {
    /* Cores Primárias - Verde Esmeralda */
    --primary-color: #1a5f4a;
    --primary-dark: #144a3a;
    --primary-light: #20745a;
    --primary-rgb: 26, 95, 74;

    /* Cores Secundárias - Dourado Premium */
    --secondary-color: #c9a227;
    --secondary-dark: #a3821f;
    --secondary-light: #e0b830;
    --secondary-rgb: 201, 162, 39;

    /* Cores de Feedback */
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;

    /* Tons Neutros */
    --neutral-950: #0a0a0a;
    --neutral-900: #171717;
    --neutral-800: #262626;
    --neutral-700: #404040;
    --neutral-600: #525252;
    --neutral-500: #737373;
    --neutral-400: #a3a3a3;
    --neutral-300: #d4d4d4;
    --neutral-200: #e5e5e5;
    --neutral-100: #f5f5f5;
    --neutral-50: #fafafa;
    --white: #ffffff;

    /* Tipografia */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Espaçamento */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Bordas */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Transições */
    --transition-fast: 150ms ease-out;
    --transition-base: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;

    /* Gradientes */
    --gradient-brand: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    --gradient-gold: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-light) 100%);
    --gradient-dark: linear-gradient(135deg, var(--neutral-900) 0%, var(--neutral-800) 100%);
    --gradient-light: linear-gradient(135deg, var(--neutral-50) 0%, var(--neutral-100) 100%);
}

/* ===== RESET E BASE ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--neutral-700);
    background-color: var(--neutral-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== TIPOGRAFIA ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--neutral-900);
    margin-bottom: var(--space-md);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    h4 {
        font-size: 1.25rem;
    }
}

p {
    margin-bottom: var(--space-md);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ===== CONTAINER ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ===== BOTÕES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.25);
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Botão Primário */
.btn-primary {
    background: var(--gradient-brand);
    color: var(--white);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Botão Secundário/Dourado */
.btn-gold,
.btn-warning {
    background: var(--gradient-gold);
    color: var(--neutral-900);
    border-color: var(--secondary-color);
}

.btn-gold:hover,
.btn-warning:hover {
    background: var(--secondary-dark);
    border-color: var(--secondary-dark);
    color: var(--white);
    transform: translateY(-2px);
}

/* Botão Outline */
.btn-outline,
.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover,
.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-outline-light {
    background: transparent;
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-outline-light:hover {
    background: var(--white);
    color: var(--primary-color);
    border-color: var(--white);
}

/* Botão Sucesso */
.btn-success {
    background: var(--success-color);
    color: var(--white);
    border-color: var(--success-color);
}

.btn-success:hover {
    background: #16a34a;
    border-color: #16a34a;
    color: var(--white);
}

/* Tamanhos */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* ===== FORMULÁRIOS ===== */
.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: var(--font-body);
    line-height: 1.5;
    color: var(--neutral-800);
    background-color: var(--white);
    background-clip: padding-box;
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    color: var(--neutral-800);
    background-color: var(--white);
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.form-label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--neutral-700);
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--neutral-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-base);
}

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

.card-body {
    padding: var(--space-lg);
}

.card-header {
    padding: var(--space-md) var(--space-lg);
    background: var(--neutral-50);
    border-bottom: 1px solid var(--neutral-200);
}

/* ===== SEÇÕES ===== */
.section {
    padding: var(--space-3xl) 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--neutral-600);
    text-align: center;
    max-width: 600px;
    margin: 0 auto var(--space-2xl);
}

.section-divider {
    width: 60px;
    height: 4px;
    background: var(--gradient-brand);
    margin: 0 auto var(--space-lg);
    border-radius: var(--radius-full);
}

/* ===== HERO SECTIONS ===== */
.hero {
    background: var(--gradient-dark);
    color: var(--white);
    padding: var(--space-3xl) 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(var(--primary-rgb), 0.1), transparent);
    pointer-events: none;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    color: var(--white);
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: var(--space-xl);
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: var(--white);
    text-align: center;
    white-space: nowrap;
    border-radius: var(--radius-full);
}

.badge-primary {
    background: var(--primary-color);
}

.badge-success {
    background: var(--success-color);
}

.badge-warning {
    background: var(--warning-color);
    color: var(--neutral-900);
}

.badge-danger {
    background: var(--danger-color);
}

.badge-info {
    background: var(--info-color);
}

/* ===== ALERTAS ===== */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
    color: #166534;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #991b1b;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: #92400e;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: #1e40af;
}

/* ===== UTILITÁRIOS ===== */
.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--secondary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-muted {
    color: var(--neutral-500) !important;
}

.text-white {
    color: var(--white) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-light {
    background-color: var(--neutral-100) !important;
}

.bg-dark {
    background-color: var(--neutral-900) !important;
}

.bg-white {
    background-color: var(--white) !important;
}

.text-gradient {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-md {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

.shadow-xl {
    box-shadow: var(--shadow-xl) !important;
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease-out;
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-md);
    }

    .section {
        padding: var(--space-2xl) 0;
    }
}

/* ===== FILTROS CONTAINER ===== */
.filters-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: var(--space-xl);
}

.filters-header {
    background: var(--gradient-brand);
    padding: var(--space-md) var(--space-lg);
}

.filters-body {
    padding: var(--space-lg);
    transition: all var(--transition-base);
}

/* ===== PAGINAÇÃO ===== */
.pagination {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: var(--radius-md);
    background: var(--white);
    border: 1px solid var(--neutral-300);
    color: var(--neutral-700);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.page-item .page-link:hover {
    background: var(--neutral-100);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* ===== NO RESULTS ===== */
.no-results {
    text-align: center;
    padding: var(--space-3xl);
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.no-results i {
    font-size: 4rem;
    color: var(--neutral-300);
    margin-bottom: var(--space-lg);
}

.no-results h3 {
    color: var(--neutral-700);
    margin-bottom: var(--space-sm);
}

.no-results p {
    color: var(--neutral-500);
}

/* ===== LOADING ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--neutral-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== ACESSIBILIDADE ===== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: var(--white);
    padding: 8px 16px;
    z-index: 100;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
}

:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== MOBILE FORM ENHANCEMENTS ===== */

/* Inputs com altura mínima para touch targets */
@media (max-width: 768px) {

    .form-control,
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    input[type="url"],
    textarea,
    select {
        min-height: var(--touch-target-min, 44px);
        font-size: 16px;
        /* Previne zoom no iOS */
        padding: 0.75rem 1rem;
    }

    /* Focus states mais visíveis */
    .form-control:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: none;
        border-color: var(--primary-color, #4E7D34);
        box-shadow: 0 0 0 3px rgba(78, 125, 52, 0.15);
    }

    /* Labels visíveis */
    label {
        font-size: 0.875rem;
        font-weight: 500;
        margin-bottom: 0.5rem;
        display: block;
    }

    /* Botões touch-friendly */
    .btn,
    button[type="submit"],
    input[type="submit"] {
        min-height: var(--touch-target-min, 44px);
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }

    /* Form groups com espaçamento adequado */
    .form-group {
        margin-bottom: 1rem;
    }
}

/* Breakpoint 480px */
@media (max-width: 480px) {

    .form-control,
    input,
    select,
    textarea {
        padding: 0.625rem 0.875rem;
    }

    .btn,
    button[type="submit"] {
        width: 100%;
        padding: 0.875rem 1rem;
    }

    .form-row,
    .form-inline {
        flex-direction: column;
        gap: 0.75rem;
    }

    .form-row>* {
        width: 100%;
        flex: none;
    }
}

/* Input type hints para teclados corretos */
input[type="tel"],
input[inputmode="tel"] {
    -webkit-text-security: none;
}

input[type="number"],
input[inputmode="numeric"],
input[inputmode="decimal"] {
    text-align: right;
}

/* Touch feedback em formulários */
@media (hover: none) and (pointer: coarse) {

    .form-control:active,
    input:active,
    select:active {
        background-color: var(--neutral-50, #f9fafb);
    }

    .btn:active,
    button:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}