/**
 * Estudio Jurídico Ávalos Muñoz — Estilos Personalizados
 * Landing Page Institucional
 *
 * Este archivo complementa Bootstrap 5 con la identidad visual del estudio.
 * Bootstrap resuelve estructura y utilidades; este CSS define la personalidad.
 */

/* ===========================================
   1. VARIABLES CSS — PALETA Y TOKENS
   =========================================== */
:root {
    /* Azules Oscuros */
    --primary: #0F172A;
    --primary-light: #1E293B;

    /* Acentos Dorados */
    --accent: #B5965E;
    --accent-hover: #9A7D4A;

    /* Acento de Identidad */
    --accent-purple: #86198F;

    /* Fondos y Superficies */
    --bg-body: #F8FAFC;
    --bg-card: #FFFFFF;

    /* Tipografía y Bordes */
    --text-main: #1E293B;
    --text-muted: #64748B;
    --text-on-dark: #F1F5F9;
    --border: #E2E8F0;

    /* Sombras */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.12);

    /* Tipografía */
    --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Transiciones */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Bordes redondeados */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* ===========================================
   2. RESET Y ESTILOS GENERALES
   =========================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-body);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===========================================
   3. TIPOGRAFÍA
   =========================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--primary);
    font-weight: 700;
    line-height: 1.3;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.text-accent {
    color: var(--accent);
}

.text-primary-custom {
    color: var(--primary);
}

/* ===========================================
   4. SECCIONES GENERALES
   =========================================== */
section {
    padding: 5rem 0;
}

.section-dark {
    background-color: var(--primary);
    color: var(--text-on-dark);
}

.section-dark h2,
.section-dark h3 {
    color: var(--text-on-dark);
}

.section-dark p {
    color: var(--text-on-dark);
    opacity: 0.85;
}

.section-title {
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem;
    font-size: 1.05rem;
}

.section-divider {
    width: 60px;
    height: 3px;
    background-color: var(--accent);
    margin: 1rem auto 1.5rem;
    border: none;
    border-radius: 2px;
}

/* ===========================================
   5. NAVBAR
   =========================================== */
.navbar-custom {
    background-color: var(--primary);
    padding: 0.8rem 0;
    transition: all var(--transition-base);
    box-shadow: none;
}

.navbar-custom.scrolled {
    padding: 0.5rem 0;
    box-shadow: var(--shadow-md);
}

.navbar-custom .navbar-brand {
    font-family: var(--font-heading);
    color: var(--text-on-dark);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
}

.navbar-brand-badge {
    width: 54px;
    height: 54px;
    min-width: 54px;
    background-color: #FFFFFF;
    border-radius: 50%;
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 12px rgba(181, 150, 94, 0.45), var(--shadow-sm);
    padding: 6px;
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.navbar-custom .navbar-brand:hover .navbar-brand-badge {
    transform: scale(1.06);
    box-shadow: 0 0 18px rgba(181, 150, 94, 0.7);
}

.navbar-brand-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-title {
    font-size: clamp(1.05rem, 1.25vw, 1.2rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-on-dark);
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.brand-ampersand {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-style: italic;
    font-weight: 400;
    color: inherit;
    font-size: 1.1em;
    letter-spacing: 0;
}

.brand-subtitle {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.navbar-custom .nav-link {
    color: var(--text-on-dark);
    opacity: 0.85;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: opacity var(--transition-fast), color var(--transition-fast);
    position: relative;
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: var(--accent);
    opacity: 1;
}

.navbar-custom .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width var(--transition-base);
}

.navbar-custom .nav-link:hover::after,
.navbar-custom .nav-link.active::after {
    width: 60%;
}

.navbar-toggler-custom {
    border: 1px solid rgba(241, 245, 249, 0.3);
    padding: 0.4rem 0.6rem;
}

.navbar-toggler-custom .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(241, 245, 249, 0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ===========================================
   6. BOTONES
   =========================================== */
.btn-accent {
    background-color: var(--accent);
    color: var(--primary);
    border: none;
    font-weight: 600;
    padding: 0.7rem 1.8rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-accent:hover {
    background-color: var(--accent-hover);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-light-custom {
    border: 2px solid var(--text-on-dark);
    color: var(--text-on-dark);
    background: transparent;
    font-weight: 600;
    padding: 0.65rem 1.6rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-outline-light-custom:hover {
    background-color: var(--text-on-dark);
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-whatsapp {
    background-color: #25D366;
    color: #FFFFFF;
    border: none;
    font-weight: 600;
    padding: 0.7rem 1.8rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-whatsapp:hover {
    background-color: #1EBE57;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-portal {
    background-color: var(--accent-purple);
    color: #FFFFFF;
    border: none;
    font-weight: 600;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-portal:hover {
    background-color: #6B1075;
    color: #FFFFFF;
    transform: translateY(-1px);
}

/* ===========================================
   7. HERO SECTION
   =========================================== */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    min-height: 85vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(181, 150, 94, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(134, 25, 143, 0.06) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    color: var(--text-on-dark);
    font-size: clamp(2.2rem, 5.5vw, 3.5rem);
    margin-bottom: 1rem;
}

.hero-section .lead {
    color: var(--text-on-dark);
    opacity: 0.9;
    font-size: clamp(1rem, 2vw, 1.2rem);
    max-width: 600px;
    line-height: 1.8;
}

.hero-badge {
    display: inline-block;
    background: rgba(181, 150, 94, 0.15);
    color: var(--accent);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(181, 150, 94, 0.3);
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

/* ===========================================
   8. CARDS DE SERVICIOS
   =========================================== */
.service-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all var(--transition-base);
    height: 100%;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.service-card .service-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.5rem;
    color: var(--accent);
}

.service-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.8rem;
}

.service-card p {
    font-size: 0.92rem;
    line-height: 1.6;
}

/* ===========================================
   9. EQUIPO / NOSOTROS
   =========================================== */
.team-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    text-align: center;
    height: 100%;
    cursor: pointer;
}

.team-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
    border-color: var(--accent);
}

.team-card .team-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 2rem auto 1rem;
    border: 3px solid var(--accent);
}

.team-card .team-initials {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    margin: 2rem auto 1rem;
    border: 3px solid var(--accent);
}

.team-card .team-body {
    padding: 0 1.5rem 2rem;
}

.team-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.team-card .team-role {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.team-card .team-education {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===========================================
   10. CONTACTO / FORMULARIO
   =========================================== */
.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-info-item .contact-icon {
    width: 45px;
    height: 45px;
    min-width: 45px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.1rem;
}

.contact-info-item h4 {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.contact-info-item p {
    font-size: 0.9rem;
    margin: 0;
}

.contact-info-item a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.contact-info-item a:hover {
    color: var(--accent-hover);
}

.form-control-custom {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    background-color: var(--bg-card);
}

.form-control-custom:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(181, 150, 94, 0.15);
    outline: none;
}

.form-label-custom {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

/* ===========================================
   11. FOOTER
   =========================================== */
.footer-custom {
    background-color: var(--primary);
    color: var(--text-on-dark);
    padding: 3rem 0 1.5rem;
}

.footer-custom h5 {
    color: var(--accent);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-custom p,
.footer-custom li {
    color: var(--text-on-dark);
    opacity: 0.8;
    font-size: 0.9rem;
}

.footer-custom a {
    color: var(--text-on-dark);
    opacity: 0.8;
    text-decoration: none;
    transition: opacity var(--transition-fast), color var(--transition-fast);
}

.footer-custom a:hover {
    opacity: 1;
    color: var(--accent);
}

.footer-custom .footer-social a {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(241, 245, 249, 0.2);
    border-radius: var(--radius-md);
    margin-right: 0.5rem;
    font-size: 1rem;
    transition: all var(--transition-base);
}

.footer-custom .footer-social a:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--primary);
    opacity: 1;
}

.footer-bottom {
    border-top: 1px solid rgba(241, 245, 249, 0.1);
    padding-top: 1.5rem;
    margin-top: 2rem;
}

.footer-bottom p {
    font-size: 0.8rem;
    margin: 0;
}

/* ===========================================
   12. BOTÓN FLOTANTE WHATSAPP
   =========================================== */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 1.6rem;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
    z-index: 1000;
    transition: all var(--transition-base);
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
    color: #FFFFFF;
}

/* ===========================================
   13. ANIMACIONES DE ENTRADA
   =========================================== */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===========================================
   14. RESPONSIVE
   =========================================== */

/* Tablets */
@media (max-width: 991.98px) {
    section {
        padding: 3.5rem 0;
    }

    .hero-section {
        min-height: 70vh;
        text-align: center;
    }

    .hero-section .lead {
        margin-left: auto;
        margin-right: auto;
    }

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

    .navbar-custom .navbar-collapse {
        background-color: var(--primary);
        padding: 1rem;
        border-radius: var(--radius-md);
        margin-top: 0.5rem;
    }
}

/* Smartphones */
@media (max-width: 575.98px) {
    section {
        padding: 3rem 0;
    }

    .navbar-brand-badge {
        width: 44px;
        height: 44px;
        min-width: 44px;
        padding: 4px;
    }

    .brand-title {
        font-size: 1.05rem;
    }

    .brand-subtitle {
        font-size: 0.65rem;
    }

    .hero-section {
        min-height: 65vh;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero-buttons .btn-accent,
    .hero-buttons .btn-outline-light-custom,
    .hero-buttons .btn-whatsapp {
        width: 100%;
        justify-content: center;
    }

    .service-card {
        padding: 1.5rem;
    }

    .whatsapp-float {
        bottom: 16px;
        right: 16px;
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }
}

/* ===========================================
   NAVBAR RESPONSIVE FIXES
   =========================================== */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: rgba(10, 19, 39, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 1rem;
        border-radius: var(--radius-md);
        margin-top: 0.5rem;
        border: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .navbar-custom .nav-link {
        display: inline-block;
        width: fit-content;
        margin-bottom: 0.2rem;
    }
    
    .navbar-custom .nav-link::after {
        left: 0;
        transform: none;
    }
    
    .navbar-custom .nav-link:hover::after,
    .navbar-custom .nav-link.active::after {
        width: 100%;
    }
}
