/* =========================================================
   GUANA-CUP 2026 · styles.css
   Base global: variables, reset, tipografía, botones,
   header, footer, modal, utilidades, WhatsApp y firma
   ========================================================= */

/* ------------------------------
   1. VARIABLES GLOBALES
   ------------------------------ */
:root {
    /* Colores principales (estética del póster) */
    --color-bg: #0a0a0a;
    --color-bg-alt: #111111;
    --color-surface: #161616;
    --color-surface-2: #1d1d1d;
    --color-border: #2a2a2a;

    --color-primary: #c8102e;
    /* rojo karate */
    --color-primary-dark: #8f0a20;
    --color-primary-light: #e63946;

    --color-gold: #d4af37;
    /* dorado trofeo */
    --color-gold-light: #f2d675;

    --color-text: #f5f5f5;
    --color-text-muted: #a8a8a8;
    --color-text-dim: #6e6e6e;

    --color-success: #2ecc71;
    --color-error: #ff4d4d;
    --color-warning: #f1c40f;
    --color-whatsapp: #25D366;
    --color-whatsapp-dark: #1eb356;

    /* Tipografía */
    --font-display: 'Oswald', 'Arial Narrow', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;

    /* Radios */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    /* Sombras */
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, .35);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, .45);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);
    --shadow-red: 0 6px 24px rgba(200, 16, 46, .35);
    --shadow-green: 0 6px 24px rgba(37, 211, 102, .35);

    /* Espaciado */
    --space-xs: .5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;

    /* Layout */
    --container-max: 1140px;

    /* Transiciones */
    --t-fast: .15s ease;
    --t-med: .3s ease;
    --t-slow: .5s ease;
}

/* ------------------------------
   2. RESET
   ------------------------------ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

/* ------------------------------
   3. TIPOGRAFÍA
   ------------------------------ */
h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1.15;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
}

h3 {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
}

p {
    color: var(--color-text);
}

::selection {
    background: var(--color-primary);
    color: #fff;
}

/* ------------------------------
   4. LAYOUT / CONTAINER
   ------------------------------ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: .5rem;
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    background: var(--color-primary);
    margin: .75rem auto 0;
    border-radius: 2px;
}

.section-sub {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
    font-size: .95rem;
}

/* Vistas (landing / formulario / confirmación) */
.vista {
    display: none;
    animation: fadeIn var(--t-med);
}

.vista.vista-activa {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ------------------------------
   5. BOTONES
   ------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .75rem 1.5rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    transition: all var(--t-fast);
    text-align: center;
    white-space: nowrap;
    user-select: none;
}

.btn:disabled,
.btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Primary */
.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-red);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Outline */
.btn-outline {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--color-gold);
    color: var(--color-gold);
}

/* Success */
.btn-success {
    background: var(--color-success);
    color: #062e17;
    border-color: var(--color-success);
}

.btn-success:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* Ghost */
.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    padding: .5rem 1rem;
    font-size: .9rem;
}

.btn-ghost:hover {
    color: var(--color-text);
}

/* Tamaños */
.btn-sm {
    padding: .45rem 1rem;
    font-size: .85rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.05rem;
}

/* ------------------------------
   6. HEADER
   ------------------------------ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 10, .92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: .75rem;
    padding-bottom: .75rem;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: .95rem;
}

.brand-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.brand-text {
    color: var(--color-text);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: .85rem;
    letter-spacing: .05em;
    color: var(--color-text-muted);
    transition: color var(--t-fast);
}

.nav-link:hover {
    color: var(--color-gold);
}

@media (max-width: 520px) {
    .nav-link {
        display: none;
    }

    .brand-text {
        display: none;
    }
}

/* ------------------------------
   7. FOOTER
   ------------------------------ */
.site-footer {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-xl);
    padding: var(--space-lg) 0;
}

.footer-inner {
    text-align: center;
    color: var(--color-text-muted);
    font-size: .9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
}

.footer-small {
    color: var(--color-text-dim);
    font-size: .8rem;
}

.footer-inner .btn-whatsapp {
    margin-top: .75rem;
}

/* ------------------------------
   8. MODAL
   ------------------------------ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalIn var(--t-med);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.98);
    }

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
    font-size: 1.15rem;
    margin: 0;
}

.modal-close {
    font-size: 1.75rem;
    line-height: 1;
    color: var(--color-text-muted);
    padding: 0 .35rem;
    transition: color var(--t-fast);
}

.modal-close:hover {
    color: var(--color-primary-light);
}

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    color: var(--color-text);
    font-size: .95rem;
    line-height: 1.7;
}

.modal-body p {
    margin-bottom: .75rem;
}

.modal-body strong {
    color: var(--color-gold);
}

.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
}

/* ------------------------------
   9. UTILIDADES
   ------------------------------ */
.loading {
    text-align: center;
    color: var(--color-text-muted);
    padding: var(--space-lg) 0;
    font-style: italic;
}

.oculto {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-gold {
    color: var(--color-gold);
}

.text-muted {
    color: var(--color-text-muted);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-dark);
}

:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

/* =========================================================
   10. BOTÓN WHATSAPP
   ========================================================= */
.btn-whatsapp {
    background: var(--color-whatsapp);
    color: #062e17;
    border-color: var(--color-whatsapp);
    box-shadow: var(--shadow-green);
}

.btn-whatsapp:hover:not(:disabled) {
    background: var(--color-whatsapp-dark);
    border-color: var(--color-whatsapp-dark);
    transform: translateY(-2px);
}

.btn-whatsapp:active:not(:disabled) {
    transform: translateY(0);
}

/* =========================================================
   11. FIRMA DIBUJADA EN CANVAS
   ========================================================= */
.firma-wrap {
    position: relative;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    background: #fff;
    padding: .5rem;
    margin-top: .35rem;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.firma-wrap.error {
    border-color: var(--color-error);
    box-shadow: 0 0 0 3px rgba(255, 77, 77, .15);
}

#firmaCanvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 1;
    max-width: 100%;
    box-sizing: border-box;
    touch-action: none;
    cursor: crosshair;
    background: #fff;
    border-radius: var(--radius-sm);
}

#btnLimpiarFirma {
    position: absolute;
    top: .65rem;
    right: .65rem;
    background: rgba(0, 0, 0, .72);
    color: #fff;
    font-size: .75rem;
    padding: .35rem .7rem;
    border-radius: var(--radius-sm);
    transition: background var(--t-fast);
}

#btnLimpiarFirma:hover {
    background: rgba(0, 0, 0, .9);
    color: #fff;
}

#firmaError {
    display: block;
    margin-top: .35rem;
}