/* ============================================
   CEMEF Engenharia — Custom Styles
   ============================================ */

/* Alpine.js cloak */
[x-cloak] { display: none !important; }

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Body defaults */
body {
    font-family: 'Arial', sans-serif;
    color: #2D3748;
}

/* Nav links — pill style */
.nav-link {
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 16px;
    margin: 0 2px;
    border-radius: 9999px;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}
.nav-link:hover {
    color: #111827;
    background: rgba(0, 0, 0, 0.08);
}
.nav-link.active {
    color: #111827;
    background: rgba(0, 0, 0, 0.12);
}
.mobile-nav-link {
    display: block;
    color: #0A2540 !important;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.15s ease;
}
.mobile-nav-link:hover {
    color: #00509B !important;
    background: rgba(0, 80, 155, 0.08);
}

/* ============================================
   Hero — Enhanced
   ============================================ */
.hero-overlay {
    background: linear-gradient(135deg, rgba(10, 37, 64, 0.92) 0%, rgba(0, 80, 155, 0.75) 50%, rgba(10, 37, 64, 0.88) 100%);
}
.hero-mesh {
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(0, 80, 155, 0.3) 0%, transparent 70%),
        radial-gradient(ellipse 60% 60% at 80% 20%, rgba(96, 165, 250, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 50% 80% at 50% 90%, rgba(0, 80, 155, 0.15) 0%, transparent 70%);
}
.hero-clip {
    clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%);
}
@media (min-width: 1024px) {
    .hero-clip {
        clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
    }
}

/* ============================================
   Section fade-in + stagger
   ============================================ */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.stagger-child {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.stagger-child.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Service card hover
   ============================================ */
.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Table styling (legacy)
   ============================================ */
.tech-table {
    @apply w-full text-sm text-left;
}
.tech-table thead th {
    @apply bg-cemef-dark text-white font-heading font-semibold text-xs uppercase tracking-wider px-4 py-3;
}
.tech-table tbody td {
    @apply px-4 py-3 border-b border-gray-200 text-cemef-text;
}
.tech-table tbody tr:hover {
    @apply bg-cemef-gray;
}
.tech-table tbody tr:nth-child(even) {
    @apply bg-gray-50;
}

/* ============================================
   Value cards
   ============================================ */
.value-card {
    @apply bg-white rounded-xl p-6 text-center shadow-md hover:shadow-lg transition-shadow duration-300 border border-gray-100;
}

/* ============================================
   Trust Bar — Enhanced
   ============================================ */
@keyframes scroll-logos {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.logo-scroll {
    width: max-content;
    animation: scroll-logos 35s linear infinite;
}
.logo-scroll:hover {
    animation-play-state: paused;
}
.trust-bar-mask {
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}
.trust-logo {
    filter: grayscale(100%) opacity(0.5);
    transition: filter 0.4s ease, transform 0.3s ease;
}
.trust-logo:hover {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.08);
}

/* ============================================
   CTA pulse
   ============================================ */
.cta-pulse {
    animation: pulse-ring 2s ease-out infinite;
}
@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.4); }
    70% { box-shadow: 0 0 0 14px rgba(96, 165, 250, 0); }
    100% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0); }
}

/* ============================================
   Spec Grid — Enhanced
   ============================================ */
.spec-grid {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
}
.spec-grid-header {
    display: none;
    background: linear-gradient(135deg, #0A2540 0%, #0D3157 100%);
}
@media (min-width: 768px) {
    .spec-grid-header {
        display: grid;
        grid-template-columns: 1fr 2fr 1.5fr;
    }
}
.spec-grid-header > div {
    padding: 16px 24px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: 'Arial', sans-serif;
}
.spec-grid-header > div + div {
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.spec-grid-row {
    display: grid;
    grid-template-columns: 1fr;
    background: #fff;
    border-bottom: 1px solid #F1F5F9;
    transition: all 0.25s ease;
    position: relative;
}
.spec-grid-row:last-child { border-bottom: none; }
.spec-grid-row:nth-child(odd) { background: #FAFBFD; }
.spec-grid-row:hover {
    background: #EFF6FF;
    box-shadow: inset 4px 0 0 #60A5FA;
}
@media (min-width: 768px) {
    .spec-grid-row {
        grid-template-columns: 1fr 2fr 1.5fr;
    }
}

.spec-cell-name {
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-left: 3px solid #60A5FA;
}
@media (min-width: 768px) {
    .spec-cell-name {
        border-left: none;
        border-right: 1px solid #F1F5F9;
    }
}
.spec-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(96, 165, 250, 0.05));
    color: #60A5FA;
    font-size: 11px;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Arial', sans-serif;
    margin-top: 2px;
    transition: transform 0.2s ease, background 0.2s ease;
}
.spec-grid-row:hover .spec-num {
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.25), rgba(96, 165, 250, 0.1));
}
.spec-cell-name > span:last-child {
    font-weight: 600;
    font-size: 14px;
    color: #0A2540;
    line-height: 1.45;
}

.spec-cell-body {
    padding: 20px 24px;
    font-size: 14px;
    color: #4A5568;
    line-height: 1.65;
}
@media (min-width: 768px) {
    .spec-cell-body { border-right: 1px solid #F1F5F9; }
}

.spec-cell-result {
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    border-top: 1px solid #F1F5F9;
}
@media (min-width: 768px) {
    .spec-cell-result { border-top: none; }
}
.spec-cell-result svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: #10B981;
    margin-top: 3px;
}
.spec-cell-result > div {
    font-size: 14px;
    font-weight: 500;
    color: #0A2540;
    line-height: 1.55;
}

.spec-mobile-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #9CA3AF;
    margin-bottom: 3px;
}
@media (min-width: 768px) {
    .spec-mobile-label { display: none; }
}

/* ============================================
   Technique cards — alternating layout
   ============================================ */
.technique-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.technique-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}
.technique-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}

/* ============================================
   Stats counter animation
   ============================================ */
.count-up {
    display: inline-block;
}

/* ============================================
   CTA section enhanced
   ============================================ */
.cta-section-pattern {
    background-image: url('data:image/svg+xml,%3Csvg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23ffffff" fill-opacity="0.05"%3E%3Cpath d="M20 20.5a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
}

/* ============================================
   Contact form — floating labels
   ============================================ */
.form-group {
    position: relative;
}
.form-group input,
.form-group textarea {
    width: 100%;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px 16px 8px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    background: #FAFBFC;
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: #00509B;
    box-shadow: 0 0 0 3px rgba(0, 80, 155, 0.1);
    background: #fff;
}
.form-group label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #9CA3AF;
    pointer-events: none;
    transition: all 0.2s ease;
}
.form-group textarea ~ label {
    top: 20px;
    transform: none;
}
.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label {
    top: 8px;
    transform: none;
    font-size: 10px;
    font-weight: 600;
    color: #00509B;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.form-group textarea:focus ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
    top: 4px;
    font-size: 10px;
    font-weight: 600;
    color: #00509B;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ============================================
   Stat card enhanced
   ============================================ */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #60A5FA, #00509B);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}
.stat-card:hover::before {
    opacity: 1;
}

/* ============================================
   Section divider — diagonal
   ============================================ */
.section-divider {
    position: relative;
}
.section-divider::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 60px;
    background: inherit;
    clip-path: polygon(0 0, 100% 60%, 100% 100%, 0 100%);
}

/* ============================================
   Benefit pills (contact form)
   ============================================ */
.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
}
.benefit-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Hero background slideshow
   ============================================ */
.hero-slide {
    transition: opacity 1s ease-in-out;
}

/* ============================================
   Footer logo — invertido para fundo escuro
   ============================================ */
.footer-logo {
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

/* ============================================
   Responsive adjustments
   ============================================ */

/* Hero text scaling on very small screens */
@media (max-width: 374px) {
    .hero-clip h1,
    section h1 {
        font-size: 1.5rem !important;
        line-height: 1.25 !important;
    }
    .hero-clip p {
        font-size: 0.875rem !important;
    }
}

/* Spec grid mobile improvements */
@media (max-width: 767px) {
    .spec-grid-row {
        padding: 4px 0;
    }
    .spec-cell-name,
    .spec-cell-body,
    .spec-cell-result {
        padding: 12px 16px;
    }
}

/* Admin sidebar logo on small screens */
@media (max-width: 1023px) {
    .lg\:ml-64 {
        margin-left: 0;
    }
}

/* LP CTA footer button responsive */
@media (max-width: 480px) {
    .cta-pulse {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        font-size: 0.875rem;
    }
}

/* Trust bar responsive */
@media (max-width: 640px) {
    .logo-scroll {
        animation-duration: 20s;
    }
}

/* ============================================
   Texto justificado global
   ============================================ */
p,
.spec-cell-body,
.technique-card p {
    text-align: justify;
}
