/* ============================================
   RAPIDEZ DIGITAL — CSS Principal
   Paleta: Laranja #FF5100 · Preto #0D0D0D · Branco #FFFFFF
   ============================================ */

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

:root {
    --rd-orange:       #FF5100;
    --rd-orange-dark:  #CC4100;
    --rd-orange-light: #FF7840;
    --rd-black:        #0D0D0D;
    --rd-dark:         #1A1A1A;
    --rd-mid:          #6B6B6B;
    --rd-light:        #F5F5F5;
    --rd-border:       #E8E8E8;
    --rd-white:        #FFFFFF;
    --sombra:          0 2px 8px rgba(0,0,0,0.07);
    --sombra-media:    0 4px 16px rgba(0,0,0,0.11);

    /* Bootstrap overrides */
    --bs-primary:      #FF5100;
    --bs-success:      #FF5100;
    --verde-primario:  #FF5100;
    --verde-escuro:    #CC4100;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', Roboto, -apple-system, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1A1A1A;
    background: #FFFFFF;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

a { color: var(--rd-orange); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--rd-orange-dark); }

img { max-width: 100%; height: auto; display: block; }

/* Headings — cor herdada do contexto */
h1, h2, h3, h4, h5, h6 {
    font-weight: 900;
    line-height: 1.2;
    color: inherit;      /* herda a cor do elemento pai */
    letter-spacing: -0.3px;
}
h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.25rem; margin-bottom: 0.5rem; }
p  { margin-bottom: 1rem; }

/* Fundos escuros — texto branco automático */
.hp-hero h1,
.archive-header h1,
.page-hero h1,
.demos-hero h1,
.hp-why h1,
.hp-why h2,
.hp-why h3,
.rd-newsletter-box h2,
.hp-cta h2,
.hp-cta h2 span,
.sidebar-cta h4,
[style*="background:#0D0D0D"] h1,
[style*="background:#0D0D0D"] h2,
[style*="background:#0D0D0D"] h3,
[style*="background:#1A1A1A"] h1,
[style*="background:#1A1A1A"] h2 {
    color: #FFFFFF !important;
}

/* Secções com fundo claro — texto escuro */
.hp-services h3,
.hp-pricing h2,
.hp-why-card h3,
.rd-section-title h2,
.hp-faq h2,
.hp-newsletter-section h2,
.hp-categories h2,
.hp-articles h2,
section:not([class*="why"]):not([class*="hero"]):not([class*="cta"]):not([class*="stats-bar"]) h2 {
    color: #0D0D0D;
}

/* ============================================
   BOTÕES GLOBAIS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border: 2px solid transparent;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary, .btn-success {
    background: var(--rd-orange);
    color: white;
    border-color: var(--rd-orange);
}
.btn-primary:hover, .btn-success:hover {
    background: var(--rd-orange-dark);
    border-color: var(--rd-orange-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255,81,0,0.3);
}

.btn-outline, .btn-outline-success {
    border-color: var(--rd-orange);
    color: var(--rd-orange);
    background: transparent;
}
.btn-outline:hover, .btn-outline-success:hover {
    background: var(--rd-orange);
    border-color: var(--rd-orange);
    color: white;
}

.btn-dark-rd {
    background: var(--rd-black);
    color: white;
    border-color: var(--rd-black);
}
.btn-dark-rd:hover { background: var(--rd-dark); color: white; }

.btn-large { padding: 0.9rem 2rem; font-size: 1.05rem; }

/* Bootstrap btn overrides */
.btn-success { background: var(--rd-orange) !important; border-color: var(--rd-orange) !important; color: white !important; }
.btn-success:hover { background: var(--rd-orange-dark) !important; border-color: var(--rd-orange-dark) !important; }
.btn-outline-success { color: var(--rd-orange) !important; border-color: var(--rd-orange) !important; }
.btn-outline-success:hover { background: var(--rd-orange) !important; border-color: var(--rd-orange) !important; color: white !important; }

/* ============================================
   SECÇÕES GERAIS
   ============================================ */
.section     { padding: 4rem 0; }
.section-alt { background: var(--rd-light); }

/* ============================================
   ALERTAS / FLASH
   ============================================ */
.alert { padding: 0.9rem 1.1rem; border-radius: 8px; margin-bottom: 1rem; border-left: 4px solid; font-size: 0.9rem; }
.alert-success { background: #E8F5E9; color: #1B5E20; border-color: #4CAF50; }
.alert-error, .alert-danger { background: #FFEBEE; color: #B71C1C; border-color: #F44336; }
.alert-warning { background: #FFF8E1; color: #E65100; border-color: #FF9800; }
.alert-info    { background: #E3F2FD; color: #0D47A1; border-color: #2196F3; }

/* ============================================
   FORMULÁRIOS (form-box — login/registar)
   ============================================ */
.form-box {
    max-width: 460px; margin: 3rem auto;
    background: white; padding: 2.5rem;
    border-radius: 16px; border: 1.5px solid var(--rd-border);
}
.form-box h1 { font-size: 1.75rem; text-align: center; margin-bottom: 1.5rem; color: #0D0D0D; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; font-size: 0.88rem; color: #1A1A1A; }

.form-control {
    width: 100%; padding: 0.75rem 1rem;
    border: 1.5px solid var(--rd-border); border-radius: 8px;
    font-size: 0.95rem; font-family: inherit; transition: border-color 0.2s; background: white;
    color: #1A1A1A;
}
.form-control:focus { outline: none; border-color: var(--rd-orange); box-shadow: 0 0 0 3px rgba(255,81,0,0.1); }
.form-box .btn { width: 100%; padding: 0.9rem; font-size: 1.05rem; justify-content: center; }
.form-footer { text-align: center; margin-top: 1.5rem; color: var(--rd-mid); font-size: 0.9rem; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--rd-black);
    color: rgba(255,255,255,0.6);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}
.site-footer h3, .site-footer h4, .site-footer h5 {
    color: #FFFFFF !important;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.site-footer ul { list-style: none; }
.site-footer ul li { margin-bottom: 0.5rem; }
.site-footer a { color: rgba(255,255,255,0.55); }
.site-footer a:hover { color: var(--rd-orange); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 1.5rem; text-align: center; font-size: 0.85rem; color: rgba(255,255,255,0.35); }

/* ============================================
   NAVBAR BOOTSTRAP
   ============================================ */
.site-navbar {
    background: var(--rd-black) !important;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    transition: box-shadow 0.2s;
}
.site-navbar.scrolled { box-shadow: 0 4px 20px rgba(0,0,0,0.3); }

.navbar-brand { color: white !important; font-size: 1.3rem; font-weight: 900; letter-spacing: -0.5px; }
.navbar-brand:hover { color: var(--rd-orange) !important; }
.navbar-logo { max-height: 38px; width: auto; object-fit: contain; }
.brand-text  { font-weight: 900; }

.navbar .nav-link { color: rgba(255,255,255,0.82) !important; font-weight: 600; padding: 0.5rem 0.9rem !important; border-radius: 6px; transition: all 0.2s; font-size: 0.9rem; }
.navbar .nav-link:hover { color: #FF5100 !important; background: rgba(255,81,0,0.08); }
.navbar .nav-link.active { color: #FF5100 !important; font-weight: 700 !important; }

/* Dropdowns */
.dropdown-menu { background: #1A1A1A; border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 0.5rem; margin-top: 0.5rem !important; min-width: 220px; }
.dropdown-item { border-radius: 6px; padding: 0.55rem 0.85rem; font-size: 0.9rem; color: rgba(255,255,255,0.82) !important; transition: all 0.15s; }
.dropdown-item:hover { background: rgba(255,81,0,0.1) !important; color: #FF5100 !important; }
.dropdown-item:active, .dropdown-item.active { background: var(--rd-orange) !important; color: white !important; }

/* Pesquisa */
.search-form { min-width: 200px; }
.search-form .form-control { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); color: white; }
.search-form .form-control::placeholder { color: rgba(255,255,255,0.4); }
.search-form .form-control:focus { border-color: var(--rd-orange); box-shadow: 0 0 0 3px rgba(255,81,0,0.15); }

/* Avatar */
.user-avatar {
    width: 30px; height: 30px; background: var(--rd-orange); color: white;
    border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.82rem;
}

/* Toggler */
.navbar-toggler { border-color: rgba(255,255,255,0.2); }
.navbar-toggler:focus { box-shadow: 0 0 0 3px rgba(255,81,0,0.2); }

/* ============================================
   PAGE HERO (páginas internas)
   ============================================ */
.page-hero,
.archive-header,
.demos-hero {
    background: #0D0D0D;
    color: #FFFFFF;
    padding: 3.5rem 0 3rem;
    position: relative;
    overflow: hidden;
}
.page-hero h1,
.archive-header h1,
.demos-hero h1 {
    color: #FFFFFF !important;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 900;
    margin-bottom: 0.4rem;
    letter-spacing: -0.5px;
}
.page-hero::before,
.archive-header::before,
.demos-hero::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,81,0,0.12) 0%, transparent 70%);
    top: -200px; right: -100px;
    pointer-events: none;
}
.page-hero .breadcrumb-item a,
.archive-header .breadcrumb-item a,
.demos-hero .breadcrumb-item a { color: rgba(255,255,255,0.6); text-decoration: none; font-size: 0.85rem; }
.page-hero .breadcrumb-item a:hover,
.archive-header .breadcrumb-item a:hover { color: #FF5100; }
.page-hero .breadcrumb-item.active,
.archive-header .breadcrumb-item.active { color: rgba(255,255,255,0.9); font-size: 0.85rem; }
.page-hero .breadcrumb-item + .breadcrumb-item::before,
.archive-header .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,0.3); }

/* Subtítulo nas páginas internas */
.archive-header .subtitle,
.demos-hero p {
    color: rgba(255,255,255,0.7) !important;
    font-size: 1rem;
    margin: 0;
}

/* ============================================
   CONTENT SECTIONS — texto escuro sobre fundo claro
   ============================================ */
.rd-section-title h2 { color: #0D0D0D; }
.rd-section-title .rd-eyebrow { color: #FF5100; }
.rd-section-title p { color: #6B6B6B; }

/* Cards e boxes */
.rd-service-card h3,
.rd-why-card h3,
.rd-article-featured h3,
.rd-article-card h4,
.hp-feature-card h3,
.hp-why-card h3 { color: #0D0D0D; }

/* Secções escuras */
.hp-why { background: #0D0D0D; color: white; }
.hp-why .rd-section-title h2 { color: #FFFFFF !important; }
.hp-why .rd-section-title p  { color: rgba(255,255,255,0.55) !important; }
.rd-why-card h3 { color: #FFFFFF !important; }

/* Stats bar laranja */
.hp-stats-bar { background: var(--rd-orange); }
.hp-stats-bar .rd-stat-num   { color: #FFFFFF; font-weight: 900; }
.hp-stats-bar .rd-stat-label { color: rgba(255,255,255,0.85); }

/* Newsletter box escuro */
.rd-newsletter-box { background: #0D0D0D; }
.rd-newsletter-box h2 { color: #FFFFFF !important; }
.rd-newsletter-box p  { color: rgba(255,255,255,0.65); }

/* CTA final */
.hp-cta { background: var(--rd-light); }
.hp-cta h2 { color: #0D0D0D !important; }
.hp-cta h2 span { color: var(--rd-orange) !important; }
.hp-cta p { color: #6B6B6B; }

/* ============================================
   PAGINAÇÃO
   ============================================ */
.pagination-wrap .page-link { color: #FF5100; border-color: #E0E0E0; border-radius: 8px !important; margin: 0 2px; }
.pagination-wrap .page-link:hover { background: #FFF5F0; border-color: #FF5100; color: #FF5100; }
.pagination-wrap .page-item.active .page-link { background: #FF5100; border-color: #FF5100; color: white; }
.pagination-wrap .page-item.disabled .page-link { color: #CCC; }

/* ============================================
   ARTIGO — content styles
   ============================================ */
.post-content h2 { color: #0D0D0D; }
.post-content h3 { color: #1A1A1A; }
.post-content a   { color: #FF5100; }
.post-content blockquote { border-left-color: #FF5100; background: #FFF5F0; }

/* ============================================
   MOBILE
   ============================================ */
@media (max-width: 768px) {
    h1 { font-size: 1.9rem; }
    h2 { font-size: 1.5rem; }
    .section { padding: 2.5rem 0; }
}

@media (max-width: 991px) {
    .site-navbar { padding: 0.6rem 0; }
    .navbar-collapse {
        padding-top: 1rem; margin-top: 0.5rem;
        border-top: 1px solid rgba(255,255,255,0.08);
    }
    .navbar .nav-link { padding: 0.7rem 0.75rem !important; }
    .dropdown-menu { border: none; background: rgba(255,255,255,0.04); margin: 0.25rem 0 0.5rem 1.5rem !important; box-shadow: none; }
}