/**
 * ArchByte Base Styles
 * Reset + Typography + Components
 * Aesthetic: Brutalismo suave premium
 */

/* ============================================
   Modern CSS Reset
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--text-primary);
    background-color: var(--bg);
    min-height: 100vh;
}

/* Theme transition (applied during theme switch) */
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
    transition: background-color 500ms ease,
        color 500ms ease,
        border-color 500ms ease,
        box-shadow 500ms ease !important;
}

/* Disabled state for theme toggle during transition */
.header__theme-toggle:disabled {
    pointer-events: none;
    opacity: 0.5;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
}

/* ============================================
   Typography
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

h1 {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    /* 36-56px */
    line-height: 1.1;
}

h2 {
    font-size: clamp(1.875rem, 4vw, 2.5rem);
    /* 30-40px */
    line-height: 1.15;
}

h3 {
    font-size: var(--text-2xl);
    line-height: 1.3;
}

h4 {
    font-size: var(--text-xl);
}

p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent);
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ============================================
   Layout Utilities
   ============================================ */
.container {
    max-width: var(--container-max-width);
    margin-inline: auto;
    padding-inline: var(--container-padding);
}

.section {
    padding-block: var(--section-spacing);
}

.section--sm {
    padding-block: var(--section-spacing-sm);
}

/* ============================================
   Header (sticky navigation)
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg);
    border-bottom: var(--border-width) solid var(--border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.header__logo {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.header__logo-arch {
    color: var(--text-primary);
}

.header__logo-byte {
    color: var(--accent);
}

/* Inline SVG Logo */
.header__logo-svg {
    height: 36px;
    width: auto;
}

.header__logo-svg .logo-arch {
    fill: var(--text-primary);
}

.header__logo-svg .logo-byte {
    fill: var(--accent);
}

.header__nav {
    display: flex;
    gap: var(--space-8);
    align-items: center;
}

.header__nav-link {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color var(--transition-fast);
}

.header__nav-link:hover {
    color: var(--accent);
}

.header__nav-link--active {
    color: var(--accent);
}

/* Theme toggle button - Neobrutalismo suave */
.header__theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-surface-elevated);
    border: var(--border-width-thick) solid var(--border);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    transition: transform var(--transition-fast),
        box-shadow var(--transition-fast),
        border-color var(--transition-fast);
    color: var(--text-primary);
    /* Offset shadow - assinatura neobrutalista */
    box-shadow: 2px 2px 0 0 var(--border);
}

.header__theme-toggle:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 0 var(--accent);
    border-color: var(--accent);
}

.header__theme-toggle:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 0 var(--accent);
}

.header__theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 3px 3px 0 0 var(--accent);
}

.header__theme-toggle img {
    width: 22px;
    height: 22px;
}

/* Dark theme: invert icon to white */
.dark-theme .header__theme-toggle img {
    filter: invert(1) brightness(2);
}

/* Light theme: keep icon dark */
.light-theme .header__theme-toggle img {
    filter: none;
}

/* Mobile menu toggle */
.header__menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: var(--space-2);
    font-size: var(--text-2xl);
}

@media (max-width: 768px) {
    .header__nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background-color: var(--bg-surface);
        flex-direction: column;
        gap: 0;
        padding: var(--space-4);
        border-bottom: var(--border-width) solid var(--border);
        transform: translateY(-100%);
        opacity: 0;
        transition: transform var(--transition-base), opacity var(--transition-base);
        pointer-events: none;
    }

    .header__nav.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .header__nav-link {
        display: block;
        padding: var(--space-3) 0;
        width: 100%;
        text-align: center;
    }

    .header__menu-toggle {
        display: block;
    }
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background-color: var(--bg-surface);
    border-top: var(--border-width) solid var(--border);
    padding-block: var(--space-12);
    margin-top: var(--section-spacing);
}

.footer__container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-8);
}

.footer__section h4 {
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-3);
    color: var(--accent);
}

.footer__links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.footer__link {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    transition: color var(--transition-fast);
}

.footer__link:hover {
    color: var(--accent);
}

.footer__bottom {
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: var(--border-width) solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

@media (max-width: 768px) {
    .footer__section {
        text-align: center;
    }

    .footer__section .header__logo {
        justify-content: center;
    }
}

/* ============================================
   Cards (brutalismo suave)
   ============================================ */
.card {
    background-color: var(--bg-surface);
    border: var(--border-width-thick) solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.card--portfolio {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm), var(--glow-premium);
}

.card--portfolio:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md), var(--glow-premium-strong);
}

.card__title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--text-primary);
}

.card__description {
    color: var(--text-secondary);
    font-size: var(--text-base);
    margin-bottom: 0;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
    color: var(--accent);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.text-link:hover {
    color: var(--accent-hover);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.tag {
    background-color: var(--bg-surface-elevated);
    color: var(--text-secondary);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-family: var(--font-display);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.section-intro__text {
    max-width: 680px;
    margin-inline: auto;
    color: var(--text-secondary);
}

.step-number {
    color: var(--accent);
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: var(--space-3);
}

.service-eyebrow {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: var(--space-3);
}

.list-check {
    list-style: none;
    display: grid;
    gap: var(--space-3);
}

.list-check li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    color: var(--text-secondary);
    font-size: var(--text-base);
}

.list-check li::before {
    content: '✓';
    color: var(--accent);
    font-weight: 700;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.faq-item {
    background-color: var(--bg-surface);
    border: var(--border-width-thick) solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.faq-item summary {
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text-primary);
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item[open] {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.faq-item[open] summary {
    color: var(--accent);
}

.faq-item p {
    margin-top: var(--space-3);
    color: var(--text-secondary);
}

/* Card premium (glow sutil em áreas-chave) */
.card--premium {
    border-color: rgba(245, 203, 92, 0.3);
    box-shadow: var(--glow-premium);
}

.card--premium:hover {
    border-color: rgba(245, 203, 92, 0.5);
    box-shadow: var(--glow-premium-strong);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-6);
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: var(--border-width-thick) solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn--primary {
    background-color: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
}

.btn--primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--accent-text);
    box-shadow: var(--glow-premium);
}

.btn--ghost {
    background-color: transparent;
    color: var(--text-primary);
    border-color: var(--border);
}

.btn--ghost:hover {
    background-color: var(--bg-surface-elevated);
    border-color: var(--border-hover);
    color: var(--accent);
}

.btn--lg {
    padding: var(--space-5) var(--space-8);
    font-size: var(--text-lg);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    position: relative;
    padding-block: var(--space-12);
    /* Equal padding top/bottom: 48px */
}

.hero__content {
    max-width: 900px;
    margin-inline: auto;
    text-align: center;
}

.hero__title {
    margin-bottom: var(--space-6);
}

.hero__subtitle {
    font-family: var(--font-body);
    font-size: var(--text-xl);
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
    line-height: var(--leading-relaxed);
}

.hero__typewriter {
    color: var(--accent);
    font-weight: 500;
}

.hero__typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: var(--accent);
    margin-left: 2px;
    animation: blink 1s infinite;
}

.hero__typewriter-cursor.hidden {
    display: none;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero__typewriter-cursor {
        animation: none;
    }
}

.hero__ctas {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-6);
}

.hero__trust {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: var(--space-6);
}

/* ============================================
   Grid Layouts (Flexbox para centralização automática)
   ============================================ */
.grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-6);
    justify-content: center;
}

.grid--2>* {
    flex: 1 1 300px;
    max-width: calc(50% - var(--space-6) / 2);
}

.grid--3>* {
    flex: 1 1 280px;
    max-width: calc(33.333% - var(--space-6) * 2 / 3);
}

.grid--4>* {
    flex: 1 1 250px;
    max-width: calc(25% - var(--space-6) * 3 / 4);
}

@media (max-width: 1024px) {
    .grid--4>* {
        max-width: calc(50% - var(--space-6) / 2);
    }
}

@media (max-width: 768px) {

    .grid--2>*,
    .grid--3>*,
    .grid--4>* {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background-color: var(--bg-surface);
    border: var(--border-width-thick) solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-base);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245, 203, 92, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    font-family: var(--font-body);
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
}

.form-checkbox input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-checkbox label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
}

.form-error {
    color: #ef4444;
    font-size: var(--text-sm);
    margin-top: var(--space-2);
}

.form-success {
    color: #22c55e;
    font-size: var(--text-sm);
    margin-top: var(--space-2);
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center {
    text-align: center;
}

.text-accent {
    color: var(--accent);
}

.mb-0 {
    margin-bottom: 0;
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.mt-0 {
    margin-top: 0;
}

.mt-2 {
    margin-top: var(--space-2);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mt-8 {
    margin-top: var(--space-8);
}

/* ============================================
   Accessibility
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to main content */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: var(--accent-text);
    padding: var(--space-2) var(--space-4);
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 600;
    z-index: 1000;
}

.skip-to-main:focus {
    top: 0;
}

/* ============================================
   WhatsApp Floating Button
   ============================================ */
.whatsapp-float {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    width: 56px;
    height: 56px;
    background-color: #25d366;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.whatsapp-float svg {
    width: 28px;
    height: 28px;
    fill: #ffffff;
}

@media (max-width: 768px) {
    .whatsapp-float {
        bottom: var(--space-4);
        right: var(--space-4);
        width: 50px;
        height: 50px;
    }

    .whatsapp-float svg {
        width: 24px;
        height: 24px;
    }
}

/* ============================================
   Contact Alternative Cards
   ============================================ */
.contact-alt {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
    max-width: 700px;
    margin-inline: auto;
}

.contact-alt__card {
    background-color: var(--bg-surface);
    border: var(--border-width-thick) solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-8) var(--space-6);
    text-align: center;
    text-decoration: none;
    transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.contact-alt__card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md), var(--glow-premium);
    transform: translateY(-2px);
}

.contact-alt__icon {
    width: 48px;
    height: 48px;
    margin-inline: auto;
    margin-bottom: var(--space-4);
}

.contact-alt__icon svg {
    width: 100%;
    height: 100%;
}

.contact-alt__card--whatsapp .contact-alt__icon svg {
    fill: #25d366;
}

.contact-alt__card--email .contact-alt__icon svg {
    fill: var(--accent);
}

.contact-alt__card--horario .contact-alt__icon svg {
    fill: var(--accent);
}

.contact-alt__card--horario {
    grid-column: 1 / -1;
    width: 100%;
    justify-self: center;
}

.contact-alt__title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.contact-alt__desc {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .contact-alt {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Cookie Consent Banner
   ============================================ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-surface-elevated);
    border-top: var(--border-width-thick) solid var(--border);
    padding: var(--space-4) var(--space-6);
    z-index: 998;
    transform: translateY(100%);
    transition: transform var(--transition-slow);
}

.cookie-banner.is-visible {
    transform: translateY(0);
}

.cookie-banner__inner {
    max-width: var(--container-max-width);
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
}

.cookie-banner__text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    margin: 0;
}

.cookie-banner__text a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-banner__text a:hover {
    color: var(--accent-hover);
}

.cookie-banner__btn {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .cookie-banner {
        padding: var(--space-4);
    }

    .cookie-banner__inner {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    .cookie-banner__btn {
        width: 100%;
    }
}

/* Adjust WhatsApp float when banner is visible */
.cookie-banner.is-visible ~ .whatsapp-float {
    bottom: 80px;
}

@media (max-width: 768px) {
    .cookie-banner.is-visible ~ .whatsapp-float {
        bottom: 120px;
    }
}

/* ============================================
   Privacy Policy Content
   ============================================ */
.privacy-content h2 {
    font-size: var(--text-2xl);
    margin-top: var(--space-10);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: var(--border-width-thick) solid var(--border);
}

.privacy-content h2:first-of-type {
    margin-top: 0;
}

.privacy-content h3 {
    font-size: var(--text-xl);
    margin-top: var(--space-6);
    margin-bottom: var(--space-3);
}

.privacy-content h4 {
    font-size: var(--text-lg);
    margin-top: var(--space-4);
    margin-bottom: var(--space-2);
    color: var(--accent);
}

.privacy-content p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
}

.privacy-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: var(--space-6);
}

.privacy-content ul li {
    position: relative;
    padding-left: var(--space-6);
    margin-bottom: var(--space-3);
    color: var(--text-secondary);
    font-size: var(--text-base);
}

.privacy-content ul li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 600;
}

.privacy-content table {
    margin-bottom: var(--space-6);
}

.privacy-content th {
    color: var(--text-primary);
}

.privacy-content td {
    color: var(--text-secondary);
}