:root {
    --primary: #1E3A5F;
    --secondary: #2C5282;
    --accent: #E53E3E;
    --background: #F7FAFC;
    --surface: #FFFFFF;
    --text-primary: #1A202C;
    --text-secondary: #718096;
    --success: #38A169;
    --border: #E2E8F0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}
.sign-container{
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.header {
    background: #294267 !important;
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.header .subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.main-content {
    flex: 1;
    padding: 24px 0;
}

.panels {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    height: calc(100vh - 180px);
    min-height: 600px;
}

.panel {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.left-panel {
    padding: 24px;
    overflow-y: auto;
    gap: 20px;
}

.right-panel {
    display: flex;
    flex-direction: column;
}

.upload-section {
    margin-bottom: 20px;
}

.upload-section h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-section h2::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--background);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(30, 58, 95, 0.05);
}

.drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.upload-icon {
    width: 40px;
    height: 40px;
    color: var(--secondary);
}

.drop-zone p {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.drop-zone .small {
    font-size: 12px;
    color: var(--text-secondary);
}

.file-info {
    margin-top: 12px;
    padding: 12px;
    background: rgba(56, 161, 105, 0.1);
    border-radius: 6px;
    border-left: 3px solid var(--success);
}

.file-info p {
    font-size: 13px;
    color: var(--text-primary);
}

.file-info.hidden,
.hidden {
    display: none !important;
}

#cert-password-section {
    margin-top: 16px;
    padding: 16px;
    background: var(--background);
    border-radius: 8px;
}

#cert-password-section label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

#cert-password-section input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

#cert-password-section input:focus {
    outline: none;
    border-color: var(--primary);
}

.cert-details {
    margin-top: 16px;
    padding: 16px;
    background: var(--background);
    border-radius: 8px;
}

.cert-details h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.cert-field {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.cert-field .label {
    color: var(--text-secondary);
    font-weight: 500;
}

.cert-field .value {
    color: var(--text-primary);
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

.cert-field .value.status.valid {
    color: var(--success);
    font-weight: 600;
}

.cert-field .value.status.invalid {
    color: var(--accent);
    font-weight: 600;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--secondary);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #2F855A 100%);
    color: white;
    font-size: 16px;
    padding: 16px 24px;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.actions {
    margin-top: auto;
    padding-top: 20px;
}

.pdf-viewer-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #525659;
    overflow: hidden;
}

.viewer-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.viewer-controls span {
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 120px;
    text-align: center;
}

.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.control-btn:hover {
    background: var(--background);
    border-color: var(--primary);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pdf-viewer {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    padding: 24px;
    position: relative;
}

#pdf-canvas {
    box-shadow: var(--shadow-lg);
    background: white;
}

.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    gap: 16px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.placeholder p {
    font-size: 14px;
}

.signature-box {
    position: absolute;
    min-width: 100px;
    min-height: 40px;
    background: rgba(30, 58, 95, 0.1);
    border: 2px dashed var(--primary);
    border-radius: 4px;
    cursor: move;
    user-select: none;
    z-index: 100;
}

.signature-box.active {
    background: rgba(30, 58, 95, 0.2);
    border-style: solid;
}

.signature-box .box-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border: 1px solid white;
    border-radius: 2px;
}

.resize-handle.nw {
    top: -5px;
    left: -5px;
    cursor: nw-resize;
}

.resize-handle.ne {
    top: -5px;
    right: -5px;
    cursor: ne-resize;
}

.resize-handle.sw {
    bottom: -5px;
    left: -5px;
    cursor: sw-resize;
}

.resize-handle.se {
    bottom: -5px;
    right: -5px;
    cursor: se-resize;
}

.draw-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(40, 58, 90, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 50;
}

.draw-hint.hidden {
    display: none;
}

.signature-header {
    background: rgba(40, 58, 90, 0.9);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px 6px 0 0;
}

.signature-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100% - 24px);
    color: white;
    font-size: 12px;
}

.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 16px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    gap: 16px;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    color: white;
    font-size: 14px;
}

@media (max-width: 1024px) {
    .panels {
        grid-template-columns: 1fr;
        height: auto;
    }

    .right-panel {
        min-height: 500px;
    }

    .pdf-viewer {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .header h1 {
        font-size: 20px;
    }

    .left-panel {
        padding: 16px;
    }
}

.pdf-viewer {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 24px;
    position: relative;
    background: #525659;
}

#pdf-canvas {
    box-shadow: var(--shadow-lg);
    background: white;
    display: block;
    margin: 0 auto;
}

.signature-box {
    position: absolute;
    min-width: 100px;
    min-height: 40px;
    background: rgba(30, 58, 95, 0.1);
    border: 2px dashed var(--primary);
    border-radius: 4px;
    cursor: move;
    user-select: none;
    z-index: 100;
    pointer-events: all; /* Asegurar que los eventos del mouse funcionen */
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-title {
    margin: 0;
    font-size: 20px; /* ajusta a tu gusto */
    color: #00cdfd;
}

.subtitle {
    margin: 0;
    font-size: 12px;
    opacity: .9;
}

/*--------------------------------------------------------------
# Navigation Menu
--------------------------------------------------------------*/
/**
* Desktop Navigation
*/
.navbar {
    padding: 0;
}

.navbar ul {
    margin: 0;
    padding: 0;
    display: flex;
    list-style: none;
    align-items: center;
}

.navbar li {
    position: relative;
}

.navbar a,
.navbar a:focus {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0 10px 30px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    transition: 0.3s;
}

.navbar a i,
.navbar a:focus i {
    font-size: 12px;
    line-height: 0;
    margin-left: 5px;
}

.navbar a:hover,
.navbar .active,
.navbar .active:focus,
.navbar li:hover > a {
    color: #47b2e4;
}

.navbar .getstarted,
.navbar .getstarted:focus {
    padding: 8px 20px;
    margin-left: 30px;
    border-radius: 50px;
    color: #fff;
    font-size: 14px;
    border: 2px solid #47b2e4;
    font-weight: 600;
}

.navbar .getstarted:hover,
.navbar .getstarted:focus:hover {
    color: #fff;
    background: #31a9e1;
}

.navbar .dropdown ul {
    display: block;
    position: absolute;
    left: 14px;
    top: calc(100% + 30px);
    margin: 0;
    padding: 10px 0;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    background: #fff;
    box-shadow: 0px 0px 30px rgba(127, 137, 161, 0.25);
    transition: 0.3s;
    border-radius: 4px;
}

.navbar .dropdown ul li {
    min-width: 200px;
}

.navbar .dropdown ul a {
    padding: 10px 20px;
    font-size: 14px;
    text-transform: none;
    font-weight: 500;
    color: #0c3c53;
}

.navbar .dropdown ul a i {
    font-size: 12px;
}

.navbar .dropdown ul a:hover,
.navbar .dropdown ul .active:hover,
.navbar .dropdown ul li:hover > a {
    color: #47b2e4;
}

.navbar .dropdown:hover > ul {
    opacity: 1;
    top: 100%;
    visibility: visible;
}

.navbar .dropdown .dropdown ul {
    top: 0;
    left: calc(100% - 30px);
    visibility: hidden;
}

.navbar .dropdown .dropdown:hover > ul {
    opacity: 1;
    top: 0;
    left: 100%;
    visibility: visible;
}

@media (max-width: 1366px) {
    .navbar .dropdown .dropdown ul {
        left: -90%;
    }

    .navbar .dropdown .dropdown:hover > ul {
        left: -100%;
    }
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 25px;
}

.btn-home {
    font-size: 22px;
    color: white;
    text-decoration: none;
    padding: 8px;
    border-radius: 6px;
    transition: all .2s ease;
}

.btn-home:hover {
    background: rgba(255, 255, 255, 0.15);
}

/*--------------------------------------------------------------
# Footer
--------------------------------------------------------------*/
#footer{
    background:#294267;
    color:#ffffff;
    padding:30px 0;
    margin-top:40px;
}

#footer .container{
    max-width:1200px;
    margin:0 auto;
    padding:0 20px;
    text-align:center;
}

#footer .copyright{
    font-size:14px;
    margin-bottom:8px;
}

#footer a{
    color:#9fd3ff;
    text-decoration:none;
    margin:0 8px;
    font-size:13px;
}

#footer a:hover{
    color:#ffffff;
    text-decoration:underline;
}

.sign-intro{
    padding: 18px 0 0 0;
}

.sign-intro-card{
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: var(--shadow);
}

.sign-intro-card h2{
    font-size: 16px;
    margin: 0 0 6px 0;
    color: var(--primary);
    font-weight: 700;
}

.sign-intro-card p{
    margin: 0 0 10px 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.sign-intro-card ul{
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.sign-intro-card li{
    font-size: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sign-intro-card i{
    color: var(--success);
    font-size: 14px;
}

/* ===========================
   Banner Publicidad (ARREGLADO)
   =========================== */
.fe-ad {
    padding: 18px 0 8px;
}

.fe-ad-card {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: #f6f7f9;
    box-shadow: none;

    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 12px;

    padding: 50px;
    border: 1px solid rgba(30, 58, 95, .18);
}

/* Marco sutil (no tan grueso) */
.fe-ad-card::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 18px;
    border: 1px solid rgba(30, 58, 95, .14);
    pointer-events: none;
}

/* Contenido */
.fe-ad-content {
    position: relative;
    z-index: 2;
    padding: 8px 10px 8px 8px;
}

/* Título */
.fe-ad-title {
    margin: 0 0 25px;
    font-size: 35px;
    line-height: 1.02;
    letter-spacing: -0.5px;
    color: #0b2d4a;
    font-weight: 900;
    max-width: 720px;
}

.fe-ad-title span {
    position: relative;
    display: inline-block;
    color: #1e5fec;
}

.fe-ad-title span::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -8px;
    height: 6px;
    border-radius: 999px;
}

/* Franja azul */
.fe-ad-bar {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    background: #0c3555;
    color: #fff;
    padding: 12px 14px;
    border-radius: 14px;

    font-size: 14px;
    line-height: 1.35;
    box-shadow: 0 16px 28px rgba(12, 53, 85, .18);
}

.fe-ad-badge {
    background: rgb(255, 0, 0);
    border: 1px solid rgba(255, 255, 255, .18);
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
    white-space: nowrap;
}

/* Chips */
.fe-ad-chips {
    margin-top: 16px;
    display: grid;
    gap: 12px;
    max-width: 760px;
}

.fe-chip {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 12px 14px;
    border-radius: 999px;
    background: #fff;
    border: 2px solid rgba(242, 194, 0, .55);
    box-shadow: 0 16px 24px rgba(0, 0, 0, .08);

    font-weight: 900;
    color: #0b2d4a;
    letter-spacing: .2px;
}

.fe-chip-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(242, 194, 0, .18);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(242, 194, 0, .55);
}

.fe-chip-icon i {
    font-size: 18px;
    color: #0b2d4a;
}

/* Botones */
.fe-ad-actions {
    margin-top: 14px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.fe-ad-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 900;
    font-size: 14px;
    border: 2px solid transparent;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    background: #43c643;
    color: whitesmoke;
}

.fe-ad-btn:active {
    transform: scale(.98);
}

.fe-ad-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #0c3555, #1E3A5F);
    box-shadow: 0 18px 30px rgba(12, 53, 85, .22);
}

.fe-ad-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 36px rgba(12, 53, 85, .28);
}

.fe-ad-btn-ghost {
    color: #0c3555;
    background: rgba(255, 255, 255, .95);
    border-color: rgba(12, 53, 85, .18);
}

.fe-ad-btn-ghost:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 30px rgba(0, 0, 0, .10);
}

/* Nota partner */
.fe-ad-note {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    color: rgba(11, 45, 74, .75);
    font-size: 13px;
    font-weight: 800;
}

.fe-ad-note i {
    color: #22c55e;
    font-size: 16px;
}

/* Imagen derecha (ARREGLADO) */
.fe-ad-figure {
    position: relative;
    z-index: 2;

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

    padding: 0px;
}

.fe-ad-figure img {
    width: 80%;
    height: auto;
    object-fit: contain;
    box-shadow: none;
    border-radius: 0;
    filter: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .fe-ad-card {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .fe-ad-title {
        font-size: 34px;
    }

    .fe-ad-figure img {
        max-height: 240px;
    }
}

@media (max-width: 520px) {
    .fe-ad-title {
        font-size: 28px;
    }

    .fe-ad-bar {
        width: 100%;
        justify-content: space-between;
    }
}

.fe-ad-figure,
.fe-ad-figure img {
    box-shadow: none !important;
    filter: none !important;
}