/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", sans-serif;
    height: 100vh;
    overflow: hidden;
    color: white;
}

/* HERO */
.hero {
    height: 100vh;

    background:
        radial-gradient(circle at 10% 85%, rgba(0,0,0,0.55), transparent 60%),
        linear-gradient(to bottom, #f5f5f5 0%, #bdbdbd 100%);

    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 60px;
    padding-top: 80px; /* 🔥 espacio para navbar */
    position: relative;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;

    background-image: url("https://www.transparenttextures.com/patterns/noise.png");
    opacity: 0.25;

    pointer-events: none;
}

/* overlay */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}

/* IZQUIERDA */
.content {
    position: relative;
    max-width: 520px;

    margin-left: 60px;   /* 🔥 mueve a la derecha de forma segura */

    animation: fadeLeft 1s ease;
}

.content h1 {
    font-size: 80px;     /* 🔥 un poco más grande */
    margin-bottom: 15px;
}

.content p {
    font-size: 18px;     /* 🔥 mejora legibilidad */
    color: #ddd;
    margin-bottom: 30px;
}

/* BOTÓN */
.btn {
    border: 1px solid white;
    padding: 12px 28px;
    border-radius: 30px;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: white;
    color: black;
}

/* DERECHA */
.cards {
    display: flex;
    gap: 20px;
    position: relative;
    animation: fadeRight 1s ease;
}

.card {
    width: 150px;
    height: 240px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: all 0.4s ease;
}

.card img {
    width: 100%;
    height: 100%;

    object-fit: contain;   /* 🔥 CLAVE */
    padding: 25px;         /* 🔥 espacio interno */

    display: block;
}

.card span {
    position: absolute;
    bottom: 15px;
    left: 15px;
    font-weight: bold;
    z-index: 2;
}

/* overlay hover */
.card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
    transition: 0.3s;
}

.card:hover::after {
    background: rgba(0,0,0,0.1);
}

.card:hover {
    transform: translateY(-12px) scale(1.05);
}

.card:hover img {
    transform: scale(1.1);
}

/* ANIMACIONES */
@keyframes fadeLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* MODAL */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    color: black;
    padding: 30px;
    border-radius: 16px;
    width: 400px;
    text-align: center;
    animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.tool-panel {
    position: fixed;

    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 1100px;          /* 🔥 más ancho */
    max-width: 95%;

    max-height: 85vh;       /* 🔥 límite vertical */
    overflow-y: auto;       /* 🔥 scroll interno */

    background: rgba(0,0,0,0.9);
    color: white;

    padding: 30px;
    border-radius: 16px;

    z-index: 10000;
}

.tool-panel h3 {
    margin-bottom: 10px;
}

.tool-panel input {
    padding: 8px;
    margin: 5px;
}

.tool-panel button {
    margin-top: 10px;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    background: white;
    color: black;
    cursor: pointer;
}

.drop-zone {
    border: 2px dashed white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
}

.drop-zone:hover {
    background: rgba(255,255,255,0.1);
}

/* 🔥 OVERLAY CORRECTO (FALTABA ESTO) */
.tool-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;

    background: rgba(0,0,0,0.6);

    display: none;

    z-index: 9999;
}

/* cuando se activa */
.tool-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview {
    margin-top: 20px;

    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));

    gap: 16px;

    max-height: 60vh;
    overflow-y: auto;
}

.page {
    background: white;
    border-radius: 10px;
    overflow: hidden;

    cursor: pointer;

    border: 3px solid transparent;

    transition: all 0.2s ease;
}

.page:hover {
    transform: scale(1.05);
}

.page canvas {
    width: 100%;
    height: auto;
}

.actions {
    margin-top: 20px;
    text-align: center;
}

.actions button {
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    background: white;
    color: black;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.actions button:hover {
    transform: scale(1.05);
}

.page {
    position: relative;
}

/* 🔥 círculo */
.selector {
    position: absolute;
    top: 8px;
    right: 8px;

    width: 24px;
    height: 24px;

    border-radius: 50%;
    border: 2px solid white;

    background: rgba(0,0,0,0.6);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 14px;
    font-weight: bold;
    color: white;

    pointer-events: none; /* 🔥 importante */
}

/* estado seleccionado */
.page.selected .selector {
    background: #4ade80;
    border-color: #4ade80;
    color: black;
}

.status-msg {
    margin-top: 8px;
    font-size: 13px;
    color: #aaa;
    text-align: center;
    min-height: 16px;
}
.order-info {
    margin-top: 10px;
    font-size: 14px;
    color: #ccc;
    text-align: center;
}

.page {
    cursor: grab;
}

.page:active {
    cursor: grabbing;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.signature {
    width: 150px;
    cursor: grab;
    transition: transform 0.2s ease;
}

.signature:hover {
    transform: scale(1.05);
}

.sign-controls button {
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    background: white;
    color: black;
    font-weight: bold;
    cursor: pointer;
}
.pdf-viewer {
    margin-top: 20px;
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center; /* 🔥 centra páginas */
}
.pdf-page {
    position: relative;
    margin-bottom: 20px;

    display: inline-block; /* 🔥 CLAVE */
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

/* 🔥 miniatura tipo ORDER */
.preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-item .thumb {
    width: 60px;
    height: 80px;
    overflow: hidden;
    border-radius: 6px;
}

/* 🔥 botones alineados */
#compress-btn {
    margin-top: 15px;
    display: inline-block;
}

#compress-status {
    margin-top: 10px;
}
canvas {
    display: block;
}

.card {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
}

.navbar {
    position: fixed;
    top: 0;
    width: 100%;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 15px 20px;

    z-index: 1000;

    background: transparent; /* 🔥 no barra */
}

.logo {
    font-size: 20px;
    font-weight: 600;
    color: white;
}

.menu {
    display: flex;
    gap: 25px;
}

.menu a {
    position: relative;
    text-decoration: none;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    transition: color 0.3s ease;
}

/* 🔥 línea animada */
.menu a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;

    width: 0%;
    height: 2px;

    background: white;
    transition: width 0.3s ease;
}

/* 🔥 hover */
.menu a:hover {
    color: white;
}

.menu a:hover::after {
    width: 100%;
}

.menu a:hover {
    color: white;
}
.hero {
    height: 100vh;

    display: flex;
    flex-direction: column;
}

/* 🔥 CONTENIDO PRINCIPAL */
.hero-main {
    flex: 1;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 🔥 MEJORA DE ESPACIADO */
.content {
    max-width: 450px;
    margin-right: 180px;   /* 🔥 más aire entre texto y cards */
}

/* 🔥 FOOTER MEJORADO */
.footer {
    width: 100%;
    text-align: center;

    font-size: 12px;
    color: rgba(255,255,255,0.6);

    margin-bottom: 15px;   /* 🔥 separación del borde */
    letter-spacing: 0.3px;

    flex-shrink: 0;
}

/* 🔥 LINKS SIN AZUL (IMPORTANTE) */
.footer a,
.footer a:visited,
.footer a:active {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
}

.footer a:hover {
    color: white;
}
@media (max-width: 1024px){

    body {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .hero {
        height: auto;
        padding: 100px 40px 40px;
        flex-direction: column;
    }

    .hero-main {
        flex-direction: column;
        align-items: center;
        gap: 40px;
        width: 100%;
    }

    .content {
        margin: 0;
        text-align: center;
    }

    .cards {
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
        max-width: 700px;
        justify-content: center;
    }
}
@media (max-width: 768px){

    body {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .hero {
        height: auto;
        padding: 100px 20px 40px;
        flex-direction: column;
    }

    .hero-main {
        flex-direction: column;
        align-items: center;
        gap: 30px;
        width: 100%;
    }

    .content {
        margin: 0;
        padding-left: 10px;
        text-align: left;
        align-self: flex-start;
    }

    .content h1 {
        font-size: 36px;
    }

    .content p {
        font-size: 16px;
    }

    .cards {
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
        max-width: 320px;
        gap: 15px;
        justify-content: center;
    }

    .card {
        width: 140px;
        height: 200px;
    }

    .footer {
        margin-top: 20px;
    }
}

.footer {
    position: relative;
    z-index: 10;   /* 🔥 CLAVE */
}
.footer a {
    display: inline-block;
    padding: 2px 4px;
}
.footer {
    position: relative;
    z-index: 2;
}

.footer {
    margin-top: 40px;   /* 🔥 controla el espacio */
}

.dynamic-text{
    margin-top: 10px;
    font-size: 14px;
    opacity: 0.7;

    text-align: center;   /* 🔥 centrado limpio */
}

#changing-text{
    display: inline-block;
    transition: opacity 0.5s ease;
}