
/* ==========================================
   REPOSITORIO DE PROSPECTOS DIGITALES
   Epsylon Solutions
   Estilo corporativo - Demo Microsules
   ========================================== */

:root {
    --bg: #f3f7fa;
    --ink: #19364c;
    --muted: #718494;
    --primary: #0c4771;
    --primary-hover: #12618f;
    --secondary: #167e96;
    --line: #e1e9ef;
    --card: #ffffff;
    --danger: #b93b44;
    --success: #17805b;
    --radius: 14px;
    --shadow: 0 5px 22px rgba(20, 57, 82, 0.055);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    background: linear-gradient(
        180deg,
        #edf4f8 0%,
        #f7fafc 320px,
        #f3f7fa 100%
    );
    color: var(--ink);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================
   TIPOGRAFÍA
   ========================================== */

h1, h2, h3 {
    color: #143d5b;
    line-height: 1.3;
    letter-spacing: -0.4px;
}

h1 {
    font-size: 27px;
    font-weight: 700;
    margin: 0 0 22px;
}

h2 {
    font-size: 21px;
    margin: 0 0 16px;
}

h3 {
    font-size: 17px;
    margin: 24px 0 12px;
}

p {
    line-height: 1.7;
}

a {
    color: var(--secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary);
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(22, 126, 150, 0.25);
    outline-offset: 2px;
}

/* ==========================================
   CONTENEDOR PRINCIPAL
   ========================================== */

.wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ==========================================
   BARRA SUPERIOR
   ========================================== */

.nav {
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 12px rgba(12, 71, 113, 0.035);
}

.nav .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-top: 18px;
    padding-bottom: 18px;
}

.brand {
    font-size: 20px;
    font-weight: 750;
    letter-spacing: -0.5px;
    color: var(--primary);
}

.nav a {
    font-weight: 500;
}

/* ==========================================
   TARJETAS
   ========================================== */

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}

.card h1:first-child,
.card h2:first-child {
    margin-top: 0;
}

/* ==========================================
   LOGIN
   ========================================== */

.login {
    max-width: 450px;
    margin: 9vh auto;
}

.login .card {
    padding: 36px;
    border-top: 4px solid var(--primary);
}

.login h1 {
    text-align: center;
    margin-bottom: 28px;
}

/* ==========================================
   FORMULARIOS
   ========================================== */

.field {
    margin: 19px 0;
}

.field label {
    display: block;
    font-weight: 600;
    color: #24455d;
    margin-bottom: 8px;
    font-size: 13px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d3dfe7;
    border-radius: 9px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(22, 126, 150, 0.10);
    outline: none;
}

.field input[type="file"] {
    padding: 10px;
    background: #f8fafc;
    cursor: pointer;
}

.field input[type="file"]::file-selector-button {
    background: #e7f0f5;
    color: var(--primary);
    border: 0;
    padding: 9px 13px;
    border-radius: 6px;
    font-weight: 600;
    margin-right: 12px;
    cursor: pointer;
}

/* ==========================================
   BOTONES
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: var(--primary);
    color: #ffffff;
    padding: 11px 19px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition:
        background 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.btn:hover {
    background: var(--primary-hover);
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(12, 71, 113, 0.14);
    transform: translateY(-1px);
}

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

.btn.secondary {
    background: #eaf2f7;
    color: var(--primary);
    border-color: #d9e7ef;
}

.btn.secondary:hover {
    background: #dcebf3;
    color: var(--primary);
}

.btn.danger {
    background: var(--danger);
    color: #ffffff;
}

.btn.danger:hover {
    background: #a72c36;
}

/* ==========================================
   ENCABEZADOS Y BUSCADOR
   ========================================== */

.top {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 24px;
}

.search {
    padding: 12px 15px;
    border: 1px solid #d3dfe7;
    border-radius: 9px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    min-width: 280px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

/* ==========================================
   TABLAS
   ========================================== */

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

th {
    background: #f1f6f9;
    color: #34536a;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.45px;
}

th,
td {
    text-align: left;
    padding: 15px 13px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

tbody tr {
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: #f8fbfd;
}

tbody tr:last-child td {
    border-bottom: 0;
}

td a {
    font-weight: 600;
}

/* ==========================================
   TEXTOS SECUNDARIOS
   ========================================== */

.muted {
    color: var(--muted);
    font-size: 13px;
}

/* ==========================================
   MENSAJES
   ========================================== */

.alert {
    padding: 13px 17px;
    border-radius: 9px;
    background: #fff6e5;
    color: #805b1a;
    border: 1px solid #f5e5bf;
    margin-bottom: 18px;
}

.alert.ok,
.ok {
    background: #eaf7f0;
    color: #176646;
    border-color: #cce9da;
}

/* ==========================================
   PÁGINA PÚBLICA DE PROSPECTOS
   ========================================== */

.public {
    max-width: 780px;
    margin: 7vh auto;
}

.public .card {
    padding: 34px;
    border-top: 4px solid var(--secondary);
}

.public h1 {
    color: var(--primary);
}

.doc {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 20px 0;
    border-top: 1px solid var(--line);
}

.doc .btn {
    flex-shrink: 0;
}

/* ==========================================
   CÓDIGO QR
   ========================================== */

#qrcode {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

#qrcode img,
#qrcode canvas {
    max-width: 100%;
    height: auto;
}

/* ==========================================
   HISTORIAL DE VERSIONES
   ========================================== */

.historial {
    border-top: 3px solid var(--secondary);
}

.historial h2 {
    margin-bottom: 10px;
}

.historial h3 {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.historial .scroll {
    overflow-x: auto;
}

.historial .active {
    color: var(--success);
    font-weight: 700;
}

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

.historial .actions form {
    margin: 0;
}

.historial .btn-restore {
    cursor: pointer;
    padding: 8px 13px;
    background: #e8f0f7;
    color: var(--primary);
    border: 1px solid #d3e2ed;
    border-radius: 8px;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.2s ease;
}

.historial .btn-restore:hover {
    background: #d8e9f3;
}

/* ==========================================
   ELEMENTOS GENERALES
   ========================================== */

button,
input,
select,
textarea {
    font-family: inherit;
}

button {
    cursor: pointer;
}

::selection {
    background: #cce7ee;
    color: #143d5b;
}

/* ==========================================
   RESPONSIVE - TABLETS
   ========================================== */

@media (max-width: 900px) {
    .wrap {
        padding: 24px 18px;
    }

    .card {
        padding: 24px;
    }
}

/* ==========================================
   RESPONSIVE - CELULARES
   ========================================== */

@media (max-width: 700px) {

    body {
        font-size: 14px;
    }

    .wrap {
        padding: 18px 14px;
    }

    .nav .wrap {
        flex-wrap: wrap;
        gap: 12px;
    }

    .brand {
        font-size: 18px;
    }

    .card {
        padding: 20px 17px;
        border-radius: 12px;
    }

    h1 {
        font-size: 23px;
    }

    h2 {
        font-size: 19px;
    }

    .top {
        align-items: stretch;
        flex-direction: column;
    }

    .search {
        min-width: 0;
        width: 100%;
    }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    th,
    td {
        padding: 12px 10px;
        white-space: nowrap;
    }

    .public {
        margin: 20px auto;
    }

    .public .card {
        padding: 22px 18px;
    }

    .doc {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .doc .btn {
        width: 100%;
    }

    .login {
        margin: 5vh auto;
        padding: 0 14px;
    }

    .login .card {
        padding: 25px 20px;
    }

    .historial .actions {
        min-width: 170px;
    }
}

/* ==========================================
   ACCESIBILIDAD
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
