/* ============================================================================
   THE WIN CAPITAL S.A. - reset.css
   Normalización y reset base
   ============================================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: var(--twc-header-total);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--twc-font-primary);
    font-size: var(--twc-text-base);
    font-weight: var(--twc-font-regular);
    line-height: var(--twc-leading-normal);
    color: var(--twc-text-primary);
    background-color: var(--twc-body-bg);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Prevenir scroll cuando modal o menu estan abiertos */
body.is-locked {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ---- Imagenes ---- */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

img {
    border-style: none;
    font-style: italic;
    background-repeat: no-repeat;
    background-size: cover;
    shape-margin: 0.75rem;
}

/* ---- Tipografia ---- */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--twc-font-bold);
    line-height: var(--twc-leading-tight);
    color: var(--twc-text-primary);
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

/* ---- Enlaces ---- */
a {
    color: inherit;
    text-decoration: none;
    transition: color var(--twc-transition-fast);
}

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

a:focus-visible {
    outline: 2px solid var(--twc-primary);
    outline-offset: 2px;
    border-radius: var(--twc-radius-sm);
}

/* ---- Botones ---- */
button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    padding: 0;
}

button:focus-visible {
    outline: 2px solid var(--twc-primary);
    outline-offset: 2px;
    border-radius: var(--twc-radius-sm);
}

/* ---- Formularios ---- */
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    border: var(--twc-border-width) solid var(--twc-border-color);
    border-radius: var(--twc-radius-md);
    background: var(--twc-gray-0);
    transition: border-color var(--twc-transition-fast),
                box-shadow var(--twc-transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--twc-primary);
    box-shadow: 0 0 0 3px rgba(var(--twc-primary-rgb), 0.15);
}

input::placeholder,
textarea::placeholder {
    color: var(--twc-gray-400);
    opacity: 1;
}

/* ---- Listas ---- */
ul, ol {
    list-style: none;
}

/* ---- Tablas ---- */
table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

/* ---- Seleccion ---- */
::selection {
    background-color: rgba(var(--twc-primary-rgb), 0.2);
    color: var(--twc-gray-900);
}

/* ---- Scrollbar personalizada ---- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--twc-gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--twc-gray-300);
    border-radius: var(--twc-radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--twc-gray-400);
}

/* Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--twc-gray-300) var(--twc-gray-100);
}

/* ---- Accesibilidad: Skip to content ---- */
.twc-skip-link {
    position: absolute;
    top: -100%;
    left: var(--twc-space-4);
    z-index: var(--twc-z-max);
    padding: var(--twc-space-3) var(--twc-space-6);
    background: var(--twc-primary);
    color: var(--twc-gray-900);
    font-weight: var(--twc-font-semibold);
    border-radius: 0 0 var(--twc-radius-md) var(--twc-radius-md);
    transition: top var(--twc-transition-fast);
}

.twc-skip-link:focus {
    top: 0;
    color: var(--twc-gray-900);
}

/* ---- Preloader ---- */
.twc-preloader {
    position: fixed;
    inset: 0;
    z-index: var(--twc-z-preloader);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--twc-gray-0);
    transition: opacity var(--twc-duration-500) var(--twc-ease-out),
                visibility var(--twc-duration-500) var(--twc-ease-out);
}

.twc-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.twc-preloader__spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--twc-gray-200);
    border-top-color: var(--twc-primary);
    border-radius: 50%;
    animation: twcSpin 0.7s linear infinite;
}

@keyframes twcSpin {
    to { transform: rotate(360deg); }
}