/* =============================================================================
   ARQUIVO: assets/css/main.css
   =============================================================================
   OBJETIVO
   - Estilos base compartilhados por todo o site.
   - Define tema visual, tipografia e componentes globais.
   ============================================================================= */

:root {
    /* Cores institucionais */
    --gold: #b4942b;
    --gold-light: #c4a437;
    --gold-dark: #9a7d24;
    --grafite: #1a1d29;
    --grafite-light: #252836;
    --grafite-dark: #12141a;
    --branco: #f8f9fa;
    --cinza: #9ca3af;
    --cinza-dark: #6b7280;

    /* Tema (dark default) */
    --bg-primary: var(--grafite);
    --bg-secondary: var(--grafite-light);
    --bg-elevated: rgba(26, 29, 41, 0.94);
    --text-primary: var(--branco);
    --text-secondary: var(--cinza);
    --border-color: rgba(255, 255, 255, 0.08);

    /* Feedback */
    --danger: #ef4444;
    --warning: #f59e0b;

    /* Tipografia */
    --font-serif: "Playfair Display", Georgia, serif;
    --font-sans: "Inter", system-ui, -apple-system, sans-serif;

    /* Layout */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --shadow-soft: 0 18px 40px rgba(9, 11, 22, 0.35);

    /* Transicoes */
    --transition-fast: 150ms ease;
    --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

:root:not(.dark) {
    --bg-primary: var(--branco);
    --bg-secondary: #ffffff;
    --bg-elevated: rgba(248, 249, 250, 0.95);
    --text-primary: #374151;
    --text-secondary: #6b7280;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-soft: 0 18px 36px rgba(15, 23, 42, 0.12);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(600px 260px at 85% -10%, rgba(180, 148, 43, 0.2), transparent 60%),
        radial-gradient(420px 220px at 10% 15%, rgba(196, 164, 55, 0.12), transparent 70%);
    pointer-events: none;
    opacity: 0.7;
    z-index: -1;
}

.hidden {
    display: none !important;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

h1,
h2,
h3 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

h4,
h5,
h6 {
    font-family: var(--font-sans);
    font-weight: 600;
    line-height: 1.4;
}

p {
    color: var(--text-secondary);
}

/* Tipografia - Tamanhos de heading (conforme 05-tipografia.md) */
h1 {
    font-size: clamp(2rem, 5vw, 3rem); /* 32px mobile, 48px desktop */
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.25rem); /* 28px mobile, 36px desktop */
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.5rem); /* 20px mobile, 24px desktop */
}

h4 {
    font-size: clamp(1rem, 2vw, 1.125rem); /* 16px mobile, 18px desktop */
}

h5 {
    font-size: clamp(0.875rem, 1.5vw, 1rem); /* 14px mobile, 16px desktop */
}

h6 {
    font-size: clamp(0.75rem, 1.25vw, 0.875rem); /* 12px mobile, 14px desktop */
    font-weight: 500;
}

/* Tipografia - Classes utilitárias */
.label-uppercase {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.text-large {
    font-size: 1.125rem; /* 18px */
    line-height: 1.6;
}

.text-small {
    font-size: 0.875rem; /* 14px */
}

.text-caption {
    font-size: 0.75rem; /* 12px */
    color: var(--text-secondary);
}

blockquote {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-secondary);
    border-left: 3px solid var(--gold);
    padding-left: 1.25rem;
    margin: 1.5rem 0;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 6rem 0;
}

.section-alt {
    background: var(--bg-secondary);
}

.site-main {
    padding-top: 160px;
}

/* Acessibilidade */

.skip-link {
    position: absolute;
    top: -40px;
    left: 1rem;
    background: var(--gold);
    color: var(--grafite);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 1000;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 1rem;
}

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* Header e navegacao */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.banner {
    background: var(--gold);
    color: var(--grafite);
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.625rem 1rem;
}

.nav-glass {
    background: var(--bg-elevated);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    padding-bottom: 1rem;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo {
    width: 40px;
    height: 40px;
}

.brand-text {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.nav-links {
    display: flex;
    gap: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-link {
    color: var(--text-secondary);
    padding: 0.25rem 0;
    position: relative;
    transition: color var(--transition-fast);
}

.nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width var(--transition);
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.menu-toggle {
    display: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
}

.mobile-panel {
    display: none;
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-elevated);
}

.mobile-panel[data-open="true"] {
    display: block;
}

.mobile-nav {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Botoes */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--grafite);
    box-shadow: 0 10px 24px rgba(180, 148, 43, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(180, 148, 43, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--gold);
    background: rgba(180, 148, 43, 0.05);
}

/* Componentes */

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
}

.section-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
}

.section-divider {
    width: 4rem;
    height: 3px;
    background: var(--gold);
    margin: 0 auto 1.5rem;
    border-radius: 2px;
}

.section-desc {
    font-size: 1.0625rem;
    line-height: 1.7;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    transition: all var(--transition);
}

.card:hover {
    border-color: rgba(180, 148, 43, 0.3);
    transform: translateY(-4px);
    box-shadow: var(--shadow-soft);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: rgba(180, 148, 43, 0.12);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--gold);
}

.card-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.card-desc {
    font-size: 0.9375rem;
}

/* Formularios */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control::placeholder {
    color: var(--text-secondary);
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(180, 148, 43, 0.2);
}

.form-control[aria-invalid="true"] {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

textarea.form-control {
    min-height: 140px;
    resize: vertical;
}

.hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

/* Rodape */

.site-footer {
    padding: 4rem 0 3.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand p {
    font-size: 0.9375rem;
}

.footer-column h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-column ul {
    display: grid;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.footer-bottom {
    display: grid;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.footer-copy {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
}

.footer-legal {
    max-width: 720px;
    font-size: 0.8125rem;
}

/* Animacoes - Logica invertida para acessibilidade */
/* Conteudo visivel por padrao. JS adiciona .js-ready ao html quando pronto */

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Quando JS esta pronto e nao e reduced-motion, esconde para animar */
html.js-ready [data-animate] {
    opacity: 0;
    transform: translateY(14px);
}

/* Classe que JS adiciona quando elemento entra na viewport */
html.js-ready [data-animate].is-visible {
    animation: fade-up 0.8s ease forwards;
}

/* Fallback: sem JS ou prefers-reduced-motion, sempre visivel */
[data-animate] {
    opacity: 1;
    transform: none;
}

.animate-fade-up {
    animation: fade-up 0.8s ease forwards;
}

.animate-fade-in {
    animation: fade-in 0.8s ease forwards;
}

/* Responsividade */

@media (max-width: 980px) {
    .nav-links {
        display: none;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .header-inner {
        flex-wrap: wrap;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
        row-gap: 0.5rem;
    }

    .btn-primary {
        white-space: nowrap;
    }

    .site-main {
        padding-top: 180px;
    }
}

@media (max-width: 640px) {
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .btn,
    .menu-toggle {
        font-size: 0.75rem;
        padding: 0.65rem 1.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }

    [data-animate] {
        opacity: 1 !important;
        transform: none !important;
    }
}
