/* Custom styles for futuristic design with DataSeguridad color palette */
:root {
    --primary: #2E7D58;
    --secondary: #3E3E3E;
    --accent: #7A7A7A;
    --surface: #FFFFFF;
    --section: #F4F4F4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--secondary);
    background-color: var(--surface);
}

/* Header & Navbar */
.navbar {
    background: linear-gradient(135deg, #FFFFFF 0%, #F4F4F4 100%) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    padding: 1rem 0 !important;
    border-bottom: 2px solid var(--primary);
}

.navbar-nav .nav-link {
    color: var(--secondary) !important;
    font-weight: 600;
    margin: 0 1rem;
    position: relative;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

.navbar-nav .nav-link:hover::after {
    width: 100%;
}

.navbar-brand img {
    transition: transform 0.3s ease;
    max-height: 60px;
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.75rem;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='%232E7D58' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* Hero Section */
.hero-modern {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    transition: opacity 0.4s ease;
}

.hero-svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-content {
    position: relative;
    z-index: 2;
    height: calc(100vh - 80px);
    pointer-events: none;
}

.hero-content a,
.hero-content button {
    pointer-events: auto;
}

.hero-text {
    animation: fadeInUp 1s ease-out;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    color: #FFFFFF;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.hero-title .highlight {
    color: #FFFFFF;
}

.hero-title .highlight em {
    font-style: normal;
    position: relative;
    color: #a8f0cc;
}

.hero-description {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--accent));
    border: none;
    border-radius: 25px;
    color: var(--surface);
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(46, 125, 88, 0.3);
    padding: 0.75rem 2rem;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(46, 125, 88, 0.4);
    color: var(--surface);
}

.btn-outline-light {
    border: 2px solid #FFFFFF;
    color: #FFFFFF;
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    background: #FFFFFF;
    color: var(--primary);
}

.hero-visual {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    color: #FFFFFF;
    width: 110px;
    height: 110px;
    animation: float 3s ease-in-out infinite;
    z-index: 3;
}

.floating-card i {
    font-size: 2rem;
}

.floating-card p {
    font-weight: 600;
    font-size: 0.78rem;
    margin: 0;
    text-align: center;
}

/* Cards en patrón snowflake: pentágono centrado en la mitad derecha */
/* Centro de la zona: rx≈0.725, ry≈0.50  |  Radio: Δx≈17%, Δy≈26% */
/* Ángulos (desde arriba, sentido horario): 90°,162°,234°,306°,18° */
.floating-card.card-1 {   /* centro — Integridad    */
    top: calc(50% - 55px);
    left: calc(72.5% - 55px);
    animation-delay: 0s;
}

.floating-card.card-2 {   /* abajo-izq — Análisis  */
    top: calc(67.5% - 55px);
    left: calc(57% - 55px);
    animation-delay: 0.5s;
}

.floating-card.card-3 {   /* abajo-der — Seguridad */
    top: calc(67.5% - 55px);
    left: calc(88% - 55px);
    animation-delay: 1s;
}

.floating-card.card-4 {   /* arr-izq — Confianza   */
    top: calc(32.5% - 55px);
    left: calc(57% - 55px);
    animation-delay: 1.5s;
}

.floating-card.card-5 {   /* arr-der — Transparencia */
    top: calc(32.5% - 55px);
    left: calc(88% - 55px);
    animation-delay: 0.75s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    display: block;
    pointer-events: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stats Section */
.stats-section {
    background: linear-gradient(135deg, var(--section) 0%, #FFFFFF 100%);
    padding: 4rem 0;
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.stat-item {
    text-align: center;
    padding: 2rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Services Section */
.services-section {
    padding: 5rem 0;
    background: #FFFFFF;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--secondary);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
}

.section-header p {
    color: var(--accent);
    font-size: 1.1rem;
    margin-top: 2rem;
}

/* Layout: 2 columnas — featured izq, 4 cards en grid 2×2 der */
.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

.services-small-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1.5rem;
}

/* ── Card destacada Poligrafía ── */
.service-featured {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 2rem;
    background: linear-gradient(135deg, #2E7D58 0%, #7A7A7A 100%);
    border-radius: 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(46, 125, 88, 0.28);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-featured:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 52px rgba(46, 125, 88, 0.38);
}

.service-featured::before {
    content: '';
    position: absolute;
    bottom: -60px;
    right: -60px;
    width: 220px;
    height: 220px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    pointer-events: none;
}

.service-featured::after {
    content: '';
    position: absolute;
    top: -40px;
    left: -40px;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    pointer-events: none;
}

.service-featured-icon {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.25);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.service-featured-body {
    flex: 1;
    position: relative;
    z-index: 1;
}

.service-tag {
    display: inline-block;
    background: rgba(168,240,204,0.2);
    color: #a8f0cc;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.2rem 0.75rem;
    border-radius: 50px;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(168,240,204,0.3);
}

.service-featured-body h3 {
    font-size: 1.55rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.service-featured-body p {
    color: rgba(255,255,255,0.82);
    line-height: 1.7;
    margin: 0;
    font-size: 0.95rem;
}

/* ── Cards pequeñas (grid 2×2 derecha) ── */
.service-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.8rem 1.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    border: 1.5px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 36px rgba(46, 125, 88, 0.13);
    border-color: var(--primary);
}

.service-num {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--primary);
    opacity: 0.45;
    margin-bottom: 1rem;
}

.service-icon-wrap {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(46,125,88,0.1) 0%, rgba(46,125,88,0.04) 100%);
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 1rem;
    transition: background 0.3s ease;
}

.service-card:hover .service-icon-wrap {
    background: linear-gradient(135deg, rgba(46,125,88,0.18) 0%, rgba(46,125,88,0.08) 100%);
}

.service-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.service-card p {
    color: var(--accent);
    line-height: 1.55;
    margin: 0;
    font-size: 0.84rem;
    flex: 1;
}

/* Portals Section */
.portals-section {
    background: linear-gradient(135deg, var(--section) 0%, #FFFFFF 100%);
    padding: 4rem 0;
    margin-bottom: 3rem;
}

.portals-wrapper {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 3rem;
    align-items: center;
}

.portal-card {
    background: var(--surface);
    border-radius: 15px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-top: 4px solid var(--primary);
}

.portal-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(46, 125, 88, 0.15);
}

.portal-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.portal-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.portal-card p {
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.portal-link {
    display: inline-block;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid var(--primary);
    transition: all 0.3s ease;
}

.portal-link:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.portal-divider {
    width: 2px;
    height: 150px;
    background: linear-gradient(180deg, transparent, var(--primary), transparent);
}

/* Work Section */
.work-section {
    padding: 5rem 0;
    background: #FFFFFF;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--secondary);
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
}

.work-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.work-large {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .work-large {
        grid-column: span 1;
    }
}

.work-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 250px;
}

.work-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.work-item:hover img {
    transform: scale(1.1);
}

/* Clients Section */
.clients-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #FFFFFF;
    padding: 5rem 0;
}

.clients-section .section-title {
    color: #FFFFFF;
}


.clients-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.client-logo {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 2rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.client-logo:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.client-logo img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
    filter: brightness(1) contrast(1.1);
}

/* Culture Section */
.culture-section {
    padding: 5rem 0;
    background: linear-gradient(135deg, #FFFFFF 0%, var(--section) 100%);
}

.culture-section h2 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.culture-section p {
    color: var(--accent);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.culture-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.culture-list li {
    color: var(--secondary);
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.culture-list i {
    color: var(--primary);
    font-size: 1.2rem;
}

.culture-visual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.culture-box {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #FFFFFF;
    padding: 3rem;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(46, 125, 88, 0.2);
}

.culture-box:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(46, 125, 88, 0.3);
}

/* Team Section */
.team-section {
    padding: 5rem 0;
    background: linear-gradient(135deg, #2E7D58 0%, #7A7A7A 100%);
    position: relative;
    overflow: hidden;
}


.team-section .section-title {
    color: #FFFFFF;
}

.team-section .section-subtitle {
    color: rgba(255,255,255,0.6);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
}

.team-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.team-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(46,125,88,0.35);
}

.team-card-photo {
    position: relative;
    height: 340px;
    overflow: hidden;
}

.team-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.45s ease;
    display: block;
}

.team-card:hover .team-card-photo img {
    transform: scale(1.07);
}

.team-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 30%, rgba(46,125,88,0.92) 100%);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.team-card:hover .team-card-overlay {
    opacity: 1;
}

.team-card-overlay p {
    color: #FFFFFF;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.team-card-body {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(6px);
    border-top: 1px solid rgba(46,125,88,0.4);
    padding: 1.25rem 1.5rem;
    position: relative;
}

.team-card-number {
    position: absolute;
    top: -1.1rem;
    right: 1.25rem;
    background: linear-gradient(135deg, var(--primary), #1a5c3a);
    color: #FFFFFF;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    line-height: 1.6;
}

.team-card-body h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 0.4rem;
    line-height: 1.3;
}

.team-card-role {
    color: rgba(168,240,204,0.85);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.team-card-role i {
    font-size: 0.45rem;
    color: var(--primary);
}

/* Contact Section */
.contact-section {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--section) 0%, #FFFFFF 100%);
}

.contact-section h2 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.contact-section > .container > .row > .col-lg-5 > p {
    color: var(--accent);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.contact-info-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.contact-info-item i {
    font-size: 1.8rem;
    color: var(--primary);
    min-width: 40px;
}

.contact-info-item h5 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.contact-info-item p {
    color: var(--accent);
    margin: 0 0 0.3rem 0;
}

.contact-info-item a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.contact-info-item a:hover {
    color: var(--accent);
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    transition: all 0.3s ease;
    font-size: 1.3rem;
}

.social-links a:hover {
    transform: scale(1.15) translateY(-5px);
    box-shadow: 0 10px 25px rgba(46, 125, 88, 0.3);
}

.contact-form {
    background: var(--surface);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    border: 2px solid var(--section);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 88, 0.1);
    outline: none;
}

.form-control::placeholder {
    color: var(--accent);
}

/* Footer */
.footer {
    background: var(--secondary);
    color: #FFFFFF;
    padding: 2rem 0;
    text-align: center;
}

.footer p {
    margin: 0 0 1rem 0;
}

.whatsapp-btn {
    display: inline-block;
    background: #25D366;
    color: #FFFFFF;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.whatsapp-btn:hover {
    background: #1BA85B;
    transform: scale(1.05);
}

/* Form success message */
.form-success-msg {
    margin-top: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), #1a5c3a);
    color: #FFFFFF;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
    font-size: 1rem;
}

.form-success-msg i {
    margin-right: 0.5rem;
}

/* Stat item separator */
.stats-grid {
    position: relative;
}

.stat-item:not(:last-child) {
    border-right: 1px solid rgba(46, 125, 88, 0.15);
}

/* Smooth active nav link */
.navbar-nav .nav-link.active {
    color: var(--primary) !important;
}

.navbar-nav .nav-link.active::after {
    width: 100%;
}

/* Section subtitle outside clients section */
.section-subtitle {
    text-align: center;
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.clients-section .section-subtitle {
    color: rgba(255, 255, 255, 0.9);
}

/* ── Theme Toggle Button ── */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    transition: background 0.2s ease;
}

.theme-toggle-btn:hover {
    background: rgba(46, 125, 88, 0.08);
}

.theme-toggle-track {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    background: #d0d0d0;
    border-radius: 50px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease, background 0.3s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.theme-toggle-icon {
    font-size: 0.9rem;
    color: var(--accent);
    transition: color 0.3s ease;
    line-height: 1;
}

/* Estado activo del toggle */
body.alt-theme .theme-toggle-track {
    background: linear-gradient(135deg, #2E7D58, #1a2f20);
}

body.alt-theme .theme-toggle-thumb {
    transform: translateX(18px);
    background: #a8f0cc;
}

body.alt-theme .theme-toggle-icon {
    color: var(--primary);
}

body.alt-theme .theme-toggle-icon .fa-moon::before {
    content: '\f185'; /* fa-sun */
}

/* ── Alt Theme: fondos oscuros ── */
body.alt-theme {
    --primary: #1a5c3a;
    --accent:  #1e3828;
}

/* Hero: reemplaza el SVG con fondo oscuro */
body.alt-theme .hero-modern {
    background: linear-gradient(160deg, #0f1a14 0%, #1a2f20 40%, #1e3828 100%);
}

body.alt-theme .hero-bg {
    opacity: 0;
    transition: opacity 0.4s ease;
}

body.alt-theme .service-featured {
    background: linear-gradient(160deg, #0f1a14 0%, #1a2f20 40%, #1e3828 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

body.alt-theme .team-section {
    background: linear-gradient(160deg, #0f1a14 0%, #1a2f20 40%, #1e3828 100%);
}

body.alt-theme .clients-section {
    background: linear-gradient(160deg, #0f1a14 0%, #1a2f20 40%, #1e3828 100%);
}

body.alt-theme .culture-box {
    background: linear-gradient(160deg, #0f1a14 0%, #1a2f20 40%, #1e3828 100%);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.35);
}

/* ================================================================
   RESPONSIVE — Mejoras integrales para tablet y móvil
   Breakpoints: ≤992 tablet | ≤768 móvil grande | ≤576 móvil chico
   ================================================================ */

/* ── Tablet (≤992px) ────────────────────────────────────────────── */
@media (max-width: 992px) {
    /* Navbar: que el logo no empuje el toggler a una segunda línea */
    .navbar > .container {
        flex-wrap: nowrap;
        align-items: center;
    }

    .navbar-brand {
        flex: 0 1 auto;
        min-width: 0;
        max-width: calc(100% - 70px); /* deja espacio para el toggler */
        margin-right: auto;
        padding-top: 0;
        padding-bottom: 0;
    }

    .navbar-brand img {
        max-height: 44px !important;
        width: auto;
        height: auto;
    }

    /* Hero */
    .hero-title {
        font-size: 2.8rem;
    }

    /* Ocultar floating-cards y canvas en tablet/mobile (no aportan en táctil) */
    .floating-card,
    .hero-canvas {
        display: none;
    }

    .hero-modern {
        min-height: auto;
        padding: 7rem 0 4rem;
    }

    .hero-content {
        height: auto;
    }

    /* Servicios y portales en una sola columna */
    .services-grid {
        grid-template-columns: 1fr;
    }

    .services-small-grid {
        grid-template-columns: 1fr 1fr;
    }

    .portals-wrapper {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .portal-divider {
        display: none;
    }

    .portal-card {
        text-align: center;
    }

    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Padding del navbar más cómodo */
    .navbar {
        padding: 0.5rem 0 !important;
    }
}

/* ── Móvil grande (≤768px) ──────────────────────────────────────── */
@media (max-width: 768px) {
    /* Hero más compacto */
    .hero-title {
        font-size: 2rem;
        line-height: 1.25;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero-buttons .btn-primary,
    .hero-buttons .btn-outline-light {
        width: 100%;
        text-align: center;
    }

    /* Tipografías de sección */
    .section-header h2,
    .section-title,
    .contact-section h2,
    .culture-section h2 {
        font-size: 1.8rem;
    }

    .culture-section h2,
    .culture-section p {
        text-align: center;
    }

    .culture-list {
        margin-bottom: 2rem;
    }

    /* Galería de trabajo: una columna */
    .work-gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .work-large {
        grid-column: span 1;
    }

    .work-item {
        height: 200px;
    }

    /* Contacto: form arriba, info debajo */
    .contact-section > .container > .row {
        flex-direction: column-reverse;
    }

    /* Stats: 2x2 con divisores corregidos */
    .stat-item:not(:last-child) {
        border-right: none;
        border-bottom: 1px solid rgba(46, 125, 88, 0.15);
    }

    /* Servicios: estrella ya en una columna */
    .services-grid {
        grid-template-columns: 1fr;
    }

    .service-featured {
        padding: 2rem 1.5rem;
    }

    .services-small-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .service-card {
        padding: 1.5rem 1rem;
    }

    /* Equipo */
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .team-card-photo {
        height: 220px;
    }

    /* Cultura visual: bloques más pequeños */
    .culture-visual {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .culture-box {
        padding: 2rem 1rem;
        font-size: 1rem;
    }

    /* Padding general de secciones */
    .services-section,
    .portals-section,
    .work-section,
    .clients-section,
    .culture-section,
    .team-section,
    .contact-section {
        padding: 3rem 0 !important;
    }

    /* Footer */
    .footer .container {
        flex-direction: column !important;
        gap: 1rem;
        text-align: center;
    }
}

/* ── Móvil chico (≤576px) ───────────────────────────────────────── */
@media (max-width: 576px) {
    /* Tipografías más reducidas */
    .hero-title {
        font-size: 1.7rem;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 0.4rem 1rem;
    }

    .hero-description {
        font-size: 0.95rem;
    }

    .section-header h2,
    .contact-section h2 {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.6rem;
        margin-bottom: 2rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
    }

    /* Stats: 2 columnas con divisores en cruz */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .stat-item {
        padding: 1.5rem 0.5rem;
    }

    .stat-item:not(:last-child) {
        border-right: none;
        border-bottom: none;
    }

    .stat-item:nth-child(odd) {
        border-right: 1px solid rgba(46, 125, 88, 0.15);
    }

    .stat-item:nth-child(-n+2) {
        border-bottom: 1px solid rgba(46, 125, 88, 0.15);
    }

    .stat-number {
        font-size: 2.2rem;
    }

    /* Servicios: una sola columna */
    .services-small-grid {
        grid-template-columns: 1fr;
    }

    /* Cultura visual: una sola columna */
    .culture-visual {
        grid-template-columns: 1fr;
    }

    .culture-box {
        padding: 1.5rem 1rem;
        font-size: 1.1rem;
        min-height: 90px;
    }

    /* Equipo: una sola columna */
    .team-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .team-card-photo {
        height: 280px;
    }

    /* Clientes carousel */
    .clients-carousel {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-top: 2rem;
    }

    .client-logo {
        padding: 1.5rem 0.75rem;
    }

    .client-logo img {
        max-height: 60px;
    }

    /* Form de contacto */
    .contact-form {
        padding: 1.25rem 1rem;
    }

    .contact-info-item {
        gap: 0.75rem;
    }

    .contact-info-item i {
        font-size: 1.25rem;
    }

    /* Redes sociales: 5 iconos quepan en una fila */
    .social-links {
        gap: 0.6rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .social-links a {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    /* Padding más ajustado en secciones */
    .services-section,
    .portals-section,
    .work-section,
    .clients-section,
    .culture-section,
    .team-section,
    .contact-section {
        padding: 2.5rem 0 !important;
    }

    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* WhatsApp btn más visible en móvil chico */
    .whatsapp-btn {
        width: 100%;
        max-width: 240px;
        justify-content: center;
    }
}

/* ── Móvil extra-pequeño (≤380px) — iPhones SE viejos, Galaxy S8 ── */
@media (max-width: 380px) {
    .hero-title {
        font-size: 1.45rem;
    }

    .hero-badge {
        font-size: 0.7rem;
    }

    .navbar-brand img {
        max-height: 40px;
    }

    .clients-carousel {
        grid-template-columns: 1fr;
    }

    .culture-box {
        font-size: 1rem;
    }
}

/* ================================================================
   Botón "Iniciar sesión" en el navbar (CTA pill verde)
   ================================================================ */
.nav-item .nav-login-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem !important;
    margin: 0 !important;
    background: linear-gradient(135deg, var(--primary) 0%, #1a5c3a 100%);
    color: #ffffff !important;
    font-weight: 600 !important;
    border-radius: 999px;
    border: none;
    box-shadow: 0 4px 12px rgba(46, 125, 88, 0.30);
    transition: all 0.25s ease;
}

.nav-item .nav-login-btn:hover,
.nav-item .nav-login-btn:focus,
.nav-item .nav-login-btn.show {
    background: linear-gradient(135deg, #1a5c3a 0%, var(--primary) 100%);
    color: #ffffff !important;
    box-shadow: 0 6px 18px rgba(46, 125, 88, 0.42);
    transform: translateY(-1px);
}

/* Anular el underline animado heredado de .nav-link */
.nav-item .nav-login-btn::after {
    display: none !important;
}

.nav-item .nav-login-btn::before {
    content: none !important;
}

/* Caret personalizado del dropdown (chevron limpio, no la flecha solid de Bootstrap) */
.nav-item .nav-login-btn .login-caret {
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform 0.25s ease;
    margin-left: 0.15rem;
}

.nav-item .nav-login-btn[aria-expanded="true"] .login-caret {
    transform: rotate(-135deg) translate(-2px, -2px);
}

/* Modo oscuro: botón más saturado */
body.alt-theme .nav-item .nav-login-btn {
    background: linear-gradient(135deg, #2E7D58 0%, #1a5c3a 100%);
    box-shadow: 0 4px 14px rgba(46, 125, 88, 0.45);
}

/* ================================================================
   Navbar móvil — menú colapsado
   ================================================================ */
@media (max-width: 991.98px) {
    /* Contenedor del menú colapsado: card flotante por debajo del navbar */
    .navbar-collapse {
        background: #FFFFFF;
        margin: 0.75rem -0.5rem 0;
        padding: 0.75rem;
        border-radius: 14px;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
        border-top: 3px solid var(--primary);
    }

    body.alt-theme .navbar-collapse {
        background: #1a2f20;
        border-top-color: var(--primary);
    }

    /* Items del menú: ocupan el ancho */
    .navbar-nav .nav-item {
        margin: 0 !important;
    }

    .navbar-nav .nav-link {
        margin: 0 !important;
        padding: 0.75rem 1rem !important;
        border-radius: 8px;
        font-size: 0.95rem;
    }

    /* Quitar el underline animado en móvil (no hay hover) */
    .navbar-nav .nav-link::after {
        display: none !important;
    }

    .navbar-nav .nav-link.active,
    .navbar-nav .nav-link:hover {
        background: rgba(46, 125, 88, 0.08);
    }

    body.alt-theme .navbar-nav .nav-link {
        color: #f4f4f4 !important;
    }

    body.alt-theme .navbar-nav .nav-link:hover {
        background: rgba(46, 125, 88, 0.20);
    }

    /* Botón "Iniciar sesión" en móvil: ancho completo, debajo del menú */
    .nav-item.dropdown {
        margin: 0.5rem 0 0 !important;
    }

    .nav-item .nav-login-btn {
        justify-content: center;
        width: 100%;
        padding: 0.75rem 1.25rem !important;
    }

    /* Toggle de tema dentro del menú colapsado */
    .nav-item:has(.theme-toggle-btn) {
        margin: 0.5rem 0 0 !important;
        display: flex;
        justify-content: center;
    }

    .theme-toggle-btn {
        padding: 0.5rem 1rem !important;
    }

    /* Dropdown del login en móvil: estático, ancho completo del navbar collapse */
    .login-dropdown-menu {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        min-width: 0 !important;
        margin-top: 0.5rem !important;
        box-shadow: none;
        border-top: 2px solid rgba(46, 125, 88, 0.30);
        border-radius: 10px;
        background: rgba(46, 125, 88, 0.05);
    }

    body.alt-theme .login-dropdown-menu {
        background: rgba(46, 125, 88, 0.10);
    }

    .login-dropdown-item {
        padding: 0.85rem 0.75rem !important;
    }

    /* Hamburger más fácil de tocar */
    .navbar-toggler {
        padding: 0.5rem 0.75rem !important;
    }

    .navbar-toggler:focus {
        box-shadow: 0 0 0 3px rgba(46, 125, 88, 0.18);
    }

    /* Hamburger en tema oscuro: trazos blancos */
    body.alt-theme .navbar-toggler-icon {
        background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='%23a8f0cc' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
    }
}

/* ================================================================
   Mejoras táctiles e iOS-safe (todas las pantallas pequeñas)
   ================================================================ */
@media (max-width: 991.98px) {
    /* Evitar zoom de iOS al enfocar inputs (requiere font-size ≥16px) */
    .form-control,
    .contact-form input,
    .contact-form textarea {
        font-size: 16px !important;
    }

    /* Áreas táctiles más grandes (mínimo 44x44 según WCAG) */
    .nav-link,
    .btn,
    .portal-link,
    .social-links a {
        min-height: 44px;
    }

    /* Smooth-scroll respeta el navbar fijo cuando se aterriza en una sección */
    section[id] {
        scroll-margin-top: 80px;
    }

    /* Imágenes nunca rebasan el contenedor */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Evita scroll horizontal accidental por elementos con margin/padding negativo */
    body {
        overflow-x: hidden;
    }
}

.login-dropdown-menu {
    min-width: 280px;
    padding: 0.5rem;
    border: none;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-top: 3px solid var(--primary);
    margin-top: 0.5rem !important;
}

.login-dropdown-menu .dropdown-header {
    padding: 0.5rem 0.75rem;
    letter-spacing: 1px;
    font-weight: 600;
}

.login-dropdown-item {
    display: flex !important;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.85rem !important;
    border-radius: 8px;
    color: var(--secondary) !important;
    transition: all 0.2s ease;
    white-space: normal !important;
}

.login-dropdown-item:hover,
.login-dropdown-item:focus {
    background: linear-gradient(135deg, rgba(46,125,88,0.10) 0%, rgba(46,125,88,0.04) 100%) !important;
    color: var(--primary) !important;
    transform: translateX(2px);
}

.login-dropdown-item strong {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    color: inherit;
}

.login-dropdown-item small {
    font-size: 0.78rem;
    margin-top: 2px;
}

.login-dropdown-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), #1a5c3a);
    color: #ffffff;
    font-size: 1rem;
}

.login-dropdown-item:hover .login-dropdown-icon {
    transform: scale(1.05);
}

/* Modo oscuro alternativo */
body.alt-theme .login-dropdown-menu {
    background: #2a2a2a;
    border-top-color: var(--primary);
}

body.alt-theme .login-dropdown-item {
    color: #f4f4f4 !important;
}

body.alt-theme .login-dropdown-item small {
    color: #b0b0b0 !important;
}

body.alt-theme .login-dropdown-item:hover,
body.alt-theme .login-dropdown-item:focus {
    background: rgba(46,125,88,0.20) !important;
    color: #ffffff !important;
}

body.alt-theme .login-dropdown-menu .dropdown-header {
    color: #b0b0b0 !important;
}
