/* ========================================
   CalcRápido - Estilos Compartilhados
   ======================================== */

/* Variáveis Globais */
:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --bg: #fafafa;
    --card-bg: #ffffff;
    --text: #0f172a;
    --text-light: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========================================
   Header
   ======================================== */
header {
    background: var(--primary);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: #fff;
    text-decoration: none;
}

.logo span {
    color: var(--accent);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--accent);
}

.back-link {
    display: inline-block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--accent);
}

/* ========================================
   Layout
   ======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

main {
    padding: 3rem 0;
}

/* ========================================
   Breadcrumbs
   ======================================== */
.breadcrumbs {
    padding: 1rem 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

.breadcrumbs a {
    color: var(--text-light);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--accent);
}

/* ========================================
   Calculadora - Seções
   ======================================== */
.calc-section {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    max-width: 600px;
    margin: 0 auto;
}

.calc-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.calc-container .calc-section {
    max-width: none;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: var(--text);
    margin-bottom: 1rem;
}

h2 {
    font-family: 'Playfair Display', serif;
}

.subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* ========================================
   Formulários
   ======================================== */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

input,
select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.3s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.input-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'DM Sans', sans-serif;
    margin-top: 1rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

.btn:active {
    transform: translateY(0);
}

/* ========================================
   Resultados
   ======================================== */
.result {
    margin-top: 2rem;
    padding: 2rem;
    border-radius: 16px;
    display: none;
}

.result.show {
    display: block;
}

.result-container {
    display: none;
    animation: fadeInUp 0.5s ease;
}

.result-container.show {
    display: block;
}

.result-value {
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent);
    text-align: center;
    font-family: 'Playfair Display', serif;
}

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

/* ========================================
   Seção de conteúdo SEO
   ======================================== */
.seo-content {
    max-width: 900px;
    margin: 4rem auto;
    padding: 3rem;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}

.seo-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.seo-content h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
}

.seo-content p {
    margin-bottom: 1rem;
    color: var(--text-light);
    line-height: 1.8;
}

.seo-content ul {
    margin: 1rem 0 1rem 2rem;
    color: var(--text-light);
}

.seo-content li {
    margin-bottom: 0.5rem;
}

/* ========================================
   Info Box
   ======================================== */
.info-box {
    background: rgba(245, 158, 11, 0.05);
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.info-box h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.info-box p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ========================================
   Calculadoras Relacionadas
   ======================================== */
.related-calcs {
    padding: 3rem 0;
    background: var(--bg);
}

.related-calcs h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-family: 'Playfair Display', serif;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.related-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    transition: transform 0.3s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.related-card:hover {
    transform: translateY(-5px);
}

.related-card .icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.related-card h3 {
    font-size: 1rem;
    color: var(--text);
}

/* ========================================
   Footer
   ======================================== */
footer {
    background: var(--primary);
    color: rgba(255, 255, 255, 0.8);
    padding: 3rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section p {
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
}

/* ========================================
   Homepage - Hero
   ======================================== */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 600px;
    background: linear-gradient(135deg, var(--primary) 0%, #1e293b 100%);
    z-index: -1;
    overflow: hidden;
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 50px) scale(1.1); }
}

.hero {
    padding: 4rem 0 8rem;
    text-align: center;
    position: relative;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 900;
    color: #fff;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero p {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    color: rgba(255, 255, 255, 0.85);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* ========================================
   Homepage - Grid de Calculadoras
   ======================================== */
.calculators-section {
    position: relative;
    margin-top: -6rem;
    padding-bottom: 6rem;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.calc-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    transition: all 0.3s;
    border: 2px solid transparent;
    text-decoration: none;
    display: block;
    position: relative;
    overflow: hidden;
}

.calc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, #d97706 100%);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.calc-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.15);
    border-color: var(--accent);
}

.calc-card:hover::before {
    transform: scaleX(1);
}

.calc-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.calc-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.calc-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

/* ========================================
   Skip Navigation (Acessibilidade)
   ======================================== */
.skip-nav {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-nav:focus {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    padding: 0.75rem 1.5rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--accent);
    color: #fff;
    z-index: 200;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 8px 0;
}

/* ========================================
   Menu Hamburger
   ======================================== */
.menu-toggle {
    display: none;
    visibility: hidden;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 110;
    width: 0;
    height: 0;
    overflow: hidden;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ========================================
   Blog - Listagem
   ======================================== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

.blog-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    transition: all 0.3s;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    border: 2px solid transparent;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.15);
    border-color: var(--accent);
}

.blog-card-body {
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.blog-card-category {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.blog-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    color: var(--text);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.blog-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.7;
    flex: 1;
}

.blog-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-dark);
    font-weight: 600;
    font-size: 0.95rem;
    margin-top: 1.25rem;
    transition: gap 0.3s;
}

.blog-card:hover .blog-card-link {
    gap: 0.75rem;
}

/* ========================================
   Blog - Artigo
   ======================================== */
.article-header {
    max-width: 800px;
    margin: 0 auto 2rem;
    padding: 2rem 0;
}

.article-header h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.article-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}

.article-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    margin: 2.5rem 0 1rem;
    color: var(--text);
}

.article-content h2:first-child {
    margin-top: 0;
}

.article-content h3 {
    font-size: 1.3rem;
    margin: 2rem 0 0.75rem;
    color: var(--text);
}

.article-content p {
    margin-bottom: 1rem;
    color: var(--text-light);
    line-height: 1.8;
}

.article-content ul,
.article-content ol {
    margin: 1rem 0 1rem 2rem;
    color: var(--text-light);
    line-height: 1.8;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    border-left: 4px solid var(--accent);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: rgba(245, 158, 11, 0.05);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-light);
}

.article-cta {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    margin: 2.5rem 0;
}

.article-cta h3 {
    color: #fff;
    margin-bottom: 0.75rem;
    font-family: 'Playfair Display', serif;
}

.article-cta p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.25rem;
}

.article-cta .btn {
    width: auto;
    display: inline-block;
    padding: 0.875rem 2rem;
    margin-top: 0;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.article-content th,
.article-content td {
    padding: 0.875rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.article-content th {
    font-weight: 700;
    color: var(--text);
    background: rgba(245, 158, 11, 0.05);
}

.article-content tr:last-child td {
    border-bottom: none;
}

/* ========================================
   Responsivo
   ======================================== */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        visibility: visible;
        width: auto;
        height: auto;
        overflow: visible;
    }

    nav ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 1rem 2rem 2rem;
        gap: 0;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    }

    nav ul.open {
        display: flex;
    }

    nav ul li {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    header {
        position: sticky;
    }

    .header-content {
        position: relative;
    }

    .calc-grid,
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .calc-container {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2rem;
    }

    .article-header h1 {
        font-size: 1.75rem;
    }

    .article-content {
        padding: 1.5rem;
    }
}
