/* ============================================================
   PORTAL LANDING - DYNAMIC DUAL CARD SELECTION
   ============================================================ */

/* Body & Root setup - Allows smooth scrolling when content exceeds viewport */
html,
body,
body.portal-body {
    height: auto !important;
    min-height: 100vh !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background-color: #070B12 !important;
    font-family: 'DM Sans', sans-serif !important;
    color: #ffffff !important;
}

/* Fullscreen Portal Section */
.portal-section {
    position: relative !important;
    min-height: 100vh !important;
    height: auto !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 25px 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    overflow: visible !important;
}

/* Container wrapper centered vertically */
.portal-viewport-wrapper {
    min-height: 98vh !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 30px 20px 20px 20px !important;
}

/* ------------------------------------------------------------
   3 DYNAMIC BACKGROUND LAYERS & CONSTANT MOVEMENT
   ------------------------------------------------------------ */
.portal-bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 1;
}

/* Layer Base */
.portal-bg-layer {
    position: absolute;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 1.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    animation: bgContinuousPan 30s ease-in-out infinite alternate;
}

/* 1. Default BG (Natural) */
.portal-bg-layer.bg-default {
    background-image: url('../images/dark-section-bg-image.png');
    opacity: 1;
    z-index: 1;
}

/* 2. Card 1: Desarrollo Hover BG */
.portal-bg-layer.bg-desarrollo {
    background-image: url('../images/hero-bg-image.jpg');
    z-index: 2;
}

/* 3. Card 2: Consultora Hover BG */
.portal-bg-layer.bg-consultora {
    background-image: url('../images/hero-bg-image-elite.jpg');
    z-index: 2;
}

/* Active states for hover cross-fade */
.portal-bg-layer.active,
.portal-section:has(.card-desarrollo:hover) .bg-desarrollo,
.portal-section:has(.card-consultora:hover) .bg-consultora {
    opacity: 1;
    transform: scale(1.08) translate(-10px, -5px);
}

/* Continuous background panning keyframes */
@keyframes bgContinuousPan {
    0% {
        transform: scale(1.03) translate(0px, 0px) rotate(0deg);
    }

    33% {
        transform: scale(1.09) translate(-15px, -10px) rotate(0.5deg);
    }

    66% {
        transform: scale(1.06) translate(15px, 8px) rotate(-0.5deg);
    }

    100% {
        transform: scale(1.10) translate(-8px, 12px) rotate(0deg);
    }
}

/* Dark Radial Overlay */
.portal-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(7, 11, 18, 0.60) 0%, rgba(7, 11, 18, 0.85) 75%, rgba(7, 11, 18, 0.95) 100%);
    z-index: 3;
    pointer-events: none;
}

/* Header Text Aesthetics */
.portal-header {
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    z-index: 4;
}

.portal-sub-title {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #00d2ff;
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.25);
    padding: 5px 16px;
    border-radius: 30px;
    margin-bottom: 12px;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.15);
}

.portal-title {
    font-size: 38px;
    font-weight: 700;
    line-height: 1.15;
    color: #ffffff;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.portal-description {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.5;
    margin: 0 auto;
}

/* ------------------------------------------------------------
   CARDS GRID, BLUR, ENTRY ANIMATION & LOGO
   ------------------------------------------------------------ */
.portal-cards-container {
    position: relative;
    z-index: 4;
    max-width: 1050px;
    margin-top: auto;
    margin-bottom: auto;
}

/* Card glassmorphism with high blur & entrance animation */
.portal-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    padding: 38px 32px 32px 32px;
    background: rgba(12, 19, 34, 0.55);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 24px;
    text-decoration: none !important;
    transition: all 0.45s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
    overflow: hidden;

    /* Entry animation */
    opacity: 0;
    animation: portalCardEntrance 0.85s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.card-desarrollo {
    animation-delay: 0.15s;
}

.card-consultora {
    animation-delay: 0.3s;
}

@keyframes portalCardEntrance {
    0% {
        opacity: 0;
        transform: translateY(35px) scale(0.94);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Top Badge */
.portal-card-badge {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 18px;
    transition: color 0.3s ease;
}

/* Direct Logo Image (Identical size on both cards, no background circle) */
.portal-card-logo {
    height: 125px;
    width: auto;
    object-fit: contain;
    margin-bottom: 14px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.45s ease;
}

/* De Valencia Font Title */
.portal-card-brand {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-sub {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.brand-devalencia {
    font-family: 'De Valencia', sans-serif, 'DM Sans';
    font-size: 32px;
    font-weight: normal;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    line-height: 1.1;
    transition: all 0.4s ease;
}

/* Card Divider Line */
.portal-card-divider {
    width: 45px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.1) 100%);
    margin: 0 auto 16px auto;
    transition: width 0.4s ease, background 0.4s ease;
}

/* Description Text */
.portal-card-text {
    font-size: 14px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 24px;
    flex-grow: 1;
}

/* Button & Clean SVG Arrow */
.portal-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 24px;
    border-radius: 50px;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.35s ease;
}

.icon-arrow-svg {
    width: 18px;
    height: 18px;
    object-fit: contain;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ------------------------------------------------------------
   HOVER EFFECTS (CARD 1: DESARROLLO - #1944DF)
   ------------------------------------------------------------ */
.card-desarrollo:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(10, 25, 65, 0.78);
    border-color: rgba(25, 68, 223, 0.75);
    box-shadow: 0 25px 55px rgba(25, 68, 223, 0.35), inset 0 0 25px rgba(25, 68, 223, 0.2);
}

.card-desarrollo:hover .portal-card-badge {
    color: #4b77ff;
}

.card-desarrollo:hover .portal-card-logo {
    transform: scale(1.08);
    filter: drop-shadow(0 0 16px rgba(25, 68, 223, 0.9));
}

.card-desarrollo:hover .brand-devalencia {
    color: #ffffff;
    letter-spacing: 3px;
    text-shadow: 0 0 20px rgba(25, 68, 223, 0.9);
}

.card-desarrollo:hover .portal-card-divider {
    width: 85px;
    background: #1944DF;
    box-shadow: 0 0 14px #1944DF;
}

.card-desarrollo:hover .portal-card-btn {
    background: linear-gradient(135deg, #2b57fd 0%, #1944DF 100%);
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(25, 68, 223, 0.5);
}

.card-desarrollo:hover .icon-arrow-svg {
    transform: translateX(5px);
}

/* ------------------------------------------------------------
   HOVER EFFECTS (CARD 2: CONSULTORA - #f96227)
   ------------------------------------------------------------ */
.card-consultora:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(45, 20, 10, 0.78);
    border-color: rgba(249, 98, 39, 0.75);
    box-shadow: 0 25px 55px rgba(249, 98, 39, 0.35), inset 0 0 25px rgba(249, 98, 39, 0.2);
}

.card-consultora:hover .portal-card-badge {
    color: #f96227;
}

.card-consultora:hover .portal-card-logo {
    transform: scale(1.08);
    filter: drop-shadow(0 0 16px rgba(249, 98, 39, 0.9));
}

.card-consultora:hover .brand-devalencia {
    color: #ffffff;
    letter-spacing: 3px;
    text-shadow: 0 0 20px rgba(249, 98, 39, 0.9);
}

.card-consultora:hover .portal-card-divider {
    width: 85px;
    background: #f96227;
    box-shadow: 0 0 14px #f96227;
}

.card-consultora:hover .portal-card-btn {
    background: linear-gradient(135deg, #ff7a45 0%, #f96227 100%);
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(249, 98, 39, 0.5);
}

.card-consultora:hover .icon-arrow-svg {
    transform: translateX(5px);
}

/* Footer styling */
.portal-footer {
    position: relative;
    z-index: 4;
    margin-top: auto;
}

.portal-footer p {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.45);
    margin: 0;
}

/* Responsive adjustments for mobile/tablet */
@media (max-width: 991px) {

    html,
    body.portal-body,
    .portal-section,
    .portal-viewport-wrapper {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    .portal-viewport-wrapper {
        padding: 40px 20px;
    }

    .portal-title {
        font-size: 32px;
    }

    .portal-card {
        padding: 32px 24px 28px 24px;
    }

    .brand-devalencia {
        font-size: 28px;
    }
}