/* ============================================
   CUSTOM CSS - D'Amico Empreendimentos Imobiliários
   ============================================ */

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Font Loading */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fade In Animation */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Header Shadow on Scroll */
#header.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Mobile Menu Transition */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

#mobile-menu.active {
    max-height: 500px;
}

/* FAQ Accordion */
.faq-item .faq-answer {
    display: block !important;
    max-height: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.faq-item.active .faq-answer {
    max-height: 1000px;
    padding-top: 1rem !important;
    padding-bottom: 1.25rem !important;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-question:hover {
    background-color: #f9fafb;
}

/* Padronizar ícones do FAQ em todos os tamanhos de tela */
.faq-icon {
    width: 1.5rem !important;
    height: 1.5rem !important;
    min-width: 1.5rem !important;
    min-height: 1.5rem !important;
}

/* Form Validation */
input.invalid,
select.invalid,
textarea.invalid {
    border-color: #ef4444;
}

input.valid,
select.valid,
textarea.valid {
    border-color: #10b981;
}

.error-message {
    display: none;
    margin-top: 0.25rem;
}

.error-message.active {
    display: block;
}

/* WhatsApp Mask Input */
input[name="whatsapp"] {
    font-family: monospace;
}

/* Loading State */
button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Form Message */
#form-message.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 2px solid #10b981;
}

#form-message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 2px solid #ef4444;
}

#form-message.show {
    display: block !important;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
}

.footer-logo-invert {
    filter: brightness(0) invert(1);
}

.hero-highlight {
    display: inline;
    position: relative;
    padding: 0 0.35rem;
    background-image: linear-gradient(180deg, transparent 62%, rgba(252, 185, 0, 0.4) 62%);
    background-repeat: no-repeat;
    box-decoration-break: clone;
}

/* Highlight classes do site D'Amico */
.highlight-yellow {
    background-color: #FCB900;
    padding: 0 0.25rem;
}

.highlight-green {
    background-color: #1db89a;
    padding: 0 0.25rem;
    color: #ffffff;
}

/* Cor verde água para ícones de contato */
.text-accent {
    color: #1db89a;
}

/* Container Max Width */
.container {
    max-width: 1280px;
}

/* Prevent Text Selection on Buttons */
button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid #1db89a;
    outline-offset: 2px;
}

/* Custom Scrollbar (Webkit Browsers) */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #1db89a;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #159680;
}

/* Print Styles */
@media print {
    header,
    footer,
    .whatsapp-button {
        display: none !important;
    }
}

/* Animation Delays for Sequential Fade-ins */
.fade-in:nth-child(1) {
    transition-delay: 0.1s;
}

.fade-in:nth-child(2) {
    transition-delay: 0.2s;
}

.fade-in:nth-child(3) {
    transition-delay: 0.3s;
}

.fade-in:nth-child(4) {
    transition-delay: 0.4s;
}

.fade-in:nth-child(5) {
    transition-delay: 0.5s;
}

/* Hover Effects for Cards */
.hover-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Timeline Line (Como Funciona Section) */
.timeline-line {
    position: relative;
}

.timeline-line::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #1db89a, transparent);
    transform: translateX(-50%);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #003057 0%, #1db89a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Button Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.btn-ripple:active::after {
    animation: ripple 0.6s ease-out;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1db89a;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    /* Increase touch targets */
    button,
    a {
        min-height: 44px;
        min-width: 44px;
    }

    /* Reduce font sizes slightly */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    /* Stack images and text */
    .md\:grid-cols-2 > div {
        grid-column: span 1;
    }

    /* Padronizar tamanho de TODOS os ícones SVG no mobile para manter coerência visual */
    svg.w-5,
    svg.w-6,
    svg.w-8,
    svg.w-10,
    svg.w-16 {
        width: 1.5rem !important;  /* 24px - tamanho único padronizado */
        height: 1.5rem !important;
    }

    /* Exceções: manter tamanho original para ícones específicos */
    #mobile-menu-btn svg,
    header nav svg,
    .whatsapp-button svg {
        width: 2rem !important;  /* 32px para header e whatsapp */
        height: 2rem !important;
    }
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
}

/* Ensure proper z-index layering */
header {
    z-index: 1000;
}

.whatsapp-button {
    z-index: 999;
}

/* Accessibility: Skip to Content Link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #003057;
    color: #ffffff;
    padding: 8px;
    text-decoration: none;
    z-index: 1001;
}

.skip-to-content:focus {
    top: 0;
}
