/* 
   HASAC Asesores & Consultores
   Sistema de Diseño Corporativo Moderno 
*/

:root {
    --primary-red: #dc2626;
    --primary-red-hover: #b91c1c;
    --primary-blue: #0f172a;
    --primary-blue-light: #1e293b;
    --accent-blue: #2563eb;
    
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --bg-footer: #0f172a;
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-white: #ffffff;
    
    --border-color: #e2e8f0;
    --border-color-focus: #fca5a5;
    
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --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 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estilos Generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-blue);
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: var(--transition-smooth);
}

a:hover {
    color: var(--primary-red);
}

.section-gap {
    padding: 80px 0;
}

.margensupremo {
    margin-top: 20px;
}

/* Tarjetas de Servicios Dinámicas (Flipping Cards) */
.container__card {
    max-width: 1400px;
    margin: 40px auto 80px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    padding: 0 20px;
}

.card__father {
    perspective: 1500px;
    width: 320px;
    height: 420px;
}

.card__father:hover .card {
    transform: rotateY(180deg);
}

.card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    background: transparent;
    box-shadow: none;
}

.card__front,
.card__back {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.card__front {
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}

.card__front .bg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.3) 50%, rgba(15, 23, 42, 0) 100%);
    z-index: 1;
}

.body__card_front {
    position: relative;
    z-index: 2;
    padding: 30px 20px;
    text-align: center;
    width: 100%;
    transform: translateZ(50px);
}

.body__card_front h1,
.body__card_front h2 {
    color: var(--text-white);
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.card__back {
    transform: rotateY(180deg);
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.body__card_back {
    padding: 30px;
    text-align: center;
    transform: translateZ(50px);
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.body__card_back h1,
.body__card_back h2 {
    font-size: 1.25rem;
    color: var(--primary-blue);
    margin-bottom: 15px;
}

.body__card_back p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.body__card_back input[type="button"],
.body__card_back .btn-card {
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    color: var(--text-white);
    background: var(--primary-red);
    border-radius: var(--border-radius-sm);
    transition: var(--transition-smooth);
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.2), 0 2px 4px -2px rgba(220, 38, 38, 0.2);
    align-self: center;
}

.body__card_back input[type="button"]:hover,
.body__card_back .btn-card:hover {
    background: var(--primary-red-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.3), 0 4px 6px -4px rgba(220, 38, 38, 0.3);
}

/* Nosotros & Secciones Corporativas */
.titulo h1 {
    font-size: 2.5rem;
    color: var(--primary-blue);
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.titulo h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--primary-red);
    border-radius: 2px;
}

.Subtitulo {
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Listas estilizadas */
ul.servicios {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

ul.servicios li,
.visto + p {
    position: relative;
    padding-left: 30px;
    margin-bottom: 15px;
}

/* Contenedor Video Responsivo */
.Video {
    position: relative;
    padding-bottom: 56.25%; /* Relación de aspecto 16:9 */
    height: 0;
    overflow: hidden;
    max-width: 800px;
    margin: 40px auto;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.Video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Call to Action Banner */
.cta-banner {
    background: linear-gradient(135deg, var(--primary-blue-light) 0%, var(--primary-blue) 100%);
    border-radius: var(--border-radius-md);
    padding: 40px;
    color: var(--text-white);
    text-align: center;
    box-shadow: var(--shadow-lg);
    margin: 40px 0;
}

.cta-banner h4 {
    color: var(--text-white);
    font-size: 1.75rem;
    margin-bottom: 15px;
}

.cta-banner p {
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin: 0 auto 25px;
}

.cta-banner .btn-cta {
    background-color: var(--primary-red);
    color: var(--text-white);
    font-weight: 600;
    padding: 12px 30px;
    border-radius: var(--border-radius-sm);
    display: inline-block;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
}

.cta-banner .btn-cta:hover {
    background-color: var(--primary-red-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(220, 38, 38, 0.4);
}

/* Formularios Modernos (Contacto, Login) */
.contenedor_todo {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 0;
    width: 100%;
    max-width: 1100px;
    margin: 40px auto;
    background-color: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.formulario {
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.formulario h1 {
    font-size: 2.2rem;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 18px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-light);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-red);
    background-color: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.form-group button,
.formulario button[type="submit"] {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-red);
    color: var(--text-white);
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 6px rgba(220, 38, 38, 0.2);
}

.form-group button:hover,
.formulario button[type="submit"]:hover {
    background-color: var(--primary-red-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(220, 38, 38, 0.3);
}

/* Login Panel */
#container_login {
    margin: 80px auto;
    max-width: 900px;
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

#container_login .row {
    margin: 0;
}

#container_login .col-md-6 {
    padding: 50px;
}

/* Enlaces de Interés Grid */
.flex_container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 30px;
    padding: 40px 0;
}

.caja {
    background-color: var(--bg-white);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 30px;
    text-align: center;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 220px;
}

.caja:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(220, 38, 38, 0.2);
}

.caja img {
    max-height: 70px;
    max-width: 85%;
    object-fit: contain;
    margin-bottom: 20px;
}

.caja a {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-blue);
    line-height: 1.3;
}

.caja a:hover {
    color: var(--primary-red);
}

/* Calculadoras & Boletines Layout */
.contenedor-principal {
    display: grid;
    grid-template-columns: 280px 1fr 240px;
    gap: 30px;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

.sidebar-left,
.sidebar-right {
    background-color: var(--bg-white);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    height: fit-content;
}

.sidebar-left h5,
.sidebar-right h5 {
    font-size: 1.15rem;
    border-bottom: 2px solid var(--primary-red);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.sidebar-left ul {
    list-style: none;
    padding: 0;
}

.sidebar-left li {
    margin-bottom: 12px;
}

.sidebar-left a,
.sidebar-left .nav-link {
    display: block;
    padding: 10px 15px;
    border-radius: var(--border-radius-sm);
    color: var(--text-main);
    font-weight: 500;
    transition: var(--transition-smooth);
    background-color: var(--bg-light);
}

.sidebar-left a:hover,
.sidebar-left .nav-link:hover,
.sidebar-left .active {
    background-color: var(--primary-red);
    color: var(--text-white) !important;
}

.main-content {
    background-color: var(--bg-white);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    padding: 40px;
    box-shadow: var(--shadow-sm);
}

.main-content h1 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    color: var(--primary-blue);
    text-align: left;
}

.ad img {
    width: 100%;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.ad img:hover {
    transform: scale(1.02);
}

/* Calculadoras Estilos Internos */
.calculator-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    overflow: hidden;
}

.card-header-custom {
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-blue-light));
    color: var(--text-white);
    padding: 18px 24px;
    font-weight: 600;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--primary-red);
}

.card-body-custom {
    padding: 24px;
}

.form-label-custom {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group-custom {
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    transition: var(--transition-smooth);
}

.input-group-custom:focus-within {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.input-group-text-custom {
    background-color: var(--primary-blue-light);
    color: var(--text-white);
    border: none;
    padding: 10px 18px;
    font-weight: 600;
}

.form-control-custom {
    border: none;
    padding: 12px 18px;
    width: 100%;
    background-color: var(--bg-light);
    color: var(--text-main);
}

.form-control-custom:focus {
    outline: none;
    background-color: var(--bg-white);
}

.table-container {
    background: var(--bg-white);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.table-header {
    background-color: var(--primary-blue);
    color: var(--text-white);
    padding: 12px 20px;
    font-weight: 600;
    font-size: 1.05rem;
}

.table-simple {
    width: 100%;
    border-collapse: collapse;
}

.table-simple th,
.table-simple td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.table-simple th {
    background-color: var(--bg-light);
    font-weight: 600;
    color: var(--text-main);
}

.table-simple tbody tr:hover {
    background-color: #f1f5f9;
}

/* WhatsApp Floating Button and Popup */
.whatsapp-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
    font-family: var(--font-body);
}

.whatsapp-button {
    width: 60px;
    height: 60px;
    background-color: #25d366;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
}

.whatsapp-button:hover {
    background-color: #20b858;
    transform: scale(1.08) rotate(10deg);
    box-shadow: 0 10px 20px rgba(37, 211, 102, 0.4);
}

.whatsapp-button img {
    width: 32px;
    height: 32px;
}

.whatsapp-popup {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 340px;
    background-color: var(--bg-white);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 1px solid var(--border-color);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.whatsapp-popup-header {
    background-color: #075e54;
    color: var(--text-white);
    padding: 20px;
    display: flex;
    align-items: center;
    position: relative;
}

.whatsapp-popup-header img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.whatsapp-popup-header .info {
    flex-grow: 1;
}

.whatsapp-popup-header .info h4 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-white);
}

.whatsapp-popup-header .info p {
    margin: 2px 0 0 0;
    font-size: 0.8rem;
    color: #aebfbe;
}

.whatsapp-popup-header span {
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.6);
    transition: var(--transition-smooth);
}

.whatsapp-popup-header span:hover {
    color: var(--text-white);
}

.whatsapp-popup-body {
    padding: 24px;
    background-color: #e5ddd5;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    background-repeat: repeat;
}

.whatsapp-popup-body .bubble {
    background-color: var(--bg-white);
    padding: 12px 16px;
    border-radius: 0 10px 10px 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    line-height: 1.4;
    color: #303030;
    position: relative;
    max-width: 90%;
}

.whatsapp-popup-body .bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: -10px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 10px 10px 0;
    border-color: transparent var(--bg-white) transparent transparent;
}

.whatsapp-popup-footer {
    padding: 15px 20px;
    background-color: var(--bg-white);
    text-align: center;
}

.whatsapp-popup-footer a {
    text-decoration: none;
    background-color: #25d366;
    color: var(--text-white);
    padding: 12px 24px;
    border-radius: 25px;
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 3px 6px rgba(37, 211, 102, 0.2);
    transition: var(--transition-smooth);
}

.whatsapp-popup-footer a:hover {
    background-color: #20b858;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(37, 211, 102, 0.3);
}

/* Responsividad General */
@media (max-width: 992px) {
    .contenedor_todo {
        grid-template-columns: 1fr;
    }
    
    .contenedor_todo img {
        display: none;
    }
    
    .contenedor-principal {
        grid-template-columns: 1fr;
    }
    
    .sidebar-left,
    .sidebar-right {
        width: 100%;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .formulario {
        padding: 30px 20px;
    }
    
    .section-gap {
        padding: 50px 0;
    }
    
    .titulo h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 25px 20px;
    }
}