/* ============================================================
   MOP SIGNATURE GENERATOR — Estilos
   ============================================================ */

/* Layout */
#sg-wrapper {
    display: flex;
    gap: 36px;
    align-items: flex-start;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 14px;
    color: #333;
    max-width: 980px;
    margin: 0 auto;
    box-sizing: border-box;
}

#sg-form-panel {
    flex: 1;
    min-width: 280px;
    background: #f7f8fa;
    border: 1px solid #dde1e7;
    border-radius: 10px;
    padding: 26px 24px;
    box-sizing: border-box;
}

#sg-preview-panel {
    flex: 0 0 auto;
}

/* Titulo */
.sg-panel-title {
    margin: 0 0 20px;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    border-bottom: 3px solid #003D6E;
    padding-bottom: 8px;
}

/* Campos fijos */
.sg-field-fixed {
    margin-bottom: 14px;
}

.sg-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.sg-required { color: #C0272D; font-size: 13px; }

.sg-input {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid #ccd0d8;
    border-radius: 5px;
    font-size: 13.5px;
    color: #222;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.sg-input:focus {
    outline: none;
    border-color: #003D6E;
    box-shadow: 0 0 0 3px rgba(0, 61, 110, 0.12);
}

/* Campos arrastrables */
.sg-drag-hint {
    font-size: 11px;
    color: #999;
    margin: 0 0 8px;
    font-style: italic;
}

#sg-sortable {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.sg-field-drag {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #dde1e7;
    border-radius: 7px;
    padding: 10px 10px 10px 6px;
    transition: box-shadow 0.2s;
    box-sizing: border-box;
}

.sg-field-drag:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.09); }
.sg-field-drag.sortable-ghost { opacity: 0.35; background: #e3eaf5; }
.sg-field-drag.sortable-chosen { box-shadow: 0 4px 18px rgba(0,61,110,0.18); }

.sg-handle {
    font-size: 22px;
    color: #bbb;
    cursor: grab;
    user-select: none;
    line-height: 1;
    padding: 2px 4px;
    flex-shrink: 0;
    transition: color 0.2s;
}
.sg-handle:hover  { color: #003D6E; }
.sg-handle:active { cursor: grabbing; }

.sg-field-inner { flex: 1; min-width: 0; }

.sg-btn-remove {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #bbb;
    font-size: 15px;
    cursor: pointer;
    padding: 5px 7px;
    border-radius: 5px;
    line-height: 1;
    transition: color 0.2s, background 0.2s;
}
.sg-btn-remove:hover { color: #C0272D; background: #fff0f0; }

/* Agregar campo */
#sg-add-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.sg-btn-add {
    background: none;
    border: 2px dashed #003D6E;
    color: #003D6E;
    padding: 8px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
    white-space: nowrap;
}
.sg-btn-add:hover:not(:disabled) { background: #003D6E; color: #fff; }
.sg-btn-add:disabled { opacity: 0.45; cursor: not-allowed; border-style: solid; }

.sg-extra-counter { font-size: 11px; color: #999; }

/* Boton descargar */
.sg-btn-download {
    width: 100%;
    padding: 12px 20px;
    background: #C0272D;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
}
.sg-btn-download:hover:not(:disabled)  { background: #9e1f24; }
.sg-btn-download:active:not(:disabled) { transform: scale(0.98); }
.sg-btn-download:disabled { opacity: 0.6; cursor: not-allowed; }

/* Vista previa */
#sg-preview-outer {
    background: #d8dde5;
    padding: 28px 28px 22px;
    border-radius: 10px;
    display: inline-block;
}

.sg-preview-note {
    font-size: 11px;
    color: #999;
    text-align: center;
    margin: 10px 0 0;
}

/* ── Firma ────────────────────────────────────────────────── */
#sg-signature {
    background: #ffffff;
    width: 330px;
    font-family: Arial, Calibri, 'Helvetica Neue', sans-serif;
    font-size: 12px;
    color: #1a1a1a;
    line-height: 1.4;
    overflow: hidden;
    display: block;
}

/* Barra rojo | azul */
.sig-bar {
    height: 6px;
    background: linear-gradient(to right, #C0272D 50%, #003D6E 50%);
    display: block;
}

/* "TRABAJANDO PARA USTED" */
.sig-intro {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #111;
    padding: 7px 10px 6px;
    text-transform: uppercase;
    border-bottom: 1px solid #e2e2e2;
    display: block;
}

/* Contenido */
.sig-content { padding: 9px 10px 4px; }
.sig-content p { margin: 0 0 2px; padding: 0; display: block; }

.sig-name {
    font-weight: 700;
    font-size: 13px;
    color: #1a1a1a;
    margin-bottom: 3px !important;
}

.sig-line {
    font-size: 11.5px;
    color: #2a2a2a;
    line-height: 1.4;
}

/* Placeholders en gris (se ocultan al descargar) */
.sig-placeholder { color: #c8c8c8 !important; font-style: italic; }

/* Lineas vacias invisibles */
.sig-line:empty,
#sig-dynamic p:empty { display: none; }

/* Pie */
.sig-footer {
    border-top: 1px solid #e2e2e2;
    padding: 7px 10px 10px;
    margin-top: 8px;
}
.sig-footer p { margin: 0 0 1px; padding: 0; display: block; }
.sig-footer-line { font-weight: 700; font-size: 11px; color: #1a1a1a; }

/* Responsive */
@media (max-width: 780px) {
    #sg-wrapper { flex-direction: column; }
    #sg-preview-panel { width: 100%; }
    #sg-preview-outer { width: 100%; box-sizing: border-box; text-align: center; }
}
