:root {
    /* Fluid Typographic Ramp & Tokens */
    --p-scale: 1;
    --font-family-display: HelvelticaUltraLight, "Helvetica Neue UltraLight", "Helvetica Neue", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-family-headline: HelvelticaLight, "Helvetica Neue Light", "Helvetica Neue", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-family-body: HelvelticaLight, "Helvetica Neue Light", "Helvetica Neue", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-family-system: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --font-size-display: calc(clamp(2.5rem, 5.5vw, 4.5rem) * var(--p-scale, 1));
    --font-size-headline: calc(clamp(1.75rem, 3.8vw, 2.75rem) * var(--p-scale, 1));
    --font-size-title: calc(1.5rem * var(--p-scale, 1));
    --font-size-subtitle: calc(1.25rem * var(--p-scale, 1));
    --font-size-body-lg: calc(1.125rem * var(--p-scale, 1));
    --font-size-body: calc(1rem * var(--p-scale, 1));
    --font-size-label: calc(0.875rem * var(--p-scale, 1));
    --font-size-caption: calc(0.75rem * var(--p-scale, 1));
    --font-weight-thin: 100;
    --font-weight-extralight: 200;
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --line-height-display: 1.1;
    --line-height-headline: 1.2;
    --line-height-title: 1.3;
    --line-height-body: 1.6;
    --line-height-tight: 1.25;
    --letter-spacing-display: -0.025em;
    --letter-spacing-headline: -0.015em;
    --letter-spacing-body: 0em;
    --letter-spacing-label: 0.04em;
    --letter-spacing-caps: 0.06em;
    /* Physics-Based Motion Tokens (Modern Web Guidance linear() & spring easing) */
    --ease-spring-fallback: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-spring: linear(0, 0.016 0.5%, 0.06 1%, 0.226 2%, 1.116 5.4%, 1.375 6.6%, 1.527 7.7%, 1.565 8.2%, 1.585 8.8%, 1.581 9.3%, 1.559 9.8%, 1.458 10.9%, 0.937 14.3%, 0.784 15.5%, 0.693 16.6%, 0.67 17.1%, 0.657 17.7%, 0.671 18.7%, 0.729 19.8%, 1.042 23.3%, 1.13 24.5%, 1.182 25.6%, 1.201 26.7%, 1.192 27.7%, 1.156 28.8%, 0.977 32.2%, 0.925 33.4%, 0.894 34.5%, 0.882 35.6%, 0.887 36.6%, 0.907 37.7%, 1.045 42.4%, 1.069 44.5%, 1.059 46.3%, 0.979 50.9%, 0.96 53.4%, 0.966 55.3%, 1.013 59.9%, 1.024 62.3%, 0.986 71.2%, 1.008 79.9%, 0.995 88.9%, 1);
    --ease-bounce: linear(0, 0.214 14.7%, 0.386 23.7%, 0.598 31.9%, 0.999 44.7%, 0.807 52.6%, 0.762 56%, 0.747 59.4%, 0.758 62.4%, 0.793 65.6%, 0.999 77.4%, 0.961 81.2%, 0.949 84.8%, 0.956 88%, 0.993 95.5%, 1);
    --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-standard: cubic-bezier(0.2, 0, 0, 1);
    --duration-instant: 150ms;
    --duration-fast: 250ms;
    --duration-normal: 400ms;
    --duration-slow: 650ms;
}

/* Fallback for browsers that do not support linear() easing function */
@supports not (animation-timing-function: linear(0, 1)) {
    :root {
        --ease-spring: var(--ease-spring-fallback);
        --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    }
}

/* Browser Surfaces Theming */
::selection {
    background-color: rgba(255, 86, 47, 0.25);
    color: inherit;
}

[data-bs-theme="dark"] ::selection {
    background-color: rgba(255, 86, 47, 0.4);
    color: #ffffff;
}

input, textarea, select {
    caret-color: #ff562f;
}

:root {
    accent-color: #ff562f;
    --scrollbar-thumb: rgba(42, 63, 80, 0.35);
    --scrollbar-track: rgba(0, 0, 0, 0.05);
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    scrollbar-width: thin;
}

[data-bs-theme="dark"] {
    --scrollbar-thumb: rgba(255, 255, 255, 0.25);
    --scrollbar-track: rgba(255, 255, 255, 0.05);
}

/* Fallback for WebKit browsers that do not yet support standard scrollbar-color */
@supports not (scrollbar-color: auto) {
    ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }

    ::-webkit-scrollbar-track {
        background: var(--scrollbar-track);
    }

    ::-webkit-scrollbar-thumb {
        background: var(--scrollbar-thumb);
        border-radius: 5px;
    }

        ::-webkit-scrollbar-thumb:hover {
            background: #ff562f;
        }
}

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* Modern Typography Wrapping & Legibility */
h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
}

p, .parrafoAcerca, .DescripcionKroud {
    text-wrap: pretty;
}

/* WCAG 2.2 AA Focus Indicators */
:focus-visible {
    outline: 3px solid #ff562f !important;
    outline-offset: 3px !important;
    box-shadow: none !important;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    outline: 3px solid #ff562f !important;
    outline-offset: 3px !important;
    box-shadow: none !important;
}

/* ==========================================================================
   Page Shell & Sticky Footer Architecture
   ========================================================================== */
html {
    min-height: 100%;
}

    html:not(.fp-enabled) body {
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        margin: 0;
        margin-bottom: 0 !important;
        font-size-adjust: from-font;
    }

    html:not(.fp-enabled) main#main-content {
        flex: 1 0 auto;
        width: 100%;
    }

/* Base Site Footer (for all standard scrolling pages) */
footer.footer-layout {
    flex-shrink: 0;
    width: 100%;
    position: relative;
    z-index: 10;
    background-color: var(--bs-body-bg);
    border-top: 1px solid var(--bs-border-color) !important;
    transition: background-color var(--duration-normal, 400ms) var(--ease-smooth, cubic-bezier(0.16, 1, 0.3, 1)), border-color var(--duration-normal, 400ms) var(--ease-smooth, cubic-bezier(0.16, 1, 0.3, 1));
}

[data-bs-theme="dark"] footer.footer-layout {
    background-color: #14171a;
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="light"] footer.footer-layout {
    background-color: #f8fafc;
    border-top-color: rgba(0, 0, 0, 0.08) !important;
}

/* Default in-flow FooterBottom content */
footer.footer-layout .FooterBottom {
    position: static !important;
    bottom: auto !important;
    z-index: auto !important;
    font-family: var(--font-family-headline, HelvelticaLight, "Helvetica Neue Light", system-ui, sans-serif);
    font-size: var(--font-size-label, 0.875rem);
    line-height: 1.5;
    padding: 0;
    color: var(--bs-secondary-color) !important;
}

[data-bs-theme="dark"] footer.footer-layout .FooterBottom {
    color: #94a3b8 !important;
}

[data-bs-theme="light"] footer.footer-layout .FooterBottom {
    color: #475569 !important;
}

footer.footer-layout .FooterBottom span {
    color: inherit;
}

/* Mobile: Ensure footer remains visible on non-fullpage pages */
@media screen and (max-width: 767px) {
    footer.footer-layout {
        display: block !important;
    }
}

/* Fullpage.js Screen & Viewport Normalization (Index, Products-Services, Clients) */
html.fp-enabled,
html.fp-enabled body,
html.fp-enabled main#main-content {
    height: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: relative;
}

    html.fp-enabled footer.footer-layout {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        border-top: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        z-index: 10;
        pointer-events: none;
    }

        html.fp-enabled footer.footer-layout .container-fluid {
            padding: 0 !important;
        }

        html.fp-enabled footer.footer-layout .FooterBottom {
            pointer-events: auto;
            position: absolute !important;
            bottom: 10px !important;
            width: 100%;
            color: rgba(255, 255, 255, 0.4) !important;
        }

    .fp-viewing-1 html.fp-enabled footer.footer-layout .FooterBottom,
    html.fp-enabled.fp-viewing-1 footer.footer-layout .FooterBottom {
        color: rgba(42, 63, 80, 0.7) !important;
    }

    .fp-viewing-2 html.fp-enabled footer.footer-layout .FooterBottom,
    html.fp-enabled.fp-viewing-2 footer.footer-layout .FooterBottom {
        color: rgba(99, 99, 99, 1) !important;
    }

@media screen and (max-width: 767px) {
    html.fp-enabled footer.footer-layout {
        display: none !important;
    }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Safe Area Inset Utilities */
:root {
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-top: env(safe-area-inset-top, 0px);
}

.pb-safe {
    padding-bottom: calc(1rem + var(--safe-area-bottom)) !important;
}

.pt-safe {
    padding-top: calc(1rem + var(--safe-area-top)) !important;
}

/* Theme Switcher Toggle styling (Floating Action Button in bottom-left) */
.BtnThemeToggle {
    background-color: var(--bs-body-bg);
    border: 1px solid rgba(var(--bs-emphasis-color-rgb), 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    color: var(--bs-body-color);
    transition: background-color var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-spring), border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
    padding: 0;
    position: fixed;
    bottom: calc(20px + var(--safe-area-bottom)); /* Respect safe area bottom on mobile */
    left: 20px;
    z-index: 1011; /* Keep above all other page content */
}

    .BtnThemeToggle:hover {
        background-color: var(--bs-tertiary-bg);
        transform: scale(1.1) rotate(6deg);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    }

    .BtnThemeToggle:active {
        transform: scale(0.94);
        transition-duration: 80ms;
    }

    .BtnThemeToggle svg {
        width: 22px;
        height: 22px;
        fill: currentColor;
        transition: transform var(--duration-normal) var(--ease-spring);
    }

    .BtnThemeToggle:hover svg {
        transform: rotate(18deg) scale(1.08);
    }

/* Dark mode overrides for custom items */
[data-bs-theme="dark"] .DivBgContacto,
[data-bs-theme="dark"] body {
    background-color: #121212 !important;
    color: #e0e0e0 !important;
}

[data-bs-theme="dark"] .InfoContactoCore,
[data-bs-theme="dark"] .RedesSociales,
[data-bs-theme="dark"] .LinkCorreoPlanes,
[data-bs-theme="dark"] .LinkMovilPlanes {
    color: #e0e0e0 !important;
    background-color: #121212 !important;
}

[data-bs-theme="dark"] .DivForm {
    background-color: #1e1e1e;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .form-floating .form-control,
[data-bs-theme="dark"] .form-floating .form-select {
    background-color: #2a2a2a;
    color: #fff;
    border-color: #444;
}

    [data-bs-theme="dark"] .form-floating .form-control:focus,
    [data-bs-theme="dark"] .form-floating .form-select:focus {
        border-color: #ff562f;
    }

[data-bs-theme="dark"] .form-floating label {
    color: #aaa;
}

[data-bs-theme="dark"] .DropListSeleccionePhoneType {
    color: #fff !important;
}

/* Mobile Social Button Touch Target & Icon Styling */
.BtnSocialMovil {
    display: none;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media screen and (max-width: 1366px) {
    .BtnSocialMovil {
        display: flex;
        position: absolute;
        z-index: 1006;
        right: 25px;
        bottom: 25px;
        width: 50px;
        height: 50px;
    }
}

@media screen and (max-width: 767px) {
    .BtnSocialMovil {
        right: 10px;
        bottom: 10px;
    }
}

.IconShareMobile {
    fill: #fff;
    width: 24px;
    height: 24px;
    pointer-events: none;
}

/* Animated Success Notification Card (Email sent successfully) */
.success-notification-card {
    background: rgba(40, 167, 69, 0.08);
    border: 2px solid #28a745;
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.15);
    animation: successCardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    backdrop-filter: blur(8px);
}

[data-bs-theme="dark"] .success-notification-card {
    background: rgba(40, 167, 69, 0.15);
    border-color: #34d399;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.success-animation-wrapper {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    position: relative;
}

.success-checkmark-svg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: block;
    stroke-width: 3.5;
    stroke: #28a745;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #28a745;
    animation: successFill 0.4s ease-in-out 0.4s forwards, successScale 0.3s ease-in-out 0.9s both;
}

[data-bs-theme="dark"] .success-checkmark-svg {
    stroke: #34d399;
}

.success-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3.5;
    stroke-miterlimit: 10;
    stroke: #28a745;
    fill: none;
    animation: successStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

[data-bs-theme="dark"] .success-circle {
    stroke: #34d399;
}

.success-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke: #28a745;
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    animation: successCheck 0.4s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards;
}

[data-bs-theme="dark"] .success-check {
    stroke: #34d399;
}

.success-title {
    color: #28a745;
    font-family: var(--font-family-headline, HelvelticaLight, system-ui, sans-serif);
    font-size: var(--font-size-subtitle, 1.25rem);
    font-weight: 600;
    letter-spacing: var(--letter-spacing-headline, -0.015em);
}

[data-bs-theme="dark"] .success-title {
    color: #34d399;
}

.success-desc {
    color: var(--bs-body-color);
    font-size: var(--font-size-body, 1rem);
    line-height: var(--line-height-body, 1.6);
    max-width: 480px;
    margin: 0 auto;
}

@keyframes successStroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes successCheck {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes successFill {
    100% {
        box-shadow: inset 0px 0px 0px 32px rgba(40, 167, 69, 0.12);
    }
}

@keyframes successScale {
    0%, 100% {
        transform: none;
    }

    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes successCardIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .success-notification-card,
    .success-checkmark-svg,
    .success-circle,
    .success-check,
    .BtnThemeToggle,
    .BtnThemeToggle svg {
        animation: none !important;
        stroke-dashoffset: 0 !important;
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Footer link styling */
.footer-link {
    color: var(--bs-body-color);
    opacity: 0.8;
    transition: opacity 0.2s ease, color 0.2s ease;
}

    .footer-link:hover, .footer-link:focus {
        opacity: 1;
        color: #ff562f;
        text-decoration: underline !important;
    }
