/* ==========================================================================
   EcoMadeira - Design System & Variáveis Globais (:root)
   ========================================================================== */

:root {
    /* Tipografia */
    --font-heading: 'New Amsterdam', sans-serif;
    --font-body: 'News Cycle', sans-serif;

    /* Paleta de Cores Oficial (Figma) */
    --color-brand-green: #307146;         /* Verde destaque / Títulos */
    --color-primary-dark: #1E321F;        /* Verde escuro floresta / Cards / Categorias */
    --color-primary-hover: #2F663C;       /* Verde intermediário / Hover do card */
    --color-accent-gold: #F2C88C;         /* Dourado madeira / SVG fundo / Badges / Botões / Preços */
    --color-text-dark: #280D07;           /* Marrom profundo / Textos principais */
    --color-text-light: #FFFFFF;          /* Branco / Textos em fundos escuros */
    --color-bg-light: #FFFFFF;            /* Fundo da tela */
    --color-forest-deep: #0B3413;         /* Verde bem escuro / Footer da Home */
    --color-input-bg: #E9E9E9;            /* Fundo de inputs de formulário */
    --color-border-muted: #D9D9D9;        /* Divisores e placeholders neutros */
    --color-wood-brown: #54320F;          /* Marrom madeira / Blobs decorativos */

    /* Neutros e Superfícies Padronizadas */
    --color-text-body: #374151;           /* Cinza escuro / Parágrafos em fundo claro */
    --color-text-muted: #4B5563;          /* Cinza médio / Textos secundários */
    --color-text-subtle: #6B7280;         /* Cinza suave / Metadados e datas */
    --color-text-placeholder: #9CA3AF;    /* Cinza claro / Placeholders */
    --color-bg-subtle: #F8FAF8;           /* Superfície clara com leve toque verde */
    --color-bg-surface: #F9FBFA;          /* Superfície neutra suave */
    --color-bg-muted: #F3F4F6;            /* Fundo neutro secundário */
    --color-brand-tint: #EAF4EE;          /* Fundo pílula / Destaque verde suave */
    --color-border-subtle: rgba(48, 113, 70, 0.12); /* Borda sutil de destaque */
    --color-border-light: rgba(0, 0, 0, 0.08);       /* Borda neutra leve */

    /* Bordas e Arredondamentos */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-card: 30.68px;
    --radius-pill: 50px;
    --radius-full: 9999px;

    /* Sombras Padronizadas (Elevation) */
    --shadow-xs: 0 2px 6px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.22);
    --shadow-floating: 0 20px 48px rgba(0, 0, 0, 0.25);
    --shadow-card: -27.61px 30.68px 22.09px rgba(0, 0, 0, 0.25);
    --shadow-card-hover: -27.61px 34px 26px rgba(0, 0, 0, 0.30);
    
    /* Layout & Espaçamento Padronizado */
    --section-space: clamp(80px, 8.5vw, 180px);
    --container-max-width: 1440px;
    --container-padding: clamp(20px, 3.2vw, 56px);

    /* Transições */
    --transition-base: 0.3s ease;
    --transition-fast: 0.2s ease;
}

/* ==========================================================================
   Utilitários Globais e Primitivas Reutilizáveis
   ========================================================================== */

/* Cores por trecho de texto (títulos bicolores do Figma) */
.c-green { color: var(--color-brand-green); }
.c-gold  { color: var(--color-accent-gold); }
.c-brown { color: var(--color-text-dark); }
.c-white { color: var(--color-text-light); }

/* Título de seção padronizado: New Amsterdam */
.section-title {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: clamp(38px, 5vw, 96px);
    line-height: 1.2;
    text-transform: uppercase;
}

/* Corpo de seção padronizado: News Cycle */
.section-text {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: clamp(15px, 1.5625vw, 30px);
    line-height: 1.63;
    color: var(--color-text-dark);
}

.home-container {
    width: min(calc(100% - var(--container-padding) * 2), var(--container-max-width));
    margin-inline: auto;
}

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

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Reset Global */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-padding-top: 120px;
    overflow-x: clip;
    scrollbar-width: thin;
    scrollbar-color: #C1C1C1 #F5F5F5;
}

@media (max-width: 1100px) {
    html { scroll-padding-top: 88px; }
}

/* Scrollbar Personalizada em Cinza Neutro (WebKit/Blink) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F5F5F5;
}

::-webkit-scrollbar-thumb {
    background-color: #C1C1C1;
    border-radius: 4px;
    border: 2px solid #F5F5F5;
    transition: background-color var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background-color: #9E9E9E;
}

body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--color-bg-light);
    font-family: var(--font-body);
    color: var(--color-text-dark);
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

/* ==========================================================================
   Notificações e Mensagens Flash (django.contrib.messages)
   ========================================================================== */
.messages-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: calc(100% - 32px);
    max-width: 580px;
    pointer-events: none;
}

.alert {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-radius: 16px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
    animation: alertSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
}

@keyframes alertSlideDown {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.alert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 10px;
    flex-shrink: 0;
}

.alert-icon .alert-svg {
    width: 20px;
    height: 20px;
    display: block;
}

.alert-text {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.alert-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    color: inherit;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.alert-close svg {
    width: 14px;
    height: 14px;
    display: block;
}

.alert-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
}

/* Variantes dos Alertas no Padrão Visual EcoMadeira */
.alert-success {
    background-color: #F0FDF4;
    color: #14532D;
    border: 1px solid #BBF7D0;
}
.alert-success .alert-icon {
    background-color: #DCFCE7;
    color: #16A34A;
}

.alert-warning {
    background-color: #FFF9EE;
    color: #784408;
    border: 1px solid #F6DFC2;
}
.alert-warning .alert-icon {
    background-color: #FEF3C7;
    color: #D97706;
}

.alert-error, .alert-danger {
    background-color: #FEF2F2;
    color: #7F1D1D;
    border: 1px solid #FECACA;
}
.alert-error .alert-icon, .alert-danger .alert-icon {
    background-color: #FEE2E2;
    color: #DC2626;
}

.alert-info {
    background-color: #F0FDF9;
    color: #115E59;
    border: 1px solid #99F6E4;
}
.alert-info .alert-icon {
    background-color: #CCFBF1;
    color: #0D9488;
}


/* ==========================================================================
   Componentes Primitivos Reutilizáveis (Design System)
   ========================================================================== */

/* Botão Pílula com Seta Circular (Hero, Banners e Chamadas Principais) */
.btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(8px, 1vw, 20px);
    min-width: clamp(200px, 20.63vw, 396px);
    height: clamp(46px, 4.22vw, 81px);
    padding: 0 clamp(8px, 0.78vw, 15px) 0 clamp(16px, 1.72vw, 33px);
    background: var(--color-bg-light);
    color: var(--color-primary-dark);
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: clamp(15px, 1.615vw, 31px);
    border-radius: var(--radius-pill);
    text-decoration: none;
    white-space: nowrap;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-pill-arrow {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(34px, 3.18vw, 61px);
    height: clamp(34px, 3.18vw, 61px);
    border-radius: 50%;
    background: var(--color-brand-green);
    transition: transform var(--transition-fast);
}

.btn-pill-arrow img,
.btn-pill-arrow svg {
    width: 40%;
    height: auto;
}

.btn-pill:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-pill:hover .btn-pill-arrow {
    transform: scale(1.08);
}

/* Botão Circular com Seta (Ações, Navegação e Swap de Pranchas) */
.btn-arrow-round {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(38px, 3.18vw, 61px);
    height: clamp(38px, 3.18vw, 61px);
    border: none;
    border-radius: 50%;
    background: var(--color-brand-green);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), filter var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-arrow-round img,
.btn-arrow-round svg {
    width: 40%;
    height: auto;
}

.btn-arrow-round:hover {
    filter: brightness(1.1);
    transform: scale(1.08);
    box-shadow: var(--shadow-md);
}

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

/* Divisor Orgânico Ondulado entre Seções */
.wave-divider {
    width: 100%;
    overflow: hidden;
    line-height: 0;
    margin: clamp(48px, 7.65vw, 147px) 0 0;
}

.wave-divider img,
.wave-divider svg {
    display: block;
    width: 108%;
    margin-left: -4%;
    height: auto;
}

/* Controles de Formulário Padronizados */
.form-field {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    gap: 6px;
    min-width: 0;
}

.form-field label {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: clamp(12px, 1.51vw, 29px);
    line-height: 1.62;
    color: var(--color-text-dark);
}

.form-field input,
.form-field textarea {
    width: 100%;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    background: var(--color-input-bg);
    padding: 0 clamp(10px, 1.46vw, 28px);
    height: clamp(32px, 3.07vw, 59px);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: clamp(11px, 1.042vw, 20px);
    color: var(--color-text-dark);
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.form-field input:focus-visible,
.form-field textarea:focus-visible {
    border-color: var(--color-brand-green);
    box-shadow: 0 0 0 2px var(--color-brand-green);
    outline: none;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: var(--color-text-placeholder);
}

/* ==========================================================================
   Estado Vazio Padronizado (Empty States Reutilizáveis)
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: clamp(40px, 5vw, 70px) clamp(20px, 3vw, 32px);
    background: var(--color-bg-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1.5px dashed var(--color-brand-green);
    max-width: 680px;
    margin: 40px auto 0;
}

.empty-state-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--color-brand-tint);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-brand-green);
    margin-bottom: 16px;
}

.empty-state-icon svg {
    width: 32px;
    height: 32px;
}

.empty-state-title {
    font-family: var(--font-heading);
    font-size: clamp(20px, 2.2vw, 26px);
    color: var(--color-brand-green);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.empty-state-text {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin: 0 0 20px;
}

.empty-state-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background: var(--color-brand-green);
    color: var(--color-text-light);
    font-family: var(--font-heading);
    font-size: 16px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: background var(--transition-fast), transform var(--transition-fast), filter var(--transition-fast);
}

.empty-state-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}



