/* Fontana y Asociados - Estudio Contable */
/* Estilos principales - Diseño minimalista y moderno */

/* Variables CSS para consistencia */
:root {
    /* Colores principales */
    --primary-color: #1e3a8a;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --primary-dark: #1e293b;
    --primary-light: #334155;
    
    /* Colores de texto */
    --text-dark: #0f172a;
    --text-light: #475569;
    --text-muted: #64748b;
    --text-on-dark: #e2e8f0; /* Texto sobre fondos oscuros */
    --text-on-light: #0f172a; /* Texto sobre fondos claros */
    
    /* Colores de fondo */
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-gray: #f1f5f9;
    --bg-slate: #f8fafc;
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --bg-gradient-dark: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --bg-pattern: radial-gradient(circle at 1px 1px, rgba(30, 58, 138, 0.1) 1px, transparent 0);
    
    /* Bordes y sombras */
    --border-color: #e2e8f0;
    --border-dark: #cbd5e1;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
    
    /* Layout y espaciado */
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --header-height: 72px; /* Altura fija del header para compensar scroll */
    --vh: 1vh; /* Variable para calcular 100vh en móviles (evita problemas de viewport) */
}

/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
    overflow-x: hidden;
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* Contenedor principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header y navegación */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: var(--transition);
    min-height: var(--header-height);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.logo:hover {
    color: var(--secondary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

/* Botón hamburguesa para móvil */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    margin: 3px 0;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    --hero-overlay: rgba(30, 58, 138, 0.85);
    --hero-background: linear-gradient(135deg, #1e293b 0%, #1e40af 50%, #1e293b 100%);
    min-height: calc((var(--vh, 1vh) * 100) - var(--header-height));
    padding: calc(var(--header-height) + 2rem) 0 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: linear-gradient(var(--hero-overlay), var(--hero-overlay)), var(--hero-background);
    background-size: cover;
    background-position: center;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-pattern);
    background-size: 20px 20px;
    opacity: 0.2;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero p {
    font-size: clamp(1.0625rem, 2vw, 1.25rem);
    max-width: 640px;
    margin: 0 auto 2rem;
    color: var(--text-on-dark);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
}

.btn:focus-visible {
    outline: 3px solid #fef3c7;
    outline-offset: 2px;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

/* Hero con imagen de fondo optimizada */
.hero--home {
    --hero-background: url('../img/photos/trabajocontableprofesional.jpg');
}

/* Hero interno sin imagen */
.hero--inner {
    min-height: clamp(320px, 60vh, 520px);
    padding: calc(var(--header-height) + 2rem) 0 3rem;
}

.hero--inner.hero--with-image {
    --hero-overlay: rgba(30, 64, 175, 0.75);
}

/* Secciones */
.section {
    padding: clamp(4.5rem, 7vw, 7rem) 0;
    position: relative;
}

.section > .container {
    position: relative;
    z-index: 1;
}

/* Scroll margin para evitar que el header tape contenido */
section[id] {
    scroll-margin-top: calc(var(--header-height) + 16px);
}

/* Variaciones de fondo para secciones */
.section-light {
    background: var(--bg-white);
}

.section-gray {
    background: var(--bg-gradient);
}

.section-slate {
    background: var(--bg-slate);
    position: relative;
}

.section-slate::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(248, 250, 252, 0.35);
    background-image: var(--bg-pattern);
    background-size: 30px 30px;
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
}



.section-dark {
    background: var(--bg-gradient-dark);
    color: white;
    position: relative;
}

.section-dark::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-pattern);
    background-size: 30px 30px;
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
}

.section-dark h2,
.section-dark h3,
.section-dark h4 {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.section-dark p {
    color: var(--text-on-dark);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.section-dark .section-title {
    position: relative;
    z-index: 1;
}

/* Fondos de secciones específicas */
.section--team-preview {
    position: relative;
    overflow: hidden;
    padding: clamp(5rem, 7vw, 7rem) 0 clamp(6.5rem, 8vw, 9rem);
    min-height: clamp(600px, 90vh, 860px);
}

.section--team-preview::before {
    content: none;
}

.section--team-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.15) 0%, rgba(15, 23, 42, 0.45) 100%);
    z-index: 0;
}

.section--team-preview .section-title,
.section--team-preview .section-title h2,
.section--team-preview .section-title p {
    color: #f8fafc;
    text-shadow: 0 3px 10px rgba(15, 23, 42, 0.55);
}

.section--team-preview .container {
    position: relative;
    z-index: 1;
}

.section--contact-info {
    background-image: linear-gradient(rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.94)), url('../img/photos/modern-office.svg');
    background-size: cover;
    background-position: center;
}

.section--data-process {
    background-image: linear-gradient(rgba(15, 23, 42, 0.4), rgba(15, 23, 42, 0.4)), url('../img/photos/analisis.jpg');
    background-size: cover;
    background-position: center;
    padding-top: clamp(4rem, 8vw, 9rem);
    padding-bottom: var(--section-spacing-bottom, clamp(10rem, 12vw, 14rem));
}

.section--data-process .services-grid {
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: clamp(2rem, 2.75vw, 3rem);
}

@media (max-width: 1023px) {
    .section--data-process .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: clamp(1.75rem, 3vw, 2.5rem);
    }
}

.section--data-process + .section {
    margin-top: clamp(6rem, 8vw, 9rem);
}

.section--team-meeting {
    background-image: linear-gradient(rgba(15, 23, 42, 0.35), rgba(15, 23, 42, 0.35)), url('../img/photos/fontana.jpg');
    background-size: cover;
    background-position: center;
}


/* Parallax optimizado para desktop */
@media (min-width: 1025px) {
    .parallax-background,
    .section--team-preview,
    .section--data-process,
    .section--team-meeting {
        background-attachment: fixed;
        background-position: center;
    }
}

/* Desactivar parallax en móviles para rendimiento */
@media (max-width: 1024px) {
    .section--team-preview,
    .section--data-process,
    .section--team-meeting {
        background-attachment: scroll;
    }
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-title p {
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Grid de servicios */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: var(--transition);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.service-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.service-card:hover .service-icon {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.service-card h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.service-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Listas de servicios con bullets CSS */
.service-card ul {
    list-style: none;
    padding-left: 0;
    margin-top: 1.5rem;
}

.service-card ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-light);
}

.service-card ul li::before {
    content: '\2022';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary-color);
    font-weight: 700;
}

.service-card ul li:last-child {
    margin-bottom: 0;
}

/* Equipo */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: clamp(2rem, 2.5rem, 3rem);
    margin-top: clamp(2.5rem, 3vw, 3.5rem);
}

.team-cta {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}


.team-member {
    text-align: left;
    background: rgba(255, 255, 255, 0.93);
    padding: clamp(2rem, 2.25rem + 0.5vw, 2.75rem);
    border-radius: calc(var(--border-radius) + 4px);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    min-height: 100%;
    position: relative;
    color: var(--primary-dark);
}

.team-member::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(30, 58, 138, 0.08);
    pointer-events: none;
}

.team-member:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.team-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin: 0 auto 1.75rem;
    background: var(--bg-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-muted);
    overflow: hidden;
    position: relative;
}

.team-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
}

.team-member h4 {
    margin-bottom: 0.75rem;
    color: var(--primary-dark);
}

.team-member p {
    color: var(--text-on-light);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Formulario de contacto */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Grid de formulario */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* Checkbox styling */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.form-check input[type="checkbox"] {
    margin-top: 0.2rem;
    min-width: 20px;
    min-height: 20px;
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.form-helper {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 1rem;
}

/* Error states */
.form-error {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #b91c1c;
    min-height: 1.25rem;
}

.form-group input[aria-invalid="true"],
.form-group textarea[aria-invalid="true"],
.form-group select[aria-invalid="true"] {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgb(220 38 38 / 0.15);
}

.form-status {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    background: #ecfdf5;
    color: #065f46;
    font-weight: 500;
    display: none;
}

.form-status.is-visible {
    display: block;
}

/* Información de contacto */
.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.contact-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    color: var(--text-dark);
}

.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.section-dark .contact-item {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    color: var(--primary-dark);
}

.section-dark .contact-item h4 {
    color: var(--primary-color);
}

.section-dark .contact-item p {
    color: var(--primary-dark);
}

.contact-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    transition: var(--transition);
}

.contact-item:hover .contact-icon {
    transform: scale(1.1);
    background: var(--primary-dark);
}

/* Footer */
.footer {
    background: var(--bg-gradient-dark);
    color: white;
    padding: 3rem 0 1rem;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-pattern);
    background-size: 25px 25px;
    opacity: 0.2;
    pointer-events: none;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section p,
.footer-section a {
    color: var(--text-on-dark);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #475569;
    padding-top: 1rem;
    text-align: center;
    color: #94a3b8;
    position: relative;
    z-index: 1;
}

/* Botones flotantes */
.floating-buttons {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.floating-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.whatsapp-btn {
    background: #25d366;
    color: white;
}

.whatsapp-btn:hover {
    background: #128c7e;
    transform: scale(1.1);
}

.scroll-top-btn {
    background: var(--primary-color);
    color: white;
}

.scroll-top-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

/* Animaciones */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Lazy loading */
img.lazy {
    opacity: 0;
    transition: opacity 0.4s ease;
}

img.lazy.loaded {
    opacity: 1;
}

/* Utilidades */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.hidden {
    display: none;
}

/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--bg-white);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 2rem;
        transition: var(--transition);
        box-shadow: var(--shadow-md);
    }

    .nav-menu.active {
        left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.125rem;
    }

    .section {
        padding: 3rem 0;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .services-grid,
    .team-grid {
        grid-template-columns: 1fr;
    }

    .floating-buttons {
        bottom: 1rem;
        right: 1rem;
    }

    .floating-btn {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }

    .hero {
        padding: 6rem 0 3rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .section {
        padding: 2rem 0;
    }

    .service-card,
    .team-member {
        padding: 1.5rem;
    }

    .contact-form {
        padding: 1.5rem;
    }
}