/* 
  Uni Terraplanagem Design System v2.0-ULTIMATE
  Strategic Design Team
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Fira+Code&display=swap');

:root {
    /* Color Palette */
    --color-primary: #FFC107;
    /* Amarelo Ouro */
    --color-secondary: #FF9800;
    /* Laranja Vibrante */
    --color-tertiary-dark: #4E342E;
    /* Marrom Terra */
    --color-tertiary-light: #795548;
    /* Marrom Argila */
    --color-neutral-dark: #000000;
    /* Preto Sólido */
    --color-neutral-text: #212121;
    /* Cinza Grafite */

    /* Semantic Colors */
    --bg-primary: #FFFFFF;
    --bg-surface: #F5F5F5;
    --text-primary: #000000;
    --text-secondary: #666666;
    --border-color: #E0E0E0;
    --focus-ring: rgba(255, 193, 7, 0.3);
    --success: #4CAF50;
    --warning: #FF9800;
    --error: #F44336;
    --info: #2196F3;

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
    --gradient-cta: linear-gradient(90deg, #FF9800 0%, #FFC107 100%);
    --gradient-depth: linear-gradient(180deg, #4E342E 0%, #212121 100%);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Fira Code', Monaco, monospace;

    /* Spacing Scale */
    --space-0: 0;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;

    /* Semantic Spacing */
    --space-xs: var(--space-1);
    --space-sm: var(--space-2);
    --space-md: var(--space-4);
    --space-lg: var(--space-6);
    --space-xl: var(--space-8);
    --space-2xl: var(--space-12);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-base: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.15);
    --shadow-primary-glow: 0 4px 12px rgba(255, 193, 7, 0.3);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;

    /* Accessibility Variables */
    --font-scale: 1;
}

/* High Contrast Theme */
body.high-contrast {
    --bg-primary: #000000;
    --bg-surface: #121212;
    --text-primary: #FFFF00;
    --text-secondary: #FFFFFF;
    --color-primary: #FFFF00;
    --color-secondary: #FFD700;
    --border-color: #FFFF00;
    --color-neutral-dark: #000000;
    --color-neutral-text: #FFFF00;
}

body.high-contrast .card,
body.high-contrast .input,
body.high-contrast .header-desktop {
    background: #000;
    border: 2px solid #FFFF00;
    color: #FFFF00;
}

body.high-contrast .btn-primary {
    background: #FFFF00;
    color: #000;
    border: 2px solid #000;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--color-neutral-text);
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: 72px;
    font-size: calc(16px * var(--font-scale));
    /* For mobile nav */
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Scroll Reveal */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.2s;
}

.reveal-delay-3 {
    transition-delay: 0.3s;
}

@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }
}

/* Typography */
h1,
h2,
h3,
h4,
h5 {
    color: var(--color-neutral-dark);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-lg);
}

h1 {
    font-size: 32px;
    /* Mobile first */
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
}

@media (min-width: 1024px) {
    h1 {
        font-size: 56px;
    }

    h2 {
        font-size: 40px;
    }

    h3 {
        font-size: 28px;
    }

    h4 {
        font-size: 20px;
    }

    h5 {
        font-size: 16px;
    }
}

.body-large {
    font-size: 18px;
    line-height: 1.6;
    color: #333333;
    margin-bottom: var(--space-md);
}

.body-regular {
    font-size: 16px;
    line-height: 1.6;
    color: #333333;
    margin-bottom: var(--space-md);
}

.body-small {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-neutral-text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    border-radius: var(--radius-base);
    font-weight: 600;
    font-size: 16px;
    min-height: 48px;
    border: none;
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
    gap: 12px;
    text-align: center;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-neutral-dark);
    box-shadow: var(--shadow-primary-glow);
}

.btn-primary:hover {
    background-color: var(--color-secondary);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 20px rgba(255, 193, 7, 0.5);
}

.btn-primary:active {
    background-color: #FF8F00;
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: var(--color-neutral-dark);
    /* Black on Orange = 8:1 (WCAG AA Pass) */
    border: none;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background-color: #E65100;
    /* Darker orange for state feedback */
    color: #FFFFFF;
    /* White on Dark Orange = 4.7:1 (WCAG AA Pass) */
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    color: #BF360C;
    /* High-contrast deep orange specifically for text on white */
    border: 2px solid #BF360C;
}

.btn-outline:hover {
    background-color: #BF360C;
    color: #FFFFFF;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    min-height: 36px;
}

.btn-large {
    padding: 20px 40px;
    font-size: 18px;
    min-height: 56px;
}

/* Cards */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    /* Light subtle border instead of thick brown */
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--color-secondary);
    box-shadow: var(--shadow-xl);
}

.card:focus-within {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
}

.card-elevated {
    border: none;
    box-shadow: var(--shadow-lg);
}

.card-flat {
    background: var(--bg-surface);
    border: none;
    border-radius: var(--radius-base);
    padding: 20px;
}

/* Image Styling */
img {
    max-width: 100%;
    display: block;
    transition: var(--transition-base);
}

.img-hover-zoom {
    overflow: hidden;
    border-radius: var(--radius-md);
}

.img-hover-zoom img:hover {
    transform: scale(1.05);
}

/* Form Elements */
.input-group {
    margin-bottom: var(--space-lg);
}

.label-form {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 600;
    font-size: 14px;
}

.input {
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-base);
    padding: 12px 16px;
    font-size: 16px;
    line-height: 1.5;
    min-height: 48px;
    font-family: inherit;
    transition: var(--transition-fast);
}

.input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--focus-ring);
    outline: none;
}

.textarea {
    min-height: 120px;
    resize: vertical;
}

.select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23212121'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 18px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    background: rgba(0, 0, 0, 0.4);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    backdrop-filter: blur(4px);
}

.badge::before {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--color-primary);
    border-radius: 50%;
    display: inline-block;
}

.badge::after {
    content: '';
    position: absolute;
    left: 18px;
    /* Correctly aligned with the ::before dot */
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: var(--color-primary);
    border-radius: 50%;
    z-index: 0;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0% {
        transform: translateY(-50%) scale(1);
        opacity: 0.6;
    }

    100% {
        transform: translateY(-50%) scale(2.8);
        opacity: 0;
    }
}

.badge-secondary {
    background: var(--color-secondary);
    color: var(--bg-primary);
}

.badge-outline {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

/* Dividers */
.divider-hr {
    height: 4px;
    background: var(--gradient-cta);
    border: none;
    margin: var(--space-8) 0;
}

.divider-subtle {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-4) 0;
}

/* Mobile Bottom Navigation */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}

@media (min-width: 768px) {
    .mobile-nav {
        display: none;
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    gap: 4px;
    flex: 1;
    transition: var(--transition-fast);
}

.nav-item i,
.nav-item .icon {
    font-size: 24px;
}

.nav-item.active {
    color: var(--color-primary);
}

/* Floating CTA */
.floating-cta {
    position: fixed;
    bottom: 84px;
    right: 24px;
    background: var(--color-primary);
    color: var(--color-neutral-dark);
    padding: 12px 24px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--shadow-xl);
    z-index: 101;
    transition: var(--transition-base);
}

@media (min-width: 768px) {
    .floating-cta {
        bottom: 32px;
        right: 32px;
    }
}

.floating-cta:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(255, 193, 7, 0.5);
}

/* Layout Sections */
section {
    padding: 48px 24px;
}

@media (min-width: 1024px) {
    section {
        padding: 96px 40px;
    }
}

.container {
    max-width: 1280px;
    margin: 0 auto;
}

/* Header Desktop */
.header-desktop {
    display: none;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 16px 40px;
    border-bottom: 1px solid var(--border-color);
}

@media (min-width: 768px) {
    .header-desktop {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

.desktop-nav {
    display: flex;
    gap: 32px;
    list-style: none;
}

.desktop-nav a {
    text-decoration: none;
    color: var(--color-neutral-dark);
    font-weight: 600;
    transition: var(--transition-fast);
}

.desktop-nav a:hover {
    color: var(--color-primary);
}

/* Slider Hero Layout */
.hero {
    height: 90vh;
    min-height: 600px;
    padding: 0;
    overflow: hidden;
    background: var(--color-neutral-dark);
    position: relative;
    /* Removed flex to allow absolute positioning of overlay */
}

@media (max-width: 1024px) {
    .hero {
        height: auto;
        min-height: 100vh;
        display: block;
    }
}

.hero-wrapper {
    position: relative;
    height: 100%;
    width: 100%;
}

@media (max-width: 1024px) {
    .hero-wrapper {
        display: flex;
        flex-direction: column;
    }
}

@media (min-width: 1024px) {
    .hero-wrapper {
        flex-direction: row;
        /* We'll use absolute positioning for the form on desktop */
    }
}

/* Slider Section */
.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .hero-slider {
        position: relative;
        height: 50vh;
    }
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
    z-index: 1;
}

.slide .container {
    height: 100%;
    display: flex;
    align-items: center;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    opacity: 0.5;
    z-index: -1;
}

.slide-1::before {
    background-image: url('service_leveling.png');
}

.slide-2::before {
    background-image: url('hero_excavator.png');
}

.slide-3::before {
    background-image: url('cat_excavator.png');
}

.slide-content {
    max-width: 600px;
    transform: translateX(-30px);
    transition: transform 0.8s 0.2s ease;
}

.slide.active .slide-content {
    transform: translateX(0);
}

.slide-content h1 {
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    margin-bottom: var(--space-md);
}

.slide-content h1 span {
    color: var(--color-primary);
}

.slide-content p {
    color: white;
    font-weight: 500;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
    margin-bottom: var(--space-lg);
    font-size: 1.1rem;
    max-width: 500px;
}

@media (max-width: 768px) {
    .slide-content {
        text-align: center;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .slide-content p {
        margin-left: auto;
        margin-right: auto;
    }
}

/* Form Section (Overlay) */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.hero-overlay .container {
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.hero-form-wrapper {
    pointer-events: auto;
    width: 100%;
    max-width: 440px;
    padding: 24px;
    z-index: 5;
}

.glass-morphism {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

@media (min-width: 1024px) {
    .hero-form-wrapper {
        padding: 32px;
        border-radius: var(--radius-lg);
        height: auto;
    }
}

@media (max-width: 1024px) {
    .hero-overlay {
        position: relative;
        height: auto;
        pointer-events: auto;
    }

    .hero-overlay .container {
        justify-content: center;
        padding: 40px 24px;
    }

    .hero-form-wrapper {
        max-width: 100%;
        margin: 0;
        border-radius: var(--radius-md);
        /* Added a small radius for mobile cards */
    }
}

.hero-form-card {
    width: 100%;
    max-width: 400px;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.mb-10 {
    margin-bottom: var(--space-10);
}

.mb-12 {
    margin-bottom: var(--space-12);
}

.grid {
    display: grid;
    gap: 24px;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .grid-6 {
        grid-template-columns: repeat(6, 1fr);
    }
}

.cat-item {
    background: var(--bg-surface);
    padding: 16px;
    border-radius: var(--radius-base);
    text-align: center;
    transition: var(--transition-base);
    border: 1px solid transparent;
}

.cat-item:hover {
    background: white;
    border-color: var(--color-primary);
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-primary-glow);
}

.segment-card {
    background: white;
    padding: 32px 24px;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    border: 2px solid transparent;
}

.segment-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.segment-card i {
    font-size: 40px;
    color: var(--color-primary);
    margin-bottom: 20px;
}

/* Cookie Consent Banner */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px) saturate(180%);
    border-top: 1px solid var(--border-color);
    padding: 24px;
    z-index: 3000;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
}

.cookie-consent.active {
    transform: translateY(0);
}

.cookie-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    text-align: center;
}

@media (min-width: 768px) {
    .cookie-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.cookie-buttons {
    display: flex;
    gap: 12px;
}

/* Accessibility Widget */
.a11y-widget {
    position: fixed;
    bottom: 84px;
    left: 24px;
    z-index: 2500;
}

@media (min-width: 768px) {
    .a11y-widget {
        bottom: 32px;
        left: 32px;
    }
}

.a11y-trigger {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-neutral-dark);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-xl);
    transition: var(--transition-base);
    border: 2px solid var(--color-primary);
}

.a11y-trigger:hover {
    transform: scale(1.1) rotate(5deg);
    background: var(--color-primary);
    color: black;
}

.a11y-panel {
    position: absolute;
    bottom: 72px;
    left: 0;
    width: 260px;
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    display: none;
    border: 1px solid var(--border-color);
}

.a11y-panel.active {
    display: block;
    animation: revealUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.a11y-option {
    margin-bottom: 24px;
}

.a11y-option:last-child {
    margin-bottom: 0;
}

.a11y-label {
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 12px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.a11y-controls {
    display: flex;
    gap: 10px;
}

.a11y-btn {
    flex: 1;
    height: 44px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    border-radius: var(--radius-base);
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.a11y-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-secondary);
}

.a11y-btn.active {
    background: var(--color-neutral-dark);
    color: white;
    border-color: var(--color-neutral-dark);
}